linux_dsm_epyc7002/net/sunrpc/xprtrdma
Chuck Lever 8d4fb8ff42 xprtrdma: Fix disconnect regression
I found that injecting disconnects with v4.18-rc resulted in
random failures of the multi-threaded git regression test.

The root cause appears to be that, after a reconnect, the
RPC/RDMA transport is waking pending RPCs before the transport has
posted enough Receive buffers to receive the Replies. If a Reply
arrives before enough Receive buffers are posted, the connection
is dropped. A few connection drops happen in quick succession as
the client and server struggle to regain credit synchronization.

This regression was introduced with commit 7c8d9e7c88 ("xprtrdma:
Move Receive posting to Receive handler"). The client is supposed to
post a single Receive when a connection is established because
it's not supposed to send more than one RPC Call before it gets
a fresh credit grant in the first RPC Reply [RFC 8166, Section
3.3.3].

Unfortunately there appears to be a longstanding bug in the Linux
client's credit accounting mechanism. On connect, it simply dumps
all pending RPC Calls onto the new connection. It's possible it has
done this ever since the RPC/RDMA transport was added to the kernel
ten years ago.

Servers have so far been tolerant of this bad behavior. Currently no
server implementation ever changes its credit grant over reconnects,
and servers always repost enough Receives before connections are
fully established.

The Linux client implementation used to post a Receive before each
of these Calls. This has covered up the flooding send behavior.

I could try to correct this old bug so that the client sends exactly
one RPC Call and waits for a Reply. Since we are so close to the
next merge window, I'm going to instead provide a simple patch to
post enough Receives before a reconnect completes (based on the
number of credits granted to the previous connection).

The spurious disconnects will be gone, but the client will still
send multiple RPC Calls immediately after a reconnect.

Addressing the latter problem will wait for a merge window because
a) I expect it to be a large change requiring lots of testing, and
b) obviously the Linux client has interoperated successfully since
day zero while still being broken.

Fixes: 7c8d9e7c88 ("xprtrdma: Move Receive posting to ... ")
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2018-08-08 16:49:47 -04:00
..
backchannel.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
fmr_ops.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
frwr_ops.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
rpc_rdma.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
svc_rdma_backchannel.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
svc_rdma_recvfrom.c svcrdma: Fix incorrect return value/type in svc_rdma_post_recvs 2018-06-08 16:28:55 -04:00
svc_rdma_rw.c svcrdma: Persistently allocate and DMA-map Receive buffers 2018-05-11 15:48:57 -04:00
svc_rdma_sendto.c svcrdma: Persistently allocate and DMA-map Send buffers 2018-05-11 15:48:57 -04:00
svc_rdma_transport.c svcrdma: Don't overrun the SGE array in svc_rdma_send_ctxt 2018-05-11 15:48:57 -04:00
svc_rdma.c xprtrdma: Prepare RPC/RDMA includes for server-side trace points 2018-05-11 15:48:57 -04:00
transport.c NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00
verbs.c xprtrdma: Fix disconnect regression 2018-08-08 16:49:47 -04:00
xprt_rdma.h NFS client updates for Linux 4.18 2018-06-12 10:09:03 -07:00