aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2007-05-30 13:57:19 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-06-02 15:34:46 -0400
commit1548271ece9e9312fd5feb41fd58773b56a71d39 (patch)
tree89f990788a619a52c3ba4ecbf5f2a596c5711d04 /drivers/infiniband
parent77a23c21aaa723f6b0ffc4a701be8c8e5a32346d (diff)
[SCSI] libiscsi: make can_queue configurable
This patch allows us to set can_queue and cmds_per_lun from userspace when we create the session/host. From there we can set it on a per target basis. The patch fully converts iscsi_tcp, but only hooks up ib_iser for cmd_per_lun since it currently has a lots of preallocations based on can_queue. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Cc: Roland Dreier <rdreier@cisco.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c11
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h4
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c4
3 files changed, 13 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 9782190a9ee5..bed583c426e6 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -373,7 +373,8 @@ static struct iscsi_transport iscsi_iser_transport;
373static struct iscsi_cls_session * 373static struct iscsi_cls_session *
374iscsi_iser_session_create(struct iscsi_transport *iscsit, 374iscsi_iser_session_create(struct iscsi_transport *iscsit,
375 struct scsi_transport_template *scsit, 375 struct scsi_transport_template *scsit,
376 uint32_t initial_cmdsn, uint32_t *hostno) 376 uint16_t cmds_max, uint16_t qdepth,
377 uint32_t initial_cmdsn, uint32_t *hostno)
377{ 378{
378 struct iscsi_cls_session *cls_session; 379 struct iscsi_cls_session *cls_session;
379 struct iscsi_session *session; 380 struct iscsi_session *session;
@@ -384,7 +385,13 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit,
384 struct iscsi_iser_cmd_task *iser_ctask; 385 struct iscsi_iser_cmd_task *iser_ctask;
385 struct iser_desc *desc; 386 struct iser_desc *desc;
386 387
388 /*
389 * we do not support setting can_queue cmd_per_lun from userspace yet
390 * because we preallocate so many resources
391 */
387 cls_session = iscsi_session_setup(iscsit, scsit, 392 cls_session = iscsi_session_setup(iscsit, scsit,
393 ISCSI_DEF_XMIT_CMDS_MAX,
394 ISCSI_MAX_CMD_PER_LUN,
388 sizeof(struct iscsi_iser_cmd_task), 395 sizeof(struct iscsi_iser_cmd_task),
389 sizeof(struct iser_desc), 396 sizeof(struct iser_desc),
390 initial_cmdsn, &hn); 397 initial_cmdsn, &hn);
@@ -543,7 +550,7 @@ iscsi_iser_ep_disconnect(__u64 ep_handle)
543static struct scsi_host_template iscsi_iser_sht = { 550static struct scsi_host_template iscsi_iser_sht = {
544 .name = "iSCSI Initiator over iSER, v." DRV_VER, 551 .name = "iSCSI Initiator over iSER, v." DRV_VER,
545 .queuecommand = iscsi_queuecommand, 552 .queuecommand = iscsi_queuecommand,
546 .can_queue = ISCSI_XMIT_CMDS_MAX - 1, 553 .can_queue = ISCSI_DEF_XMIT_CMDS_MAX - 1,
547 .sg_tablesize = ISCSI_ISER_SG_TABLESIZE, 554 .sg_tablesize = ISCSI_ISER_SG_TABLESIZE,
548 .max_sectors = 1024, 555 .max_sectors = 1024,
549 .cmd_per_lun = ISCSI_MAX_CMD_PER_LUN, 556 .cmd_per_lun = ISCSI_MAX_CMD_PER_LUN,
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 8960196ffb0f..e2353701e8bb 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -98,7 +98,7 @@
98#define ISER_MAX_TX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), * 98#define ISER_MAX_TX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), *
99 * SCSI_TMFUNC(2), LOGOUT(1) */ 99 * SCSI_TMFUNC(2), LOGOUT(1) */
100 100
101#define ISER_QP_MAX_RECV_DTOS (ISCSI_XMIT_CMDS_MAX + \ 101#define ISER_QP_MAX_RECV_DTOS (ISCSI_DEF_XMIT_CMDS_MAX + \
102 ISER_MAX_RX_MISC_PDUS + \ 102 ISER_MAX_RX_MISC_PDUS + \
103 ISER_MAX_TX_MISC_PDUS) 103 ISER_MAX_TX_MISC_PDUS)
104 104
@@ -110,7 +110,7 @@
110 110
111#define ISER_INFLIGHT_DATAOUTS 8 111#define ISER_INFLIGHT_DATAOUTS 8
112 112
113#define ISER_QP_MAX_REQ_DTOS (ISCSI_XMIT_CMDS_MAX * \ 113#define ISER_QP_MAX_REQ_DTOS (ISCSI_DEF_XMIT_CMDS_MAX * \
114 (1 + ISER_INFLIGHT_DATAOUTS) + \ 114 (1 + ISER_INFLIGHT_DATAOUTS) + \
115 ISER_MAX_TX_MISC_PDUS + \ 115 ISER_MAX_TX_MISC_PDUS + \
116 ISER_MAX_RX_MISC_PDUS) 116 ISER_MAX_RX_MISC_PDUS)
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 3702e2375553..2044de1164ac 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -155,8 +155,8 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn)
155 params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE + 1; 155 params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE + 1;
156 /* make the pool size twice the max number of SCSI commands * 156 /* make the pool size twice the max number of SCSI commands *
157 * the ML is expected to queue, watermark for unmap at 50% */ 157 * the ML is expected to queue, watermark for unmap at 50% */
158 params.pool_size = ISCSI_XMIT_CMDS_MAX * 2; 158 params.pool_size = ISCSI_DEF_XMIT_CMDS_MAX * 2;
159 params.dirty_watermark = ISCSI_XMIT_CMDS_MAX; 159 params.dirty_watermark = ISCSI_DEF_XMIT_CMDS_MAX;
160 params.cache = 0; 160 params.cache = 0;
161 params.flush_function = NULL; 161 params.flush_function = NULL;
162 params.access = (IB_ACCESS_LOCAL_WRITE | 162 params.access = (IB_ACCESS_LOCAL_WRITE |