summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_mgmt.c
diff options
context:
space:
mode:
authorJayamohan Kallickal2013-09-29 00:35:49 +0200
committerJames Bottomley2013-10-25 10:58:07 +0200
commit0a3db7c0a3e566e872aa9b0ac2eaf1353be7ffcc (patch)
treea094e411c38e34925e0067d6ed79c26ea9f744bc /drivers/scsi/be2iscsi/be_mgmt.c
parent[SCSI] be2iscsi: Fix WRB_Q posting to support Dual Chute mode (diff)
downloadkernel-qcow2-linux-0a3db7c0a3e566e872aa9b0ac2eaf1353be7ffcc.tar.gz
kernel-qcow2-linux-0a3db7c0a3e566e872aa9b0ac2eaf1353be7ffcc.tar.xz
kernel-qcow2-linux-0a3db7c0a3e566e872aa9b0ac2eaf1353be7ffcc.zip
[SCSI] be2iscsi: Fix CID allocation/freeing to support Dual chute mode
Configuration parameters returns the number of connection that can be offloaded one each chute. 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.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 75756d722538..fcb9976e5ec6 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1338,9 +1338,21 @@ beiscsi_active_cid_disp(struct device *dev, struct device_attribute *attr,
{
struct Scsi_Host *shost = class_to_shost(dev);
struct beiscsi_hba *phba = iscsi_host_priv(shost);
+ uint16_t avlbl_cids = 0, ulp_num, len = 0, total_cids = 0;
+
+ for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) {
+ if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) {
+ avlbl_cids = BEISCSI_ULP_AVLBL_CID(phba, ulp_num);
+ total_cids = BEISCSI_GET_CID_COUNT(phba, ulp_num);
+ len += snprintf(buf+len, PAGE_SIZE - len,
+ "ULP%d : %d\n", ulp_num,
+ (total_cids - avlbl_cids));
+ } else
+ len += snprintf(buf+len, PAGE_SIZE - len,
+ "ULP%d : %d\n", ulp_num, 0);
+ }
- return snprintf(buf, PAGE_SIZE, "%d\n",
- (phba->params.cxns_per_ctrl - phba->avlbl_cids));
+ return len;
}
/**