mptcp: fix rcv buffer auto-tuning
authorPaolo Abeni <pabeni@redhat.com>
Thu, 20 Jul 2023 18:47:50 +0000 (20:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Jul 2023 23:36:05 +0000 (16:36 -0700)
commitb8dc6d6ce93142ccd4c976003bb6c25d63aac2ce
tree647b7513486333643f7ce38ba7b4561a9ac952ef
parent004a04b97bbcbb630421e44aadfe675fe6b4c460
mptcp: fix rcv buffer auto-tuning

The MPTCP code uses the assumption that the tcp_win_from_space() helper
does not use any TCP-specific field, and thus works correctly operating
on an MPTCP socket.

The commit dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
broke such assumption, and as a consequence most MPTCP connections stall
on zero-window event due to auto-tuning changing the rcv buffer size
quite randomly.

Address the issue syncing again the MPTCP auto-tuning code with the TCP
one. To achieve that, factor out the windows size logic in socket
independent helpers, and reuse them in mptcp_rcv_space_adjust(). The
MPTCP level scaling_ratio is selected as the minimum one from the all
the subflows, as a worst-case estimate.

Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Link: https://lore.kernel.org/r/20230720-upstream-net-next-20230720-mptcp-fix-rcv-buffer-auto-tuning-v1-1-175ef12b8380@tessares.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h
net/mptcp/protocol.c
net/mptcp/protocol.h
net/mptcp/subflow.c