All of lore.kernel.org
 help / color / mirror / Atom feed
From: Selvin Xavier <selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Devesh Sharma
	<devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>,
	Selvin Xavier
	<selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
Subject: [PATCH V2 for-4.1 3/9] RDMA/ocrdma: Fix QP state transition in destroy_qp
Date: Tue, 19 May 2015 11:32:34 +0530	[thread overview]
Message-ID: <1432015360-15447-4-git-send-email-selvin.xavier@avagotech.com> (raw)
In-Reply-To: <1432015360-15447-1-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>

From: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>

Don't move QP to error state, if QP is in reset state during QP
destroy operation.

Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
Signed-off-by: Selvin Xavier <selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 8771755..06e8ab7 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)
 	struct ocrdma_qp *qp;
 	struct ocrdma_dev *dev;
 	struct ib_qp_attr attrs;
-	int attr_mask = IB_QP_STATE;
+	int attr_mask;
 	unsigned long flags;
 
 	qp = get_ocrdma_qp(ibqp);
 	dev = get_ocrdma_dev(ibqp->device);
 
-	attrs.qp_state = IB_QPS_ERR;
 	pd = qp->pd;
 
 	/* change the QP state to ERROR */
-	_ocrdma_modify_qp(ibqp, &attrs, attr_mask);
-
+	if (qp->state != OCRDMA_QPS_RST) {
+		attrs.qp_state = IB_QPS_ERR;
+		attr_mask = IB_QP_STATE;
+		_ocrdma_modify_qp(ibqp, &attrs, attr_mask);
+	}
 	/* ensure that CQEs for newly created QP (whose id may be same with
 	 * one which just getting destroyed are same), dont get
 	 * discarded until the old CQEs are discarded.
-- 
2.2.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-05-19  6:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  6:02 [PATCH V2 for-4.1 0/9] ocrdma bug fixes Selvin Xavier
     [not found] ` <1432015360-15447-1-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-05-19  6:02   ` [PATCH V2 for-4.1 1/9] RDMA/ocrdma: Fix EQ destroy failure during driver unload Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 2/9] RDMA/ocrdma: Report EQ full fatal error Selvin Xavier
2015-05-19  6:02   ` Selvin Xavier [this message]
2015-05-19  6:02   ` [PATCH V2 for-4.1 4/9] RDMA/ocrdma: Use VID 0 if PFC is enabled and vlan is not configured Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 5/9] RDMA/ocrdma: Fix the request length for RDMA_QUERY_QP mailbox command to FW Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 6/9] RDMA/ocrdma: Prevent allocation of DPP PDs if FW doesnt support it Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 7/9] RDMA/ocrdma: Fix dmac resolution for link local address Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 8/9] RDMA/ocrdma: Fail connection for MTU lesser than 512 Selvin Xavier
2015-05-19  6:02   ` [PATCH V2 for-4.1 9/9] RDMA/ocrdma: Update ocrdma version number Selvin Xavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432015360-15447-4-git-send-email-selvin.xavier@avagotech.com \
    --to=selvin.xavier-1wcphe2jlwo1z/+hsey0gg@public.gmane.org \
    --cc=devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.