Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b5b9647 authored by Darren Trapp's avatar Darren Trapp Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Fix FC-NVMe LUN discovery



commit a4239945 ("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: a4239945 ("scsi: qla2xxx: Add switch command to simplify fabric discovery")
Signed-off-by: default avatarDarren Trapp <darren.trapp@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e39a9735
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2217,6 +2217,7 @@ typedef struct {

/* FCP-4 types */
#define FC4_TYPE_FCP_SCSI	0x08
#define FC4_TYPE_NVME		0x28
#define FC4_TYPE_OTHER		0x0
#define FC4_TYPE_UNKNOWN	0xff

+3 −0
Original line number Diff line number Diff line
@@ -3973,6 +3973,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
	spin_lock_irqsave(&vha->work_lock, flags);
	vha->scan.scan_flags &= ~SF_SCANNING;
	spin_unlock_irqrestore(&vha->work_lock, flags);

	if ((fc4type == FC4_TYPE_FCP_SCSI) && vha->flags.nvme_enabled)
		qla24xx_async_gpnft(vha, FC4_TYPE_NVME);
}

static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res)
+7 −1
Original line number Diff line number Diff line
@@ -1061,6 +1061,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
	fc_port_t *fcport = ea->fcport;
	struct port_database_24xx *pd;
	struct srb *sp = ea->sp;
	uint8_t	ls;

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

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

	switch (pd->current_login_state) {
	if (fcport->fc4f_nvme)
		ls = pd->current_login_state >> 4;
	else
		ls = pd->current_login_state & 0xf;

	switch (ls) {
	case PDS_PRLI_COMPLETE:
		__qla24xx_parse_gpdb(vha, fcport, pd);
		break;
+5 −2
Original line number Diff line number Diff line
@@ -4807,9 +4807,12 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)
			fcport->d_id = e->u.new_sess.id;
			fcport->flags |= FCF_FABRIC_DEVICE;
			fcport->fw_login_state = DSC_LS_PLOGI_PEND;
			if (e->u.new_sess.fc4_type == FC4_TYPE_FCP_SCSI)
			if (e->u.new_sess.fc4_type == FC4_TYPE_FCP_SCSI) {
				fcport->fc4_type = FC4_TYPE_FCP_SCSI;

			} else if (e->u.new_sess.fc4_type == FC4_TYPE_NVME) {
				fcport->fc4_type = FC4_TYPE_OTHER;
				fcport->fc4f_nvme = FC4_TYPE_NVME;
			}
			memcpy(fcport->port_name, e->u.new_sess.port_name,
			    WWN_SIZE);
		} else {