All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@fujitsu.com>
To: Yanjun Zhu <yanjun.zhu@linux.dev>, Jason Gunthorpe <jgg@ziepe.ca>,
	"Haakon Bugge" <haakon.bugge@oracle.com>,
	<linux-rdma@vger.kernel.org>, Bob Pearson <rpearsonhpe@gmail.com>,
	Leon Romanovsky <leon@kernel.org>
Cc: Cheng Xu <chengyou@linux.alibaba.com>,
	Li Zhijian <lizhijian@fujitsu.com>
Subject: [PATCH RESEND for-next v6 2/4] RDMA/rxe: Generate error completion for error requester QP state
Date: Wed, 20 Jul 2022 04:56:06 -0400	[thread overview]
Message-ID: <1658307368-1851-3-git-send-email-lizhijian@fujitsu.com> (raw)
In-Reply-To: <1658307368-1851-1-git-send-email-lizhijian@fujitsu.com>

As per IBTA specification, all subsequent WQEs while QP is in error
state should be completed with a flush error.

Here we check QP_STATE_ERROR after req_next_wqe() so that rxe_completer()
has chance to be called where it will set CQ state to FLUSH ERROR and the
completion can associate with its WQE.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V5: parentheses issue # Cheng Xu
V4: check QP ERROR before QP RESET # Bob
V3: unlikely() optimization # Cheng Xu <chengyou@linux.alibaba.com>
    update commit log # Haakon Bugge <haakon.bugge@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index c187deeb6e6b..cbb2ce2d7b50 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -611,9 +611,20 @@ int rxe_requester(void *arg)
 		return -EAGAIN;
 
 next_wqe:
-	if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR))
+	if (unlikely(!qp->valid))
 		goto exit;
 
+	if (unlikely(qp->req.state == QP_STATE_ERROR)) {
+		wqe = req_next_wqe(qp);
+		if (wqe)
+			/*
+			 * Generate an error completion for error qp state
+			 */
+			goto err;
+		else
+			goto exit;
+	}
+
 	if (unlikely(qp->req.state == QP_STATE_RESET)) {
 		qp->req.wqe_index = queue_get_consumer(q,
 						QUEUE_TYPE_FROM_CLIENT);
-- 
2.31.1


  parent reply	other threads:[~2022-07-20  8:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  8:56 [PATCH RESEND for-next v6 0/4] RDMA/rxe: Fix no completion event issue Li Zhijian
2022-07-20  8:56 ` [PATCH RESEND for-next v6 1/4] RDMA/rxe: Update wqe_index for each wqe error completion Li Zhijian
2022-07-20  8:56 ` Li Zhijian [this message]
2022-07-20  8:56 ` [PATCH RESEND for-next v6 3/4] RDMA/rxe: Split qp state for requester and completer Li Zhijian
2022-07-20  8:56 ` [PATCH RESEND for-next v6 4/4] RDMA/rxe: Fix typo in comment Li Zhijian
2022-07-29 19:48 ` [PATCH RESEND for-next v6 0/4] RDMA/rxe: Fix no completion event issue Jason Gunthorpe
2022-08-01 19:24   ` Bob Pearson
2022-08-02 16:54 ` Jason Gunthorpe

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=1658307368-1851-3-git-send-email-lizhijian@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.com \
    --cc=yanjun.zhu@linux.dev \
    /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.