]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
svcrdma: Reserve an extra WQE for ib_drain_rq()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 4 Feb 2024 23:16:37 +0000 (18:16 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:25 +0000 (09:12 -0500)
Do as other ULPs already do: ensure there is an extra Receive WQE
reserved for the tear-down drain WR. I haven't heard reports of
problems but it can't hurt.

Note that rq_depth is used to compute the Send Queue depth as well,
so this fix should affect both the SQ and RQ.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/svc_rdma_transport.c

index 4f27325ace4a4f6eaf5944d39dae072b88cad4ab..4a038c7e86f988b7469f015a42057cbb25bda385 100644 (file)
@@ -415,7 +415,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
        if (newxprt->sc_max_send_sges > dev->attrs.max_send_sge)
                newxprt->sc_max_send_sges = dev->attrs.max_send_sge;
        rq_depth = newxprt->sc_max_requests + newxprt->sc_max_bc_requests +
-                  newxprt->sc_recv_batch;
+                  newxprt->sc_recv_batch + 1 /* drain */;
        if (rq_depth > dev->attrs.max_qp_wr) {
                rq_depth = dev->attrs.max_qp_wr;
                newxprt->sc_recv_batch = 1;