Skip to content

Commit 877b037

Browse files
igawmartinkpetersen
authored andcommitted
scsi: qla2xxx: Add option to disable FC2 Target support
Commit 44c57f2 ("scsi: qla2xxx: Changes to support FCP2 Target") added support for FC2 Targets. Unfortunately, there are older setups which break with this new feature enabled. Allow to disable it via module option. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Wagner <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 6cc55c9 commit 877b037

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

drivers/scsi/qla2xxx/qla_gbl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ extern int ql2xsecenable;
192192
extern int ql2xenforce_iocb_limit;
193193
extern int ql2xabts_wait_nvme;
194194
extern u32 ql2xnvme_queues;
195+
extern int ql2xfc2target;
195196

196197
extern int qla2x00_loop_reset(scsi_qla_host_t *);
197198
extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
18401840
case RSCN_PORT_ADDR:
18411841
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
18421842
if (fcport) {
1843-
if (fcport->flags & FCF_FCP2_DEVICE &&
1843+
if (ql2xfc2target &&
1844+
fcport->flags & FCF_FCP2_DEVICE &&
18441845
atomic_read(&fcport->state) == FCS_ONLINE) {
18451846
ql_dbg(ql_dbg_disc, vha, 0x2115,
18461847
"Delaying session delete for FCP2 portid=%06x %8phC ",

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,13 @@ MODULE_PARM_DESC(ql2xnvme_queues,
360360
"1 - Minimum number of queues supported\n"
361361
"8 - Default value");
362362

363+
int ql2xfc2target = 1;
364+
module_param(ql2xfc2target, int, 0444);
365+
MODULE_PARM_DESC(qla2xfc2target,
366+
"Enables FC2 Target support. "
367+
"0 - FC2 Target support is disabled. "
368+
"1 - FC2 Target support is enabled (default).");
369+
363370
static struct scsi_transport_template *qla2xxx_transport_template = NULL;
364371
struct scsi_transport_template *qla2xxx_transport_vport_template = NULL;
365372

@@ -4085,7 +4092,8 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha)
40854092
"Mark all dev lost\n");
40864093

40874094
list_for_each_entry(fcport, &vha->vp_fcports, list) {
4088-
if (fcport->loop_id != FC_NO_LOOP_ID &&
4095+
if (ql2xfc2target &&
4096+
fcport->loop_id != FC_NO_LOOP_ID &&
40894097
(fcport->flags & FCF_FCP2_DEVICE) &&
40904098
fcport->port_type == FCT_TARGET &&
40914099
!qla2x00_reset_active(vha)) {

0 commit comments

Comments
 (0)