aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorFrank Zago <fzago@systemfabricworks.com>2009-12-09 16:51:36 -0500
committerRoland Dreier <rolandd@cisco.com>2009-12-09 16:51:36 -0500
commite5dec39474fac3458ad6a649eab8cabfc977ae87 (patch)
tree6997588067380f186f51f509e5e919e047f7d263 /drivers/infiniband
parent9420269428b3dc80c98e52beac60a3976fbef7d2 (diff)
RDMA/nes: In nes_post_send() always set bad_wr on error
On error, set bad_wr in nes_post_send(). Stop processing ib_wr queue when an error is detected. Signed-off-by: Frank Zago <fzago@systemfabricworks.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index a680c42d6e8..25b52d2478a 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -3386,8 +3386,10 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
3386 wqe_count = 0; 3386 wqe_count = 0;
3387 total_payload_length = 0; 3387 total_payload_length = 0;
3388 3388
3389 if (nesqp->ibqp_state > IB_QPS_RTS) 3389 if (nesqp->ibqp_state > IB_QPS_RTS) {
3390 return -EINVAL; 3390 err = -EINVAL;
3391 goto out;
3392 }
3391 3393
3392 spin_lock_irqsave(&nesqp->lock, flags); 3394 spin_lock_irqsave(&nesqp->lock, flags);
3393 3395
@@ -3498,6 +3500,9 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
3498 break; 3500 break;
3499 } 3501 }
3500 3502
3503 if (err)
3504 break;
3505
3501 if (ib_wr->send_flags & IB_SEND_SIGNALED) { 3506 if (ib_wr->send_flags & IB_SEND_SIGNALED) {
3502 wqe_misc |= NES_IWARP_SQ_WQE_SIGNALED_COMPL; 3507 wqe_misc |= NES_IWARP_SQ_WQE_SIGNALED_COMPL;
3503 } 3508 }
@@ -3522,6 +3527,7 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
3522 3527
3523 spin_unlock_irqrestore(&nesqp->lock, flags); 3528 spin_unlock_irqrestore(&nesqp->lock, flags);
3524 3529
3530out:
3525 if (err) 3531 if (err)
3526 *bad_wr = ib_wr; 3532 *bad_wr = ib_wr;
3527 return err; 3533 return err;