Commit fe48822b authored by Devesh Sharma's avatar Devesh Sharma Committed by Doug Ledford

RDMA/ocrdma: Fix QP state transition in destroy_qp

Don't move QP to error state, if QP is in reset state during QP
destroy operation.
Signed-off-by: default avatarDevesh Sharma <devesh.sharma@avagotech.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@avagotech.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 5e6f9237
...@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp) ...@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp)
struct ocrdma_qp *qp; struct ocrdma_qp *qp;
struct ocrdma_dev *dev; struct ocrdma_dev *dev;
struct ib_qp_attr attrs; struct ib_qp_attr attrs;
int attr_mask = IB_QP_STATE; int attr_mask;
unsigned long flags; unsigned long flags;
qp = get_ocrdma_qp(ibqp); qp = get_ocrdma_qp(ibqp);
dev = get_ocrdma_dev(ibqp->device); dev = get_ocrdma_dev(ibqp->device);
attrs.qp_state = IB_QPS_ERR;
pd = qp->pd; pd = qp->pd;
/* change the QP state to ERROR */ /* change the QP state to ERROR */
if (qp->state != OCRDMA_QPS_RST) {
attrs.qp_state = IB_QPS_ERR;
attr_mask = IB_QP_STATE;
_ocrdma_modify_qp(ibqp, &attrs, attr_mask); _ocrdma_modify_qp(ibqp, &attrs, attr_mask);
}
/* ensure that CQEs for newly created QP (whose id may be same with /* ensure that CQEs for newly created QP (whose id may be same with
* one which just getting destroyed are same), dont get * one which just getting destroyed are same), dont get
* discarded until the old CQEs are discarded. * discarded until the old CQEs are discarded.
......
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