[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220412022903.574238-3-lizhijian@fujitsu.com>
Date: Tue, 12 Apr 2022 10:29:03 +0800
From: Li Zhijian <lizhijian@...itsu.com>
To: <zyjzyj2000@...il.com>, <jgg@...pe.ca>,
<linux-rdma@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>, Li Zhijian <lizhijian@...itsu.com>
Subject: [PATCH 3/3] RDMA/rxe: Generate error completion for error requester state
SoftRoCE always returns success when user space is posting a new wqe where
it usually just euqueues a wqe.
Once requester state becomes QP_STATE_ERROR, we should generate error
completion for all subsequent wqe. So user is able to poll the completion
event to check if the former wqe is handled correctly.
Here we check QP_STATE_ERROR after req_next_wqe() so that the completion
can associate with its wqe.
Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
---
drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index c369bebaf02e..9b35f6528d73 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -611,7 +611,7 @@ int rxe_requester(void *arg)
rxe_get(qp);
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_RESET)) {
@@ -633,6 +633,14 @@ int rxe_requester(void *arg)
if (unlikely(!wqe))
goto exit;
+ if (qp->req.state == QP_STATE_ERROR) {
+ /*
+ * Generate an error completion so that user space is able to
+ * poll this completion.
+ */
+ goto err;
+ }
+
if (wqe->mask & WR_LOCAL_OP_MASK) {
ret = rxe_do_local_ops(qp, wqe);
if (unlikely(ret))
--
2.31.1
Powered by blists - more mailing lists