Commit 7da50879 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: Use start cid and number of cid and icd from FW

This patch enablesi be2iscsi to use the start number and number
 of cids/icd provided by FW rather than hard coded values.
Signed-off-by: default avatarJayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 1fe6dbf4
...@@ -431,9 +431,10 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, ...@@ -431,9 +431,10 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
} }
SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d ", SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d ",
beiscsi_ep->ep_cid); beiscsi_ep->ep_cid);
phba->ep_array[beiscsi_ep->ep_cid] = ep; phba->ep_array[beiscsi_ep->ep_cid -
if (beiscsi_ep->ep_cid > phba->fw_config.iscsi_cid_start] = ep;
(phba->fw_config.iscsi_cid_start + phba->params.cxns_per_ctrl)) { if (beiscsi_ep->ep_cid > (phba->fw_config.iscsi_cid_start +
phba->params.cxns_per_ctrl * 2)) {
SE_DEBUG(DBG_LVL_1, "Failed in allocate iscsi cid\n"); SE_DEBUG(DBG_LVL_1, "Failed in allocate iscsi cid\n");
return ret; return ret;
} }
......
This diff is collapsed.
...@@ -46,23 +46,18 @@ ...@@ -46,23 +46,18 @@
#define OC_DEVICE_ID3 0x712 #define OC_DEVICE_ID3 0x712
#define OC_DEVICE_ID4 0x222 #define OC_DEVICE_ID4 0x222
#define BE2_MAX_SESSIONS 64 #define BE2_IO_DEPTH 1024
#define BE2_MAX_SESSIONS 256
#define BE2_CMDS_PER_CXN 128 #define BE2_CMDS_PER_CXN 128
#define BE2_LOGOUTS BE2_MAX_SESSIONS
#define BE2_TMFS 16 #define BE2_TMFS 16
#define BE2_NOPOUT_REQ 16 #define BE2_NOPOUT_REQ 16
#define BE2_ASYNCPDUS BE2_MAX_SESSIONS
#define BE2_MAX_ICDS 2048
#define BE2_SGE 32 #define BE2_SGE 32
#define BE2_DEFPDU_HDR_SZ 64 #define BE2_DEFPDU_HDR_SZ 64
#define BE2_DEFPDU_DATA_SZ 8192 #define BE2_DEFPDU_DATA_SZ 8192
#define BE2_IO_DEPTH \
(BE2_MAX_ICDS / 2 - (BE2_LOGOUTS + BE2_TMFS + BE2_NOPOUT_REQ))
#define MAX_CPUS 31 #define MAX_CPUS 31
#define BEISCSI_SGLIST_ELEMENTS BE2_SGE #define BEISCSI_SGLIST_ELEMENTS BE2_SGE
#define BEISCSI_MAX_CMNDS 1024 /* Max IO's per Ctrlr sht->can_queue */
#define BEISCSI_CMD_PER_LUN 128 /* scsi_host->cmd_per_lun */ #define BEISCSI_CMD_PER_LUN 128 /* scsi_host->cmd_per_lun */
#define BEISCSI_MAX_SECTORS 2048 /* scsi_host->max_sectors */ #define BEISCSI_MAX_SECTORS 2048 /* scsi_host->max_sectors */
...@@ -802,7 +797,6 @@ struct hwi_controller { ...@@ -802,7 +797,6 @@ struct hwi_controller {
struct be_ring default_pdu_hdr; struct be_ring default_pdu_hdr;
struct be_ring default_pdu_data; struct be_ring default_pdu_data;
struct hwi_context_memory *phwi_ctxt; struct hwi_context_memory *phwi_ctxt;
unsigned short cq_errors[CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN];
}; };
enum hwh_type_enum { enum hwh_type_enum {
......
...@@ -48,6 +48,14 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, ...@@ -48,6 +48,14 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl,
pfw_cfg->ulp[0].sq_base; pfw_cfg->ulp[0].sq_base;
phba->fw_config.iscsi_cid_count = phba->fw_config.iscsi_cid_count =
pfw_cfg->ulp[0].sq_count; pfw_cfg->ulp[0].sq_count;
if (phba->fw_config.iscsi_cid_count > (BE2_MAX_SESSIONS / 2)) {
status = 1;
shost_printk(KERN_WARNING, phba->shost,
"FW reported MAX CXNS as %d \t"
"Max Supported = %d. Failing to load \n",
phba->fw_config.iscsi_cid_count,
BE2_MAX_SESSIONS);
}
} else { } else {
shost_printk(KERN_WARNING, phba->shost, shost_printk(KERN_WARNING, phba->shost,
"Failed in mgmt_get_fw_config \n"); "Failed in mgmt_get_fw_config \n");
...@@ -317,7 +325,8 @@ int mgmt_open_connection(struct beiscsi_hba *phba, ...@@ -317,7 +325,8 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
struct tcp_connect_and_offload_out *ptcpcnct_out = struct tcp_connect_and_offload_out *ptcpcnct_out =
embedded_payload(wrb); embedded_payload(wrb);
ep = phba->ep_array[ptcpcnct_out->cid]; ep = phba->ep_array[ptcpcnct_out->cid -
phba->fw_config.iscsi_cid_start];
beiscsi_ep = ep->dd_data; beiscsi_ep = ep->dd_data;
beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
beiscsi_ep->cid_vld = 1; beiscsi_ep->cid_vld = 1;
......
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