All of lore.kernel.org
 help / color / mirror / Atom feed
From: "lizhijian@fujitsu.com" <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" <linux-rdma@vger.kernel.org>,
	Bob Pearson <rpearsonhpe@gmail.com>
Cc: Cheng Xu <chengyou@linux.alibaba.com>,
	"lizhijian@fujitsu.com" <lizhijian@fujitsu.com>
Subject: [PATCH v5 1/4] RDMA/rxe: Update wqe_index for each wqe error completion
Date: Mon, 4 Jul 2022 06:00:55 +0000	[thread overview]
Message-ID: <20220704060806.1622849-2-lizhijian@fujitsu.com> (raw)
In-Reply-To: <20220704060806.1622849-1-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 9d98237389cf..4ffc4ebd6e28 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -759,6 +759,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-04  6:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  6:00 [PATCH v5 0/4] RDMA/rxe: Fix no completion event issue lizhijian
2022-07-04  6:00 ` lizhijian [this message]
2022-07-04  6:00 ` [PATCH v5 2/4] RDMA/rxe: Generate error completion for error requester QP state lizhijian
2022-07-04  6:00 ` [PATCH v5 3/4] RDMA/rxe: Split qp state for requester and completer lizhijian
2022-07-04  6:00 ` [PATCH v5 4/4] RDMA/rxe: Fix typo in comment lizhijian
2022-07-14 17:10   ` Bob Pearson
2022-07-20  5:38 ` [PATCH v5 0/4] RDMA/rxe: Fix no completion event issue Leon Romanovsky
2022-07-20  6:21   ` lizhijian
2022-07-20  6:33     ` Leon Romanovsky

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=20220704060806.1622849-2-lizhijian@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@ziepe.ca \
    --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.