diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-09-28 18:35:50 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 04:58:08 -0400 |
commit | 1e4be6ff41573139620080268a1aa6d1d8726358 (patch) | |
tree | 662348d04703c2fd1e83e76795f9d365bcc3e2f3 /drivers/scsi/be2iscsi | |
parent | 0a3db7c0a3e566e872aa9b0ac2eaf1353be7ffcc (diff) |
[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')
-rw-r--r-- | drivers/scsi/be2iscsi/be_iscsi.c | 6 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 13 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 1 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 19 |
4 files changed, 31 insertions, 8 deletions
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index 63b2be0f58a8..a7cd92c3c383 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c | |||
@@ -194,6 +194,8 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session, | |||
194 | struct beiscsi_conn *beiscsi_conn = conn->dd_data; | 194 | struct beiscsi_conn *beiscsi_conn = conn->dd_data; |
195 | struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); | 195 | struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); |
196 | struct beiscsi_hba *phba = iscsi_host_priv(shost); | 196 | struct beiscsi_hba *phba = iscsi_host_priv(shost); |
197 | struct hwi_controller *phwi_ctrlr = phba->phwi_ctrlr; | ||
198 | struct hwi_wrb_context *pwrb_context; | ||
197 | struct beiscsi_endpoint *beiscsi_ep; | 199 | struct beiscsi_endpoint *beiscsi_ep; |
198 | struct iscsi_endpoint *ep; | 200 | struct iscsi_endpoint *ep; |
199 | 201 | ||
@@ -214,9 +216,13 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session, | |||
214 | return -EEXIST; | 216 | return -EEXIST; |
215 | } | 217 | } |
216 | 218 | ||
219 | pwrb_context = &phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID( | ||
220 | beiscsi_ep->ep_cid)]; | ||
221 | |||
217 | beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid; | 222 | beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid; |
218 | beiscsi_conn->ep = beiscsi_ep; | 223 | beiscsi_conn->ep = beiscsi_ep; |
219 | beiscsi_ep->conn = beiscsi_conn; | 224 | beiscsi_ep->conn = beiscsi_conn; |
225 | beiscsi_conn->doorbell_offset = pwrb_context->doorbell_offset; | ||
220 | 226 | ||
221 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, | 227 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, |
222 | "BS_%d : beiscsi_conn=%p conn=%p ep_cid=%d\n", | 228 | "BS_%d : beiscsi_conn=%p conn=%p ep_cid=%d\n", |
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index b57e5bd62018..d539b17e4a80 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -4585,8 +4585,8 @@ beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, | |||
4585 | doorbell |= (pwrb_handle->wrb_index & DB_DEF_PDU_WRB_INDEX_MASK) | 4585 | doorbell |= (pwrb_handle->wrb_index & DB_DEF_PDU_WRB_INDEX_MASK) |
4586 | << DB_DEF_PDU_WRB_INDEX_SHIFT; | 4586 | << DB_DEF_PDU_WRB_INDEX_SHIFT; |
4587 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; | 4587 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; |
4588 | 4588 | iowrite32(doorbell, phba->db_va + | |
4589 | iowrite32(doorbell, phba->db_va + DB_TXULP0_OFFSET); | 4589 | beiscsi_conn->doorbell_offset); |
4590 | } | 4590 | } |
4591 | 4591 | ||
4592 | static void beiscsi_parse_pdu(struct iscsi_conn *conn, itt_t itt, | 4592 | static void beiscsi_parse_pdu(struct iscsi_conn *conn, itt_t itt, |
@@ -4811,7 +4811,8 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg, | |||
4811 | DB_DEF_PDU_WRB_INDEX_MASK) << | 4811 | DB_DEF_PDU_WRB_INDEX_MASK) << |
4812 | DB_DEF_PDU_WRB_INDEX_SHIFT; | 4812 | DB_DEF_PDU_WRB_INDEX_SHIFT; |
4813 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; | 4813 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; |
4814 | iowrite32(doorbell, phba->db_va + DB_TXULP0_OFFSET); | 4814 | iowrite32(doorbell, phba->db_va + |
4815 | beiscsi_conn->doorbell_offset); | ||
4815 | return 0; | 4816 | return 0; |
4816 | } | 4817 | } |
4817 | 4818 | ||
@@ -4866,7 +4867,8 @@ static int beiscsi_iotask(struct iscsi_task *task, struct scatterlist *sg, | |||
4866 | DB_DEF_PDU_WRB_INDEX_MASK) << DB_DEF_PDU_WRB_INDEX_SHIFT; | 4867 | DB_DEF_PDU_WRB_INDEX_MASK) << DB_DEF_PDU_WRB_INDEX_SHIFT; |
4867 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; | 4868 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; |
4868 | 4869 | ||
4869 | iowrite32(doorbell, phba->db_va + DB_TXULP0_OFFSET); | 4870 | iowrite32(doorbell, phba->db_va + |
4871 | beiscsi_conn->doorbell_offset); | ||
4870 | return 0; | 4872 | return 0; |
4871 | } | 4873 | } |
4872 | 4874 | ||
@@ -4968,7 +4970,8 @@ static int beiscsi_mtask(struct iscsi_task *task) | |||
4968 | doorbell |= (io_task->pwrb_handle->wrb_index & | 4970 | doorbell |= (io_task->pwrb_handle->wrb_index & |
4969 | DB_DEF_PDU_WRB_INDEX_MASK) << DB_DEF_PDU_WRB_INDEX_SHIFT; | 4971 | DB_DEF_PDU_WRB_INDEX_MASK) << DB_DEF_PDU_WRB_INDEX_SHIFT; |
4970 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; | 4972 | doorbell |= 1 << DB_DEF_PDU_NUM_POSTED_SHIFT; |
4971 | iowrite32(doorbell, phba->db_va + DB_TXULP0_OFFSET); | 4973 | iowrite32(doorbell, phba->db_va + |
4974 | beiscsi_conn->doorbell_offset); | ||
4972 | return 0; | 4975 | return 0; |
4973 | } | 4976 | } |
4974 | 4977 | ||
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index e5e0d7e32f04..3fa1e819f42d 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -425,6 +425,7 @@ struct beiscsi_conn { | |||
425 | struct iscsi_conn *conn; | 425 | struct iscsi_conn *conn; |
426 | struct beiscsi_hba *phba; | 426 | struct beiscsi_hba *phba; |
427 | u32 exp_statsn; | 427 | u32 exp_statsn; |
428 | u32 doorbell_offset; | ||
428 | u32 beiscsi_conn_cid; | 429 | u32 beiscsi_conn_cid; |
429 | struct beiscsi_endpoint *ep; | 430 | struct beiscsi_endpoint *ep; |
430 | unsigned short login_in_progress; | 431 | unsigned short login_in_progress; |
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, | |||
628 | return tag; | 628 | return tag; |
629 | } | 629 | } |
630 | 630 | ||
631 | /** | ||
632 | * mgmt_open_connection()- Establish a TCP CXN | ||
633 | * @dst_addr: Destination Address | ||
634 | * @beiscsi_ep: ptr to device endpoint struct | ||
635 | * @nonemb_cmd: ptr to memory allocated for command | ||
636 | * | ||
637 | * return | ||
638 | * Success: Tag number of the MBX Command issued | ||
639 | * Failure: Error code | ||
640 | **/ | ||
631 | int mgmt_open_connection(struct beiscsi_hba *phba, | 641 | int mgmt_open_connection(struct beiscsi_hba *phba, |
632 | struct sockaddr *dst_addr, | 642 | struct sockaddr *dst_addr, |
633 | struct beiscsi_endpoint *beiscsi_ep, | 643 | struct beiscsi_endpoint *beiscsi_ep, |
@@ -645,14 +655,17 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
645 | struct phys_addr template_address = { 0, 0 }; | 655 | struct phys_addr template_address = { 0, 0 }; |
646 | struct phys_addr *ptemplate_address; | 656 | struct phys_addr *ptemplate_address; |
647 | unsigned int tag = 0; | 657 | unsigned int tag = 0; |
648 | unsigned int i; | 658 | unsigned int i, ulp_num; |
649 | unsigned short cid = beiscsi_ep->ep_cid; | 659 | unsigned short cid = beiscsi_ep->ep_cid; |
650 | struct be_sge *sge; | 660 | struct be_sge *sge; |
651 | 661 | ||
652 | phwi_ctrlr = phba->phwi_ctrlr; | 662 | phwi_ctrlr = phba->phwi_ctrlr; |
653 | phwi_context = phwi_ctrlr->phwi_ctxt; | 663 | phwi_context = phwi_ctrlr->phwi_ctxt; |
654 | def_hdr_id = (unsigned short)HWI_GET_DEF_HDRQ_ID(phba, 0); | 664 | |
655 | def_data_id = (unsigned short)HWI_GET_DEF_BUFQ_ID(phba, 0); | 665 | ulp_num = phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID(cid)].ulp_num; |
666 | |||
667 | def_hdr_id = (unsigned short)HWI_GET_DEF_HDRQ_ID(phba, ulp_num); | ||
668 | def_data_id = (unsigned short)HWI_GET_DEF_BUFQ_ID(phba, ulp_num); | ||
656 | 669 | ||
657 | ptemplate_address = &template_address; | 670 | ptemplate_address = &template_address; |
658 | ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address); | 671 | ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address); |