aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevesh Sharma <devesh.sharma@avagotech.com>2015-05-19 02:02:34 -0400
committerDoug Ledford <dledford@redhat.com>2015-05-18 10:25:24 -0400
commitfe48822bc6d5b455aab963038a9c776d641645cc (patch)
treeccdf87d9ef66da6e3b91f3cfcc832be28cfe765d
parent5e6f9237f8e676e8a9110b4dafed36b1dd0b5d84 (diff)
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: Devesh Sharma <devesh.sharma@avagotech.com> Signed-off-by: Selvin Xavier <selvin.xavier@avagotech.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 877175563634..06e8ab7825b9 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp)
1721 struct ocrdma_qp *qp; 1721 struct ocrdma_qp *qp;
1722 struct ocrdma_dev *dev; 1722 struct ocrdma_dev *dev;
1723 struct ib_qp_attr attrs; 1723 struct ib_qp_attr attrs;
1724 int attr_mask = IB_QP_STATE; 1724 int attr_mask;
1725 unsigned long flags; 1725 unsigned long flags;
1726 1726
1727 qp = get_ocrdma_qp(ibqp); 1727 qp = get_ocrdma_qp(ibqp);
1728 dev = get_ocrdma_dev(ibqp->device); 1728 dev = get_ocrdma_dev(ibqp->device);
1729 1729
1730 attrs.qp_state = IB_QPS_ERR;
1731 pd = qp->pd; 1730 pd = qp->pd;
1732 1731
1733 /* change the QP state to ERROR */ 1732 /* change the QP state to ERROR */
1734 _ocrdma_modify_qp(ibqp, &attrs, attr_mask); 1733 if (qp->state != OCRDMA_QPS_RST) {
1735 1734 attrs.qp_state = IB_QPS_ERR;
1735 attr_mask = IB_QP_STATE;
1736 _ocrdma_modify_qp(ibqp, &attrs, attr_mask);
1737 }
1736 /* ensure that CQEs for newly created QP (whose id may be same with 1738 /* ensure that CQEs for newly created QP (whose id may be same with
1737 * one which just getting destroyed are same), dont get 1739 * one which just getting destroyed are same), dont get
1738 * discarded until the old CQEs are discarded. 1740 * discarded until the old CQEs are discarded.