Commit 650ce64c authored by Chad Dupuis's avatar Chad Dupuis Committed by Martin K. Petersen

scsi: qedf: Correct xid range overlap between offloaded requests and libfc requests

There is currently an overlap where exchange IDs between what is used for
offloaded commands and by libfc for ELS commands.  Correct this so that
exchange ID range is:

Offloaded requests: 0 to 0xfff
libfc requests: 0x1000 to 0xfffe
Signed-off-by: default avatarChad Dupuis <cdupuis@marvell.com>
Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f1c43590
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#define QEDF_DESCR "QLogic FCoE Offload Driver" #define QEDF_DESCR "QLogic FCoE Offload Driver"
#define QEDF_MODULE_NAME "qedf" #define QEDF_MODULE_NAME "qedf"
#define QEDF_MIN_XID 0
#define QEDF_MAX_SCSI_XID (NUM_TASKS_PER_CONNECTION - 1)
#define QEDF_MAX_ELS_XID 4095
#define QEDF_FLOGI_RETRY_CNT 3 #define QEDF_FLOGI_RETRY_CNT 3
#define QEDF_RPORT_RETRY_CNT 255 #define QEDF_RPORT_RETRY_CNT 255
#define QEDF_MAX_SESSIONS 1024 #define QEDF_MAX_SESSIONS 1024
...@@ -295,8 +292,6 @@ struct qedf_ctx { ...@@ -295,8 +292,6 @@ struct qedf_ctx {
#define QEDF_DCBX_PENDING 0 #define QEDF_DCBX_PENDING 0
#define QEDF_DCBX_DONE 1 #define QEDF_DCBX_DONE 1
atomic_t dcbx; atomic_t dcbx;
uint16_t max_scsi_xid;
uint16_t max_els_xid;
#define QEDF_NULL_VLAN_ID -1 #define QEDF_NULL_VLAN_ID -1
#define QEDF_FALLBACK_VLAN 1002 #define QEDF_FALLBACK_VLAN 1002
#define QEDF_DEFAULT_PRIO 3 #define QEDF_DEFAULT_PRIO 3
......
...@@ -103,7 +103,7 @@ void qedf_cmd_mgr_free(struct qedf_cmd_mgr *cmgr) ...@@ -103,7 +103,7 @@ void qedf_cmd_mgr_free(struct qedf_cmd_mgr *cmgr)
struct io_bdt *bdt_info; struct io_bdt *bdt_info;
struct qedf_ctx *qedf = cmgr->qedf; struct qedf_ctx *qedf = cmgr->qedf;
size_t bd_tbl_sz; size_t bd_tbl_sz;
u16 min_xid = QEDF_MIN_XID; u16 min_xid = 0;
u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1); u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1);
int num_ios; int num_ios;
int i; int i;
...@@ -169,7 +169,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) ...@@ -169,7 +169,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf)
u16 xid; u16 xid;
int i; int i;
int num_ios; int num_ios;
u16 min_xid = QEDF_MIN_XID; u16 min_xid = 0;
u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1); u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1);
/* Make sure num_queues is already set before calling this function */ /* Make sure num_queues is already set before calling this function */
...@@ -201,7 +201,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) ...@@ -201,7 +201,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf)
/* /*
* Initialize I/O request fields. * Initialize I/O request fields.
*/ */
xid = QEDF_MIN_XID; xid = 0;
for (i = 0; i < num_ios; i++) { for (i = 0; i < num_ios; i++) {
io_req = &cmgr->cmds[i]; io_req = &cmgr->cmds[i];
......
...@@ -1501,8 +1501,8 @@ static int qedf_lport_setup(struct qedf_ctx *qedf) ...@@ -1501,8 +1501,8 @@ static int qedf_lport_setup(struct qedf_ctx *qedf)
fcoe_libfc_config(lport, &qedf->ctlr, &qedf_lport_template, 0); fcoe_libfc_config(lport, &qedf->ctlr, &qedf_lport_template, 0);
/* Allocate the exchange manager */ /* Allocate the exchange manager */
fc_exch_mgr_alloc(lport, FC_CLASS_3, qedf->max_scsi_xid + 1, fc_exch_mgr_alloc(lport, FC_CLASS_3, FCOE_PARAMS_NUM_TASKS,
qedf->max_els_xid, NULL); 0xfffe, NULL);
if (fc_lport_init_stats(lport)) if (fc_lport_init_stats(lport))
return -ENOMEM; return -ENOMEM;
...@@ -1625,7 +1625,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled) ...@@ -1625,7 +1625,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
vport_qedf->wwpn = vn_port->wwpn; vport_qedf->wwpn = vn_port->wwpn;
vn_port->host->transportt = qedf_fc_vport_transport_template; vn_port->host->transportt = qedf_fc_vport_transport_template;
vn_port->host->can_queue = QEDF_MAX_ELS_XID; vn_port->host->can_queue = FCOE_PARAMS_NUM_TASKS;
vn_port->host->max_lun = qedf_max_lun; vn_port->host->max_lun = qedf_max_lun;
vn_port->host->sg_tablesize = QEDF_MAX_BDS_PER_CMD; vn_port->host->sg_tablesize = QEDF_MAX_BDS_PER_CMD;
vn_port->host->max_cmd_len = QEDF_MAX_CDB_LEN; vn_port->host->max_cmd_len = QEDF_MAX_CDB_LEN;
...@@ -3181,11 +3181,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) ...@@ -3181,11 +3181,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
sprintf(host_buf, "host_%d", host->host_no); sprintf(host_buf, "host_%d", host->host_no);
qed_ops->common->set_name(qedf->cdev, host_buf); qed_ops->common->set_name(qedf->cdev, host_buf);
/* Set xid max values */
qedf->max_scsi_xid = QEDF_MAX_SCSI_XID;
qedf->max_els_xid = QEDF_MAX_ELS_XID;
/* Allocate cmd mgr */ /* Allocate cmd mgr */
qedf->cmd_mgr = qedf_cmd_mgr_alloc(qedf); qedf->cmd_mgr = qedf_cmd_mgr_alloc(qedf);
if (!qedf->cmd_mgr) { if (!qedf->cmd_mgr) {
...@@ -3196,9 +3191,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) ...@@ -3196,9 +3191,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
if (mode != QEDF_MODE_RECOVERY) { if (mode != QEDF_MODE_RECOVERY) {
host->transportt = qedf_fc_transport_template; host->transportt = qedf_fc_transport_template;
host->can_queue = QEDF_MAX_ELS_XID;
host->max_lun = qedf_max_lun; host->max_lun = qedf_max_lun;
host->max_cmd_len = QEDF_MAX_CDB_LEN; host->max_cmd_len = QEDF_MAX_CDB_LEN;
host->can_queue = FCOE_PARAMS_NUM_TASKS;
rc = scsi_add_host(host, &pdev->dev); rc = scsi_add_host(host, &pdev->dev);
if (rc) if (rc)
goto err6; goto err6;
......
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