Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b492d6a

Browse files
Quinn Tranmartinkpetersen
authored andcommitted
scsi: qla2xxx: edif: Fix app start delay
Current driver does unnecessary pause for each session to get to certain state before allowing the app start call to return. In larger environment, this introduces a long delay. Originally the delay was meant to synchronize app and driver. However, the with current implementation the two sides use various events to synchronize their state. The same is applied to the authentication failure call. Link: https://lore.kernel.org/r/[email protected] Fixes: 4de067e ("scsi: qla2xxx: edif: Add N2N support for EDIF") Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8e6d5df commit b492d6a

File tree

1 file changed

+3
-61
lines changed

1 file changed

+3
-61
lines changed

drivers/scsi/qla2xxx/qla_edif.c

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -290,63 +290,6 @@ qla_edif_app_check(scsi_qla_host_t *vha, struct app_id appid)
290290
return false;
291291
}
292292

293-
static void qla_edif_reset_auth_wait(struct fc_port *fcport, int state,
294-
int waitonly)
295-
{
296-
int cnt, max_cnt = 200;
297-
bool traced = false;
298-
299-
fcport->keep_nport_handle = 1;
300-
301-
if (!waitonly) {
302-
qla2x00_set_fcport_disc_state(fcport, state);
303-
qlt_schedule_sess_for_deletion(fcport);
304-
} else {
305-
qla2x00_set_fcport_disc_state(fcport, state);
306-
}
307-
308-
ql_dbg(ql_dbg_edif, fcport->vha, 0xf086,
309-
"%s: waiting for session, max_cnt=%u\n",
310-
__func__, max_cnt);
311-
312-
cnt = 0;
313-
314-
if (waitonly) {
315-
/* Marker wait min 10 msecs. */
316-
msleep(50);
317-
cnt += 50;
318-
}
319-
while (1) {
320-
if (!traced) {
321-
ql_dbg(ql_dbg_edif, fcport->vha, 0xf086,
322-
"%s: session sleep.\n",
323-
__func__);
324-
traced = true;
325-
}
326-
msleep(20);
327-
cnt++;
328-
if (waitonly && (fcport->disc_state == state ||
329-
fcport->disc_state == DSC_LOGIN_COMPLETE))
330-
break;
331-
if (fcport->disc_state == DSC_LOGIN_AUTH_PEND)
332-
break;
333-
if (cnt > max_cnt)
334-
break;
335-
}
336-
337-
if (!waitonly) {
338-
ql_dbg(ql_dbg_edif, fcport->vha, 0xf086,
339-
"%s: waited for session - %8phC, loopid=%x portid=%06x fcport=%p state=%u, cnt=%u\n",
340-
__func__, fcport->port_name, fcport->loop_id,
341-
fcport->d_id.b24, fcport, fcport->disc_state, cnt);
342-
} else {
343-
ql_dbg(ql_dbg_edif, fcport->vha, 0xf086,
344-
"%s: waited ONLY for session - %8phC, loopid=%x portid=%06x fcport=%p state=%u, cnt=%u\n",
345-
__func__, fcport->port_name, fcport->loop_id,
346-
fcport->d_id.b24, fcport, fcport->disc_state, cnt);
347-
}
348-
}
349-
350293
static void
351294
qla_edif_free_sa_ctl(fc_port_t *fcport, struct edif_sa_ctl *sa_ctl,
352295
int index)
@@ -583,8 +526,8 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
583526
ql_dbg(ql_dbg_edif, vha, 0x911e,
584527
"%s wwpn %8phC calling qla_edif_reset_auth_wait\n",
585528
__func__, fcport->port_name);
586-
fcport->edif.app_sess_online = 1;
587-
qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 0);
529+
fcport->edif.app_sess_online = 0;
530+
qlt_schedule_sess_for_deletion(fcport);
588531
qla_edif_sa_ctl_init(vha, fcport);
589532
}
590533
}
@@ -800,7 +743,6 @@ qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
800743
ql_dbg(ql_dbg_edif, vha, 0x911e,
801744
"%s AUTH complete - RESUME with prli for wwpn %8phC\n",
802745
__func__, fcport->port_name);
803-
qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 1);
804746
qla24xx_post_prli_work(vha, fcport);
805747
}
806748

@@ -873,7 +815,7 @@ qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
873815

874816
if (qla_ini_mode_enabled(fcport->vha)) {
875817
fcport->send_els_logo = 1;
876-
qla_edif_reset_auth_wait(fcport, DSC_LOGIN_PEND, 0);
818+
qlt_schedule_sess_for_deletion(fcport);
877819
}
878820
}
879821

0 commit comments

Comments
 (0)