Skip to content

Commit d20ed91

Browse files
alexeipstgNicholas Bellinger
authored andcommitted
qla2xxx: disable scsi_transport_fc registration in target mode
There are multiple reasons for disabling this: 1. It provides no functional benefit. We pretty much only get a few more sysfs entries for each port, but all that information is already available from /sys/kernel/debug/target/qla-session-X 2. It already only works in private-loop mode. By disabling we'll be getting more uniform behavior with fabric mode. 3. It creates complications for the new PLOGI handling mechanism: scsi_transport_fc port deletion timer could race with new session from initiator and cause logout after successful login. Cc: <stable@vger.kernel.org> # v3.18+ Signed-off-by: Alexei Potashnik <alexei@purestorage.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent df67327 commit d20ed91

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,16 +3340,24 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
33403340

33413341
if (IS_QLAFX00(vha->hw)) {
33423342
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
3343-
qla2x00_reg_remote_port(vha, fcport);
3344-
return;
3343+
goto reg_port;
33453344
}
33463345
fcport->login_retry = 0;
33473346
fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
33483347

33493348
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
33503349
qla2x00_iidma_fcport(vha, fcport);
33513350
qla24xx_update_fcport_fcp_prio(vha, fcport);
3352-
qla2x00_reg_remote_port(vha, fcport);
3351+
3352+
reg_port:
3353+
if (qla_ini_mode_enabled(vha))
3354+
qla2x00_reg_remote_port(vha, fcport);
3355+
else {
3356+
/*
3357+
* Create target mode FC NEXUS in qla_target.c
3358+
*/
3359+
qlt_fc_port_added(vha, fcport);
3360+
}
33533361
}
33543362

33553363
/*

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,8 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
32353235
qla2xxx_wake_dpc(base_vha);
32363236
} else {
32373237
int now;
3238-
fc_remote_port_delete(rport);
3238+
if (rport)
3239+
fc_remote_port_delete(rport);
32393240
qlt_do_generation_tick(vha, &now);
32403241
qlt_fc_port_deleted(vha, fcport, now);
32413242
}

0 commit comments

Comments
 (0)