diff options
author | Frank Zago <fzago@systemfabricworks.com> | 2009-12-09 16:51:36 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-12-09 16:51:36 -0500 |
commit | 4293fdc115e1e4f83dcb9ec6cbd3a54c563835f0 (patch) | |
tree | d5e771ca5b1760aa1e0f4ed5eb2ad070d6d346f1 | |
parent | e5dec39474fac3458ad6a649eab8cabfc977ae87 (diff) |
RDMA/nes: In nes_post_recv() always set bad_wr on error
On error, set bad_wr in nes_post_recv(). 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>
-rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 25b52d2478a8..0b17c01bb9fa 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -3554,8 +3554,10 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, | |||
3554 | u32 counter; | 3554 | u32 counter; |
3555 | u32 total_payload_length; | 3555 | u32 total_payload_length; |
3556 | 3556 | ||
3557 | if (nesqp->ibqp_state > IB_QPS_RTS) | 3557 | if (nesqp->ibqp_state > IB_QPS_RTS) { |
3558 | return -EINVAL; | 3558 | err = -EINVAL; |
3559 | goto out; | ||
3560 | } | ||
3559 | 3561 | ||
3560 | spin_lock_irqsave(&nesqp->lock, flags); | 3562 | spin_lock_irqsave(&nesqp->lock, flags); |
3561 | 3563 | ||
@@ -3618,6 +3620,7 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, | |||
3618 | 3620 | ||
3619 | spin_unlock_irqrestore(&nesqp->lock, flags); | 3621 | spin_unlock_irqrestore(&nesqp->lock, flags); |
3620 | 3622 | ||
3623 | out: | ||
3621 | if (err) | 3624 | if (err) |
3622 | *bad_wr = ib_wr; | 3625 | *bad_wr = ib_wr; |
3623 | return err; | 3626 | return err; |