]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xprtrdma: Avoid Receive Queue wrapping
authorChuck Lever <chuck.lever@oracle.com>
Mon, 19 Apr 2021 18:02:03 +0000 (14:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:13:04 +0000 (10:13 +0200)
[ Upstream commit 32e6b68167f1d446111c973d57e6f52aee11897a ]

Commit e340c2d6ef2a ("xprtrdma: Reduce the doorbell rate (Receive)")
increased the number of Receive WRs that are posted by the client,
but did not increase the size of the Receive Queue allocated during
transport set-up.

This is usually not an issue because RPCRDMA_BACKWARD_WRS is defined
as (32) when SUNRPC_BACKCHANNEL is defined. In cases where it isn't,
there is a real risk of Receive Queue wrapping.

Fixes: e340c2d6ef2a ("xprtrdma: Reduce the doorbell rate (Receive)")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/xprtrdma/frwr_ops.c

index 44888f5badef5e8afc34b066925e417a541358f8..8f96bb0a606119f1cfb968e4e0fbf91f6ae827b6 100644 (file)
@@ -242,6 +242,7 @@ int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)
        ep->re_attr.cap.max_send_wr += 1; /* for ib_drain_sq */
        ep->re_attr.cap.max_recv_wr = ep->re_max_requests;
        ep->re_attr.cap.max_recv_wr += RPCRDMA_BACKWARD_WRS;
+       ep->re_attr.cap.max_recv_wr += RPCRDMA_MAX_RECV_BATCH;
        ep->re_attr.cap.max_recv_wr += 1; /* for ib_drain_rq */
 
        ep->re_max_rdma_segs =