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>
This commit is contained in:
Frank Zago 2009-12-09 13:51:36 -08:00 committed by Roland Dreier
parent 9420269428
commit e5dec39474

View File

@ -3386,8 +3386,10 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
wqe_count = 0; wqe_count = 0;
total_payload_length = 0; total_payload_length = 0;
if (nesqp->ibqp_state > IB_QPS_RTS) if (nesqp->ibqp_state > IB_QPS_RTS) {
return -EINVAL; err = -EINVAL;
goto out;
}
spin_lock_irqsave(&nesqp->lock, flags); spin_lock_irqsave(&nesqp->lock, flags);
@ -3498,6 +3500,9 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
break; break;
} }
if (err)
break;
if (ib_wr->send_flags & IB_SEND_SIGNALED) { if (ib_wr->send_flags & IB_SEND_SIGNALED) {
wqe_misc |= NES_IWARP_SQ_WQE_SIGNALED_COMPL; wqe_misc |= NES_IWARP_SQ_WQE_SIGNALED_COMPL;
} }
@ -3522,6 +3527,7 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
spin_unlock_irqrestore(&nesqp->lock, flags); spin_unlock_irqrestore(&nesqp->lock, flags);
out:
if (err) if (err)
*bad_wr = ib_wr; *bad_wr = ib_wr;
return err; return err;