qedr: modify QP state to error when destroying it
authorAmrani, Ram <Ram.Amrani@cavium.com>
Thu, 22 Dec 2016 12:40:36 +0000 (14:40 +0200)
committerDoug Ledford <dledford@redhat.com>
Thu, 22 Dec 2016 16:36:12 +0000 (11:36 -0500)
Current code didn't modify the QP state to error because it queried the
QP state as a bitmap while it isn't. So the code never got executed.
This patch fixes this and queries for each QP state respectively and not
at once via a bitmask.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Reviewed-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/qedr/verbs.c

index 5d1980dd6c484eab7b4676bb399a33ae2a8de502..0237ff986829e0b3ffc1daa8a5400ce36365146b 100644 (file)
@@ -2078,8 +2078,10 @@ int qedr_destroy_qp(struct ib_qp *ibqp)
        DP_DEBUG(dev, QEDR_MSG_QP, "destroy qp: destroying %p, qp type=%d\n",
                 qp, qp->qp_type);
 
-       if (qp->state != (QED_ROCE_QP_STATE_RESET | QED_ROCE_QP_STATE_ERR |
-                         QED_ROCE_QP_STATE_INIT)) {
+       if ((qp->state != QED_ROCE_QP_STATE_RESET) &&
+           (qp->state != QED_ROCE_QP_STATE_ERR) &&
+           (qp->state != QED_ROCE_QP_STATE_INIT)) {
+
                attr.qp_state = IB_QPS_ERR;
                attr_mask |= IB_QP_STATE;