summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtrdma/transport.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2019-10-09 20:07:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-17 21:48:38 +0300
commitb2b36f91af22955cccbdc04a3bd3f59a8aeb8e0d (patch)
tree42fd8ddc634179345a9204df233d2f4b369b8d04 /net/sunrpc/xprtrdma/transport.c
parentee978cecd88ede5aed5bb274ccc43bbd162ea39e (diff)
downloadlinux-b2b36f91af22955cccbdc04a3bd3f59a8aeb8e0d.tar.xz
xprtrdma: Connection becomes unstable after a reconnect
commit a31b2f939219dd9bffdf01a45bd91f209f8cc369 upstream. This is because xprt_request_get_cong() is allowing more than one RPC Call to be transmitted before the first Receive on the new connection. The first Receive fills the Receive Queue based on the server's credit grant. Before that Receive, there is only a single Receive WR posted because the client doesn't know the server's credit grant. Solution is to clear rq_cong on all outstanding rpc_rqsts when the the cwnd is reset. This is because an RPC/RDMA credit is good for one connection instance only. Fixes: 75891f502f5f ("SUNRPC: Support for congestion control ... ") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sunrpc/xprtrdma/transport.c')
-rw-r--r--net/sunrpc/xprtrdma/transport.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 160558b4135e..c67d465dc062 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -428,8 +428,11 @@ void xprt_rdma_close(struct rpc_xprt *xprt)
/* Prepare @xprt for the next connection by reinitializing
* its credit grant to one (see RFC 8166, Section 3.3.3).
*/
+ spin_lock(&xprt->transport_lock);
r_xprt->rx_buf.rb_credits = 1;
+ xprt->cong = 0;
xprt->cwnd = RPC_CWNDSHIFT;
+ spin_unlock(&xprt->transport_lock);
out:
xprt->reestablish_timeout = 0;