Commit 922d9a40 authored by Amrani, Ram's avatar Amrani, Ram Committed by Doug Ledford

qedr: post_send/recv according to QP state

Enable posting to SQ only in RTS, ERR and SQD QP state.
Enable posting to RQ in ERR QP state.
Signed-off-by: default avatarRam Amrani <Ram.Amrani@cavium.com>
Reviewed-by: default avatarMichal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 8b0cabc6
......@@ -2989,8 +2989,9 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
spin_lock_irqsave(&qp->q_lock, flags);
if ((qp->state == QED_ROCE_QP_STATE_RESET) ||
(qp->state == QED_ROCE_QP_STATE_ERR)) {
if ((qp->state != QED_ROCE_QP_STATE_RTS) &&
(qp->state != QED_ROCE_QP_STATE_ERR) &&
(qp->state != QED_ROCE_QP_STATE_SQD)) {
spin_unlock_irqrestore(&qp->q_lock, flags);
*bad_wr = wr;
DP_DEBUG(dev, QEDR_MSG_CQ,
......@@ -3043,8 +3044,7 @@ int qedr_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
spin_lock_irqsave(&qp->q_lock, flags);
if ((qp->state == QED_ROCE_QP_STATE_RESET) ||
(qp->state == QED_ROCE_QP_STATE_ERR)) {
if (qp->state == QED_ROCE_QP_STATE_RESET) {
spin_unlock_irqrestore(&qp->q_lock, flags);
*bad_wr = wr;
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment