scsi: qla2xxx: Fix NPIV create erroneous error
authorQuinn Tran <qutran@marvell.com>
Tue, 10 Aug 2021 04:37:15 +0000 (21:37 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Aug 2021 03:17:57 +0000 (23:17 -0400)
When user creates multiple NPIVs, the switch capabilities field is checked
before a vport is allowed to be created. This field is being toggled if a
switch scan is in progress. This creates erroneous reject of vport create.

Link: https://lore.kernel.org/r/20210810043720.1137-10-njavali@marvell.com
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>
drivers/scsi/qla2xxx/qla_init.c

index e9a3996..9e891d2 100644 (file)
@@ -4623,11 +4623,11 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
        /* initialize */
        ha->min_external_loopid = SNS_FIRST_LOOP_ID;
        ha->operating_mode = LOOP;
-       ha->switch_cap = 0;
 
        switch (topo) {
        case 0:
                ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n");
+               ha->switch_cap = 0;
                ha->current_topology = ISP_CFG_NL;
                strcpy(connect_type, "(Loop)");
                break;
@@ -4641,6 +4641,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
 
        case 2:
                ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n");
+               ha->switch_cap = 0;
                ha->operating_mode = P2P;
                ha->current_topology = ISP_CFG_N;
                strcpy(connect_type, "(N_Port-to-N_Port)");
@@ -4657,6 +4658,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
        default:
                ql_dbg(ql_dbg_disc, vha, 0x200f,
                    "HBA in unknown topology %x, using NL.\n", topo);
+               ha->switch_cap = 0;
                ha->current_topology = ISP_CFG_NL;
                strcpy(connect_type, "(Loop)");
                break;