diff options
author | Or Gerlitz <ogerlitz@voltaire.com> | 2010-02-08 08:23:11 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-02-24 12:41:14 -0500 |
commit | 88ec415772144f4fc4a50b123bb6200de686898d (patch) | |
tree | 8cd6d06b8cc4a1e1420b4d013f260188fc854f8a /drivers/infiniband | |
parent | 962b4b528ba87c8d837bb04794a1918c7de631cd (diff) |
IB/iser: Remove redundant locking from iser scsi command response flow
Currently the iSER receive completion flow takes the session lock
twice. Optimize it to avoid the first one by letting
iser_task_rdma_finalize() be called only from the cleanup_task
callback invoked by iscsi_free_task, thus reducing the contention on
the session lock between the scsi command submission to the scsi
command completion flows.
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/iser_initiator.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index f447ace89cb1..0b9ef0716588 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -440,10 +440,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc, | |||
440 | struct iser_conn *ib_conn) | 440 | struct iser_conn *ib_conn) |
441 | { | 441 | { |
442 | struct iscsi_iser_conn *conn = ib_conn->iser_conn; | 442 | struct iscsi_iser_conn *conn = ib_conn->iser_conn; |
443 | struct iscsi_task *task; | ||
444 | struct iscsi_iser_task *iser_task; | ||
445 | struct iscsi_hdr *hdr; | 443 | struct iscsi_hdr *hdr; |
446 | unsigned char opcode; | ||
447 | u64 rx_dma; | 444 | u64 rx_dma; |
448 | int rx_buflen, outstanding, count, err; | 445 | int rx_buflen, outstanding, count, err; |
449 | 446 | ||
@@ -464,28 +461,6 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc, | |||
464 | iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode, | 461 | iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode, |
465 | hdr->itt, (int)(rx_xfer_len - ISER_HEADERS_LEN)); | 462 | hdr->itt, (int)(rx_xfer_len - ISER_HEADERS_LEN)); |
466 | 463 | ||
467 | opcode = hdr->opcode & ISCSI_OPCODE_MASK; | ||
468 | |||
469 | if (opcode == ISCSI_OP_SCSI_CMD_RSP) { | ||
470 | spin_lock(&conn->iscsi_conn->session->lock); | ||
471 | task = iscsi_itt_to_ctask(conn->iscsi_conn, hdr->itt); | ||
472 | if (task) | ||
473 | __iscsi_get_task(task); | ||
474 | spin_unlock(&conn->iscsi_conn->session->lock); | ||
475 | |||
476 | if (!task) | ||
477 | iser_err("itt can't be matched to task!!! " | ||
478 | "conn %p opcode %d itt %d\n", | ||
479 | conn->iscsi_conn, opcode, hdr->itt); | ||
480 | else { | ||
481 | iser_task = task->dd_data; | ||
482 | iser_dbg("itt %d task %p\n",hdr->itt, task); | ||
483 | iser_task->status = ISER_TASK_STATUS_COMPLETED; | ||
484 | iser_task_rdma_finalize(iser_task); | ||
485 | iscsi_put_task(task); | ||
486 | } | ||
487 | } | ||
488 | |||
489 | iscsi_iser_recv(conn->iscsi_conn, hdr, | 464 | iscsi_iser_recv(conn->iscsi_conn, hdr, |
490 | rx_desc->data, rx_xfer_len - ISER_HEADERS_LEN); | 465 | rx_desc->data, rx_xfer_len - ISER_HEADERS_LEN); |
491 | 466 | ||