All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: jgg@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Cc: Bob Pearson <rpearsonhpe@gmail.com>, Jenny Hack <jhack@hpe.com>
Subject: [PATCH for-next v2 6/9] RDMA/rxe: Fix deadlock in rxe_do_local_ops()
Date: Thu, 30 Jun 2022 14:04:23 -0500	[thread overview]
Message-ID: <20220630190425.2251-7-rpearsonhpe@gmail.com> (raw)
In-Reply-To: <20220630190425.2251-1-rpearsonhpe@gmail.com>

When a local operation (invalidate mr, reg mr, bind mw) is finished
there will be no ack packet coming from a responder to cause the
wqe to be completed. This may happen anyway if a subsequent wqe
performs IO. Currently if the wqe is signalled the completer
tasklet is scheduled immediately but not otherwise.

This leads to a deadlock if the next wqe has the fence bit set in
send flags and the operation is not signalled. This patch removes
the condition that the wqe must be signalled in order to schedule
the completer tasklet which is the simplest fix for this deadlock
and is fairly low cost. This is the analog for local operations of
always setting the ackreq bit in all last or only request packets
even if the operation is not signalled.

Reported-by: Jenny Hack <jhack@hpe.com>
Fixes: c1a411268a4b1 ("RDMA/rxe: Move local ops to subroutine")
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 4d92f929d269..81eca57b04b8 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -605,9 +605,11 @@ static int rxe_do_local_ops(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
 	wqe->status = IB_WC_SUCCESS;
 	qp->req.wqe_index = queue_next_index(qp->sq.queue, qp->req.wqe_index);
 
-	if ((wqe->wr.send_flags & IB_SEND_SIGNALED) ||
-	    qp->sq_sig_type == IB_SIGNAL_ALL_WR)
-		rxe_run_task(&qp->comp.task, 1);
+	/* There is no ack coming for local work requests
+	 * which can lead to a deadlock. So go ahead and complete
+	 * it now.
+	 */
+	rxe_run_task(&qp->comp.task, 1);
 
 	return 0;
 }
-- 
2.34.1


  parent reply	other threads:[~2022-06-30 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 19:04 [PATCH for-next v2 0/9] RDMA/rxe: Various fixes Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 1/9] RDMA/rxe: Add rxe_is_fenced() subroutine Bob Pearson
2022-07-18  2:13   ` lizhijian
2022-06-30 19:04 ` [PATCH for-next v2 2/9] RDMA/rxe: Convert pr_warn/err to pr_debug in pyverbs Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 3/9] RDMA/rxe: Remove unnecessary include statement Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 4/9] RDMA/rxe: Replace " Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 5/9] RDMA/rxe: Fix rnr retry behavior Bob Pearson
2022-06-30 19:04 ` Bob Pearson [this message]
2022-06-30 19:04 ` [PATCH for-next v2 7/9] RDMA/rxe: Make the tasklet exits the same Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 8/9] RDMA/rxe: Limit the number of calls to each tasklet Bob Pearson
2022-06-30 19:04 ` [PATCH for-next v2 9/9] RDMA/rxe: Replace __rxe_do_task by rxe_run_task Bob Pearson
2022-07-01  1:24   ` lizhijian
2022-07-01  0:20 ` [PATCH for-next v2 0/9] RDMA/rxe: Various fixes Jason Gunthorpe
2022-07-22 21:14 ` 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=20220630190425.2251-7-rpearsonhpe@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=jhack@hpe.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.com \
    /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.