Skip to content

Commit

Permalink
scsi: qla2xxx: edif: Fix app start fail
Browse files Browse the repository at this point in the history
[ Upstream commit 8e6d5df ]

On app start, all sessions need to be reset to see if secure connection can
be made. Fix the broken check which prevents that process.

Link: https://lore.kernel.org/r/20211026115412.27691-5-njavali@marvell.com
Fixes: 4de067e ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Quinn Tran authored and gregkh committed Nov 18, 2021
1 parent 09e4daf commit 696815e
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions drivers/scsi/qla2xxx/qla_edif.c
Expand Up @@ -529,7 +529,8 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
struct app_start_reply appreply;
struct fc_port *fcport, *tf;

ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app start\n", __func__);
ql_log(ql_log_info, vha, 0x1313,
"EDIF application registration with driver, FC device connections will be re-established.\n");

sg_copy_to_buffer(bsg_job->request_payload.sg_list,
bsg_job->request_payload.sg_cnt, &appstart,
Expand All @@ -554,37 +555,36 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
qla2xxx_wake_dpc(vha);
} else {
list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
ql_dbg(ql_dbg_edif, vha, 0x2058,
"FCSP - nn %8phN pn %8phN portid=%06x.\n",
fcport->node_name, fcport->port_name,
fcport->d_id.b24);
ql_dbg(ql_dbg_edif, vha, 0xf084,
"%s: sess %p %8phC lid %#04x s_id %06x logout %d\n",
__func__, fcport, fcport->port_name,
fcport->loop_id, fcport->d_id.b24,
fcport->logout_on_delete);

ql_dbg(ql_dbg_edif, vha, 0xf084,
"keep %d els_logo %d disc state %d auth state %d stop state %d\n",
fcport->keep_nport_handle,
fcport->send_els_logo, fcport->disc_state,
fcport->edif.auth_state, fcport->edif.app_stop);
"%s: se_sess %p / sess %p from port %8phC "
"loop_id %#04x s_id %06x logout %d "
"keep %d els_logo %d disc state %d auth state %d"
"stop state %d\n",
__func__, fcport->se_sess, fcport,
fcport->port_name, fcport->loop_id,
fcport->d_id.b24, fcport->logout_on_delete,
fcport->keep_nport_handle, fcport->send_els_logo,
fcport->disc_state, fcport->edif.auth_state,
fcport->edif.app_stop);

if (atomic_read(&vha->loop_state) == LOOP_DOWN)
break;
if (!(fcport->flags & FCF_FCSP_DEVICE))
continue;

fcport->edif.app_started = 1;
if (fcport->edif.app_stop ||
(fcport->disc_state != DSC_LOGIN_COMPLETE &&
fcport->disc_state != DSC_LOGIN_PEND &&
fcport->disc_state != DSC_DELETED)) {
/* no activity */
fcport->edif.app_stop = 0;

ql_dbg(ql_dbg_edif, vha, 0x911e,
"%s wwpn %8phC calling qla_edif_reset_auth_wait\n",
__func__, fcport->port_name);
fcport->edif.app_sess_online = 1;
qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 0);
}
fcport->login_retry = vha->hw->login_retry_count;

/* no activity */
fcport->edif.app_stop = 0;

ql_dbg(ql_dbg_edif, vha, 0x911e,
"%s wwpn %8phC calling qla_edif_reset_auth_wait\n",
__func__, fcport->port_name);
fcport->edif.app_sess_online = 1;
qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 0);
qla_edif_sa_ctl_init(vha, fcport);
}
}
Expand Down

0 comments on commit 696815e

Please sign in to comment.