]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
rxrpc: Fix the excessive initial retransmission timeout
authorDavid Howells <dhowells@redhat.com>
Mon, 11 May 2020 13:54:34 +0000 (14:54 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:22:50 +0000 (17:22 -0300)
commita1bcfff8fa60dd8665679ff25cb7b17aaa2185f5
treefa215874447a2ec9b256e73a1d3a87acf3aac406
parent2ed3461f8f79284abc4f36ddffb7d3a1f72236c8
rxrpc: Fix the excessive initial retransmission timeout

BugLink: https://bugs.launchpad.net/bugs/1881178
commit c410bf01933e5e09d142c66c3df9ad470a7eec13 upstream.

rxrpc currently uses a fixed 4s retransmission timeout until the RTT is
sufficiently sampled.  This can cause problems with some fileservers with
calls to the cache manager in the afs filesystem being dropped from the
fileserver because a packet goes missing and the retransmission timeout is
greater than the call expiry timeout.

Fix this by:

 (1) Copying the RTT/RTO calculation code from Linux's TCP implementation
     and altering it to fit rxrpc.

 (2) Altering the various users of the RTT to make use of the new SRTT
     value.

 (3) Replacing the use of rxrpc_resend_timeout to use the calculated RTO
     value instead (which is needed in jiffies), along with a backoff.

Notes:

 (1) rxrpc provides RTT samples by matching the serial numbers on outgoing
     DATA packets that have the RXRPC_REQUEST_ACK set and PING ACK packets
     against the reference serial number in incoming REQUESTED ACK and
     PING-RESPONSE ACK packets.

 (2) Each packet that is transmitted on an rxrpc connection gets a new
     per-connection serial number, even for retransmissions, so an ACK can
     be cross-referenced to a specific trigger packet.  This allows RTT
     information to be drawn from retransmitted DATA packets also.

 (3) rxrpc maintains the RTT/RTO state on the rxrpc_peer record rather than
     on an rxrpc_call because many RPC calls won't live long enough to
     generate more than one sample.

 (4) The calculated SRTT value is in units of 8ths of a microsecond rather
     than nanoseconds.

The (S)RTT and RTO values are displayed in /proc/net/rxrpc/peers.

Fixes: 17926a79320a ([AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both"")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
17 files changed:
fs/afs/fs_probe.c
fs/afs/vl_probe.c
include/net/af_rxrpc.h
include/trace/events/rxrpc.h
net/rxrpc/Makefile
net/rxrpc/ar-internal.h
net/rxrpc/call_accept.c
net/rxrpc/call_event.c
net/rxrpc/input.c
net/rxrpc/misc.c
net/rxrpc/output.c
net/rxrpc/peer_event.c
net/rxrpc/peer_object.c
net/rxrpc/proc.c
net/rxrpc/rtt.c [new file with mode: 0644]
net/rxrpc/sendmsg.c
net/rxrpc/sysctl.c