summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_mgmt.c
diff options
context:
space:
mode:
authorJayamohan Kallickal2013-09-29 00:35:50 +0200
committerJames Bottomley2013-10-25 10:58:08 +0200
commit1e4be6ff41573139620080268a1aa6d1d8726358 (patch)
tree662348d04703c2fd1e83e76795f9d365bcc3e2f3 /drivers/scsi/be2iscsi/be_mgmt.c
parent[SCSI] be2iscsi: Fix CID allocation/freeing to support Dual chute mode (diff)
downloadkernel-qcow2-linux-1e4be6ff41573139620080268a1aa6d1d8726358.tar.gz
kernel-qcow2-linux-1e4be6ff41573139620080268a1aa6d1d8726358.tar.xz
kernel-qcow2-linux-1e4be6ff41573139620080268a1aa6d1d8726358.zip
[SCSI] be2iscsi: Fix connection offload to support Dual Chute.
The connection is offload to each chute in a round-robin manner if both the chute is loaded with iSCSI protocol Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_mgmt.c')
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index fcb9976e5ec6..bcddc9fb23a2 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -628,6 +628,16 @@ unsigned int mgmt_upload_connection(struct beiscsi_hba *phba,
return tag;
}
+/**
+ * mgmt_open_connection()- Establish a TCP CXN
+ * @dst_addr: Destination Address
+ * @beiscsi_ep: ptr to device endpoint struct
+ * @nonemb_cmd: ptr to memory allocated for command
+ *
+ * return
+ * Success: Tag number of the MBX Command issued
+ * Failure: Error code
+ **/
int mgmt_open_connection(struct beiscsi_hba *phba,
struct sockaddr *dst_addr,
struct beiscsi_endpoint *beiscsi_ep,
@@ -645,14 +655,17 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
struct phys_addr template_address = { 0, 0 };
struct phys_addr *ptemplate_address;
unsigned int tag = 0;
- unsigned int i;
+ unsigned int i, ulp_num;
unsigned short cid = beiscsi_ep->ep_cid;
struct be_sge *sge;
phwi_ctrlr = phba->phwi_ctrlr;
phwi_context = phwi_ctrlr->phwi_ctxt;
- def_hdr_id = (unsigned short)HWI_GET_DEF_HDRQ_ID(phba, 0);
- def_data_id = (unsigned short)HWI_GET_DEF_BUFQ_ID(phba, 0);
+
+ ulp_num = phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID(cid)].ulp_num;
+
+ def_hdr_id = (unsigned short)HWI_GET_DEF_HDRQ_ID(phba, ulp_num);
+ def_data_id = (unsigned short)HWI_GET_DEF_BUFQ_ID(phba, ulp_num);
ptemplate_address = &template_address;
ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address);