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 1/4] RDMA/rxe: Update wqe_index for each wqe error completion
Date: Wed, 20 Jul 2022 04:56:05 -0400	[thread overview]
Message-ID: <1658307368-1851-2-git-send-email-lizhijian@fujitsu.com> (raw)
In-Reply-To: <1658307368-1851-1-git-send-email-lizhijian@fujitsu.com>

Previously, if user space keeps sending abnormal wqe, queue.index will
keep increasing while qp->req.wqe_index doesn't. Once
qp->req.wqe_index==queue.index in next round, req_next_wqe() will treat queue
as empty. In such case, no new completion would be generated.

Update wqe_index for each wqe completion so that req_next_wqe() can get
next wqe properly.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index dec4ddaca70f..c187deeb6e6b 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -760,6 +760,8 @@ int rxe_requester(void *arg)
 	if (ah)
 		rxe_put(ah);
 err:
+	/* update wqe_index for each wqe completion */
+	qp->req.wqe_index = queue_next_index(qp->sq.queue, qp->req.wqe_index);
 	wqe->state = wqe_state_error;
 	__rxe_do_task(&qp->comp.task);
 
-- 
2.31.1


  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 ` Li Zhijian [this message]
2022-07-20  8:56 ` [PATCH RESEND for-next v6 2/4] RDMA/rxe: Generate error completion for error requester QP state Li Zhijian
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-2-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.