Commit 33b28357 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Fix Async GPN_FT for FCP and FC-NVMe scan

This patch combines FCP and FC-NVMe scan into single scan when
driver detects FC-NVMe capability on same port.
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 60dd6e8e
...@@ -2217,6 +2217,7 @@ typedef struct { ...@@ -2217,6 +2217,7 @@ typedef struct {
/* FCP-4 types */ /* FCP-4 types */
#define FC4_TYPE_FCP_SCSI 0x08 #define FC4_TYPE_FCP_SCSI 0x08
#define FC4_TYPE_NVME 0x28
#define FC4_TYPE_OTHER 0x0 #define FC4_TYPE_OTHER 0x0
#define FC4_TYPE_UNKNOWN 0xff #define FC4_TYPE_UNKNOWN 0xff
...@@ -2982,8 +2983,14 @@ enum scan_flags_t { ...@@ -2982,8 +2983,14 @@ enum scan_flags_t {
SF_QUEUED = BIT_1, SF_QUEUED = BIT_1,
}; };
enum fc4type_t {
FS_FC4TYPE_FCP = BIT_0,
FS_FC4TYPE_NVME = BIT_1,
};
struct fab_scan_rp { struct fab_scan_rp {
port_id_t id; port_id_t id;
enum fc4type_t fc4type;
u8 port_name[8]; u8 port_name[8];
u8 node_name[8]; u8 node_name[8];
}; };
...@@ -3275,6 +3282,7 @@ struct qla_work_evt { ...@@ -3275,6 +3282,7 @@ struct qla_work_evt {
} nack; } nack;
struct { struct {
u8 fc4_type; u8 fc4_type;
srb_t *sp;
} gpnft; } gpnft;
} u; } u;
}; };
......
...@@ -658,7 +658,7 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *, struct event_arg *); ...@@ -658,7 +658,7 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *, struct event_arg *);
int qla2x00_mgmt_svr_login(scsi_qla_host_t *); int qla2x00_mgmt_svr_login(scsi_qla_host_t *);
void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea); void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea);
int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport); int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport);
int qla24xx_async_gpnft(scsi_qla_host_t *, u8); int qla24xx_async_gpnft(scsi_qla_host_t *, u8, srb_t *);
void qla24xx_async_gpnft_done(scsi_qla_host_t *, srb_t *); void qla24xx_async_gpnft_done(scsi_qla_host_t *, srb_t *);
void qla24xx_async_gnnft_done(scsi_qla_host_t *, srb_t *); void qla24xx_async_gnnft_done(scsi_qla_host_t *, srb_t *);
int qla24xx_async_gnnid(scsi_qla_host_t *, fc_port_t *); int qla24xx_async_gnnid(scsi_qla_host_t *, fc_port_t *);
......
This diff is collapsed.
...@@ -5036,9 +5036,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) ...@@ -5036,9 +5036,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
fcport->port_name, rval, fcport->fp_speed, mb[0], mb[1]); fcport->port_name, rval, fcport->fp_speed, mb[0], mb[1]);
} else { } else {
ql_dbg(ql_dbg_disc, vha, 0x2005, ql_dbg(ql_dbg_disc, vha, 0x2005,
"iIDMA adjusted to %s GB/s on %8phN.\n", "iIDMA adjusted to %s GB/s (%X) on %8phN.\n",
qla2x00_get_link_speed_str(ha, fcport->fp_speed), qla2x00_get_link_speed_str(ha, fcport->fp_speed),
fcport->port_name); fcport->fp_speed, fcport->port_name);
} }
} }
...@@ -5264,8 +5264,8 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha) ...@@ -5264,8 +5264,8 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
qlt_do_generation_tick(vha, &discovery_gen); qlt_do_generation_tick(vha, &discovery_gen);
if (USE_ASYNC_SCAN(ha)) { if (USE_ASYNC_SCAN(ha)) {
rval = QLA_SUCCESS; rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI,
rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI); NULL);
if (rval) if (rval)
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
} else { } else {
......
...@@ -4803,9 +4803,14 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) ...@@ -4803,9 +4803,14 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)
fcport->d_id = e->u.new_sess.id; fcport->d_id = e->u.new_sess.id;
fcport->flags |= FCF_FABRIC_DEVICE; fcport->flags |= FCF_FABRIC_DEVICE;
fcport->fw_login_state = DSC_LS_PLOGI_PEND; 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 & FS_FC4TYPE_FCP)
fcport->fc4_type = FC4_TYPE_FCP_SCSI; fcport->fc4_type = FC4_TYPE_FCP_SCSI;
if (e->u.new_sess.fc4_type & FS_FC4TYPE_NVME) {
fcport->fc4_type = FC4_TYPE_OTHER;
fcport->fc4f_nvme = FC4_TYPE_NVME;
}
memcpy(fcport->port_name, e->u.new_sess.port_name, memcpy(fcport->port_name, e->u.new_sess.port_name,
WWN_SIZE); WWN_SIZE);
} else { } else {
...@@ -5021,7 +5026,8 @@ qla2x00_do_work(struct scsi_qla_host *vha) ...@@ -5021,7 +5026,8 @@ qla2x00_do_work(struct scsi_qla_host *vha)
e->u.logio.data); e->u.logio.data);
break; break;
case QLA_EVT_GPNFT: case QLA_EVT_GPNFT:
qla24xx_async_gpnft(vha, e->u.gpnft.fc4_type); qla24xx_async_gpnft(vha, e->u.gpnft.fc4_type,
e->u.gpnft.sp);
break; break;
case QLA_EVT_GPNFT_DONE: case QLA_EVT_GPNFT_DONE:
qla24xx_async_gpnft_done(vha, e->u.iosb.sp); qla24xx_async_gpnft_done(vha, e->u.iosb.sp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment