[v1,07/18] xprtrdma: Toggle XPRT_CONGESTED in xprtrdma's slot methods
diff mbox series

Message ID 20190806155423.9529.54483.stgit@manet.1015granger.net
State New
Headers show
  • NFS/RDMA patches
Related show

Commit Message

Chuck Lever Aug. 6, 2019, 3:54 p.m. UTC
Commit 48be539dd44a ("xprtrdma: Introduce ->alloc_slot call-out for
xprtrdma") added a separate alloc_slot and free_slot to the RPC/RDMA
transport. Later, commit 75891f502f5f ("SUNRPC: Support for
congestion control when queuing is enabled") modified the generic
alloc/free_slot methods, but neglected the methods in xprtrdma.

Found via code review.

Fixes: 75891f502f5f ("SUNRPC: Support for congestion control ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
 net/sunrpc/xprtrdma/transport.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 2ec349e..f4763e8 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -571,6 +571,7 @@  static void xprt_rdma_tcp_set_connect_timeout(struct rpc_xprt *xprt,
+	set_bit(XPRT_CONGESTED, &xprt->state);
 	rpc_sleep_on(&xprt->backlog, task, NULL);
 	task->tk_status = -EAGAIN;
@@ -589,7 +590,8 @@  static void xprt_rdma_tcp_set_connect_timeout(struct rpc_xprt *xprt,
 	memset(rqst, 0, sizeof(*rqst));
 	rpcrdma_buffer_put(&r_xprt->rx_buf, rpcr_to_rdmar(rqst));
-	rpc_wake_up_next(&xprt->backlog);
+	if (unlikely(!rpc_wake_up_next(&xprt->backlog)))
+		clear_bit(XPRT_CONGESTED, &xprt->state);
 static bool rpcrdma_check_regbuf(struct rpcrdma_xprt *r_xprt,