]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sunrpc: don't immediately retransmit on seqno miss
authorNikhil Jha <njha@janestreet.com>
Wed, 19 Mar 2025 17:02:40 +0000 (13:02 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 19 May 2025 14:14:29 +0000 (10:14 -0400)
commitfadc0f3bb2de8c570ced6d9c1f97222213d93140
tree3d83b58075fa987cb3ac8509c07f3df3fccb27fd
parent08d6ee6d8a10aef958c2af16bb121070290ed589
sunrpc: don't immediately retransmit on seqno miss

RFC2203 requires that retransmitted messages use a new gss sequence
number, but the same XID. This means that if the server is just slow
(e.x. overloaded), the client might receive a response using an older
seqno than the one it has recorded.

Currently, Linux's client immediately retransmits in this case. However,
this leads to a lot of wasted retransmits until the server eventually
responds faster than the client can resend.

Client -> SEQ 1 -> Server
Client -> SEQ 2 -> Server
Client <- SEQ 1 <- Server (misses, expecting seqno = 2)
Client -> SEQ 3 -> Server (immediate retransmission on miss)
Client <- SEQ 2 <- Server (misses, expecting seqno = 3)
Client -> SEQ 4 -> Server (immediate retransmission on miss)
... and so on ...

This commit makes it so that we ignore messages with bad checksums
due to seqnum mismatch, and rely on the usual timeout behavior for
retransmission instead of doing so immediately.

Signed-off-by: Nikhil Jha <njha@janestreet.com>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
net/sunrpc/clnt.c