Skip to content

Commit 2b5b964

Browse files
Darren Trappmartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix FC-NVMe LUN discovery
commit a423994 ("scsi: qla2xxx: Add switch command to simplify fabric discovery") introduced regression when it did not consider FC-NVMe code path which broke NVMe LUN discovery. Fixes: a423994 ("scsi: qla2xxx: Add switch command to simplify fabric discovery") Signed-off-by: Darren Trapp <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e39a973 commit 2b5b964

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,7 @@ typedef struct {
22172217

22182218
/* FCP-4 types */
22192219
#define FC4_TYPE_FCP_SCSI 0x08
2220+
#define FC4_TYPE_NVME 0x28
22202221
#define FC4_TYPE_OTHER 0x0
22212222
#define FC4_TYPE_UNKNOWN 0xff
22222223

drivers/scsi/qla2xxx/qla_gs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,6 +3973,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
39733973
spin_lock_irqsave(&vha->work_lock, flags);
39743974
vha->scan.scan_flags &= ~SF_SCANNING;
39753975
spin_unlock_irqrestore(&vha->work_lock, flags);
3976+
3977+
if ((fc4type == FC4_TYPE_FCP_SCSI) && vha->flags.nvme_enabled)
3978+
qla24xx_async_gpnft(vha, FC4_TYPE_NVME);
39763979
}
39773980

39783981
static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res)

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
10611061
fc_port_t *fcport = ea->fcport;
10621062
struct port_database_24xx *pd;
10631063
struct srb *sp = ea->sp;
1064+
uint8_t ls;
10641065

10651066
pd = (struct port_database_24xx *)sp->u.iocb_cmd.u.mbx.in;
10661067

@@ -1073,7 +1074,12 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
10731074
if (fcport->disc_state == DSC_DELETE_PEND)
10741075
return;
10751076

1076-
switch (pd->current_login_state) {
1077+
if (fcport->fc4f_nvme)
1078+
ls = pd->current_login_state >> 4;
1079+
else
1080+
ls = pd->current_login_state & 0xf;
1081+
1082+
switch (ls) {
10771083
case PDS_PRLI_COMPLETE:
10781084
__qla24xx_parse_gpdb(vha, fcport, pd);
10791085
break;

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,9 +4807,12 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)
48074807
fcport->d_id = e->u.new_sess.id;
48084808
fcport->flags |= FCF_FABRIC_DEVICE;
48094809
fcport->fw_login_state = DSC_LS_PLOGI_PEND;
4810-
if (e->u.new_sess.fc4_type == FC4_TYPE_FCP_SCSI)
4810+
if (e->u.new_sess.fc4_type == FC4_TYPE_FCP_SCSI) {
48114811
fcport->fc4_type = FC4_TYPE_FCP_SCSI;
4812-
4812+
} else if (e->u.new_sess.fc4_type == FC4_TYPE_NVME) {
4813+
fcport->fc4_type = FC4_TYPE_OTHER;
4814+
fcport->fc4f_nvme = FC4_TYPE_NVME;
4815+
}
48134816
memcpy(fcport->port_name, e->u.new_sess.port_name,
48144817
WWN_SIZE);
48154818
} else {

0 commit comments

Comments
 (0)