aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorErez Zilber <erezz@voltaire.com>2007-03-25 06:07:10 -0400
committerRoland Dreier <rolandd@cisco.com>2007-03-26 19:35:09 -0400
commit3104a2175dc04b7a597acea90f19b033abcfc7d8 (patch)
treeeb98df79a13ae9f1fba08f349fa459f514a1b2dc /drivers
parent0264d8853137a9a328d9f0ed29e083dd505512cb (diff)
IB/iser: Handle aborting a command after it is sent
The SCSI midlayer may abort a command that was already sent. If the initiator is still trying to send the command (or data-out PDUs for that command), the QP may time out after the midlayer times out. Therefore, when aborting the command, iSER may still have references for the command's buffers. When sending these PDUs, the sends will complete with an error and their resources will be released then. Signed-off-by: Erez Zilber <erezz@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 89e37283c836..278fcbccc2d9 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -658,6 +658,7 @@ void iser_ctask_rdma_finalize(struct iscsi_iser_cmd_task *iser_ctask)
658{ 658{
659 int deferred; 659 int deferred;
660 int is_rdma_aligned = 1; 660 int is_rdma_aligned = 1;
661 struct iser_regd_buf *regd;
661 662
662 /* if we were reading, copy back to unaligned sglist, 663 /* if we were reading, copy back to unaligned sglist,
663 * anyway dma_unmap and free the copy 664 * anyway dma_unmap and free the copy
@@ -672,20 +673,20 @@ void iser_ctask_rdma_finalize(struct iscsi_iser_cmd_task *iser_ctask)
672 } 673 }
673 674
674 if (iser_ctask->dir[ISER_DIR_IN]) { 675 if (iser_ctask->dir[ISER_DIR_IN]) {
675 deferred = iser_regd_buff_release 676 regd = &iser_ctask->rdma_regd[ISER_DIR_IN];
676 (&iser_ctask->rdma_regd[ISER_DIR_IN]); 677 deferred = iser_regd_buff_release(regd);
677 if (deferred) { 678 if (deferred) {
678 iser_err("References remain for BUF-IN rdma reg\n"); 679 iser_err("%d references remain for BUF-IN rdma reg\n",
679 BUG(); 680 atomic_read(&regd->ref_count));
680 } 681 }
681 } 682 }
682 683
683 if (iser_ctask->dir[ISER_DIR_OUT]) { 684 if (iser_ctask->dir[ISER_DIR_OUT]) {
684 deferred = iser_regd_buff_release 685 regd = &iser_ctask->rdma_regd[ISER_DIR_OUT];
685 (&iser_ctask->rdma_regd[ISER_DIR_OUT]); 686 deferred = iser_regd_buff_release(regd);
686 if (deferred) { 687 if (deferred) {
687 iser_err("References remain for BUF-OUT rdma reg\n"); 688 iser_err("%d references remain for BUF-OUT rdma reg\n",
688 BUG(); 689 atomic_read(&regd->ref_count));
689 } 690 }
690 } 691 }
691 692