aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@voltaire.com>2010-02-08 08:22:34 -0500
committerRoland Dreier <rolandd@cisco.com>2010-02-24 12:41:14 -0500
commit962b4b528ba87c8d837bb04794a1918c7de631cd (patch)
tree29b88d375f01c1628ca1f73612cb941ea52420ae /drivers/infiniband
parentaae3c995ff74a183d15207436d383942485b2edd (diff)
IB/iser: Use libiscsi passthrough mode
libiscsi passthrough mode invokes the transport xmit calls directly without first going through an internal queue, unlike the other mode, which uses a queue and a xmitworker thread. Now that the "cant_sleep" prerequisite of iscsi_host_alloc is met, move to use it. Handling xmit errors is now done by the passthrough flow of libiscsi. Since the queue/worker aren't used in this mode, the code that schedules the xmitworker is removed. Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c11
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c12
2 files changed, 3 insertions, 20 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 331147b71a91..71237f8f78f7 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -190,7 +190,7 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
190{ 190{
191 int error = 0; 191 int error = 0;
192 192
193 iser_dbg("task deq [cid %d itt 0x%x]\n", conn->id, task->itt); 193 iser_dbg("mtask xmit [cid %d itt 0x%x]\n", conn->id, task->itt);
194 194
195 error = iser_send_control(conn, task); 195 error = iser_send_control(conn, task);
196 196
@@ -200,9 +200,6 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
200 * - if yes, the task is recycled at iscsi_complete_pdu 200 * - if yes, the task is recycled at iscsi_complete_pdu
201 * - if no, the task is recycled at iser_snd_completion 201 * - if no, the task is recycled at iser_snd_completion
202 */ 202 */
203 if (error && error != -ENOBUFS)
204 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
205
206 return error; 203 return error;
207} 204}
208 205
@@ -254,7 +251,7 @@ iscsi_iser_task_xmit(struct iscsi_task *task)
254 task->imm_count, task->unsol_r2t.data_length); 251 task->imm_count, task->unsol_r2t.data_length);
255 } 252 }
256 253
257 iser_dbg("task deq [cid %d itt 0x%x]\n", 254 iser_dbg("ctask xmit [cid %d itt 0x%x]\n",
258 conn->id, task->itt); 255 conn->id, task->itt);
259 256
260 /* Send the cmd PDU */ 257 /* Send the cmd PDU */
@@ -270,8 +267,6 @@ iscsi_iser_task_xmit(struct iscsi_task *task)
270 error = iscsi_iser_task_xmit_unsol_data(conn, task); 267 error = iscsi_iser_task_xmit_unsol_data(conn, task);
271 268
272 iscsi_iser_task_xmit_exit: 269 iscsi_iser_task_xmit_exit:
273 if (error && error != -ENOBUFS)
274 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
275 return error; 270 return error;
276} 271}
277 272
@@ -423,7 +418,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
423 struct Scsi_Host *shost; 418 struct Scsi_Host *shost;
424 struct iser_conn *ib_conn; 419 struct iser_conn *ib_conn;
425 420
426 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 1); 421 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0);
427 if (!shost) 422 if (!shost)
428 return NULL; 423 return NULL;
429 shost->transportt = iscsi_iser_scsi_transport; 424 shost->transportt = iscsi_iser_scsi_transport;
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 27450eebd1e4..f447ace89cb1 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -514,10 +514,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc,
514void iser_snd_completion(struct iser_tx_desc *tx_desc, 514void iser_snd_completion(struct iser_tx_desc *tx_desc,
515 struct iser_conn *ib_conn) 515 struct iser_conn *ib_conn)
516{ 516{
517 struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn;
518 struct iscsi_conn *conn = iser_conn->iscsi_conn;
519 struct iscsi_task *task; 517 struct iscsi_task *task;
520 int resume_tx = 0;
521 struct iser_device *device = ib_conn->device; 518 struct iser_device *device = ib_conn->device;
522 519
523 if (tx_desc->type == ISCSI_TX_DATAOUT) { 520 if (tx_desc->type == ISCSI_TX_DATAOUT) {
@@ -526,17 +523,8 @@ void iser_snd_completion(struct iser_tx_desc *tx_desc,
526 kmem_cache_free(ig.desc_cache, tx_desc); 523 kmem_cache_free(ig.desc_cache, tx_desc);
527 } 524 }
528 525
529 if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
530 ISER_QP_MAX_REQ_DTOS)
531 resume_tx = 1;
532
533 atomic_dec(&ib_conn->post_send_buf_count); 526 atomic_dec(&ib_conn->post_send_buf_count);
534 527
535 if (resume_tx) {
536 iser_dbg("%ld resuming tx\n",jiffies);
537 iscsi_conn_queue_work(conn);
538 }
539
540 if (tx_desc->type == ISCSI_TX_CONTROL) { 528 if (tx_desc->type == ISCSI_TX_CONTROL) {
541 /* this arithmetic is legal by libiscsi dd_data allocation */ 529 /* this arithmetic is legal by libiscsi dd_data allocation */
542 task = (void *) ((long)(void *)tx_desc - 530 task = (void *) ((long)(void *)tx_desc -