]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qla2xxx: disable scsi_transport_fc registration in target mode
authorAlexei Potashnik <alexei@purestorage.com>
Tue, 14 Jul 2015 20:00:47 +0000 (16:00 -0400)
committerBrian Maly <brian.maly@oracle.com>
Thu, 2 Nov 2017 18:14:13 +0000 (14:14 -0400)
Orabug: 2684419726923029

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>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c

index 9e8e36c598c3273efc650e199d0cb4c969e5bf52..00cbbb64df2b437d74a4520d8ef0bbbe82c4fd20 100644 (file)
@@ -3364,8 +3364,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
 
        if (IS_QLAFX00(vha->hw)) {
                qla2x00_set_fcport_state(fcport, FCS_ONLINE);
-               qla2x00_reg_remote_port(vha, fcport);
-               return;
+               goto reg_port;
        }
        fcport->login_retry = 0;
        fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
@@ -3373,7 +3372,16 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
        qla2x00_set_fcport_state(fcport, FCS_ONLINE);
        qla2x00_iidma_fcport(vha, fcport);
        qla24xx_update_fcport_fcp_prio(vha, fcport);
-       qla2x00_reg_remote_port(vha, fcport);
+
+reg_port:
+       if (qla_ini_mode_enabled(vha))
+               qla2x00_reg_remote_port(vha, fcport);
+       else {
+               /*
+                * Create target mode FC NEXUS in qla_target.c
+                */
+               qlt_fc_port_added(vha, fcport);
+       }
 }
 
 /*
index b0f348789edb30652a0c77c85a2fb1294cb8982e..0b4cc6309b25ce3cd0e953f45003bd3f1471dc0a 100644 (file)
@@ -3487,7 +3487,8 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
                qla2xxx_wake_dpc(base_vha);
        } else {
                int now;
-               fc_remote_port_delete(rport);
+               if (rport)
+                       fc_remote_port_delete(rport);
                qlt_do_generation_tick(vha, &now);
                qlt_fc_port_deleted(vha, fcport, now);
        }