Skip to content

Commit

Permalink
RDMA/nes: In nes_post_recv() always set bad_wr on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frank Zago authored and Roland Dreier committed Dec 9, 2009
1 parent e5dec39 commit 4293fdc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/infiniband/hw/nes/nes_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3554,8 +3554,10 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
u32 counter;
u32 total_payload_length;

if (nesqp->ibqp_state > IB_QPS_RTS)
return -EINVAL;
if (nesqp->ibqp_state > IB_QPS_RTS) {
err = -EINVAL;
goto out;
}

spin_lock_irqsave(&nesqp->lock, flags);

Expand Down Expand Up @@ -3618,6 +3620,7 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,

spin_unlock_irqrestore(&nesqp->lock, flags);

out:
if (err)
*bad_wr = ib_wr;
return err;
Expand Down

0 comments on commit 4293fdc

Please sign in to comment.