mptcp: avoid unneeded subflow-level drops

commit 4f102d747c upstream.

The rcv window is shared among all the subflows. Currently, MPTCP sync
the TCP-level rcv window with the MPTCP one at tcp_transmit_skb() time.

The above means that incoming data may sporadically observe outdated
TCP-level rcv window and being wrongly dropped by TCP.

Address the issue checking for the edge condition before queuing the
data at TCP level, and eventually syncing the rcv window as needed.

Note that the issue is actually present from the very first MPTCP
implementation, but backports older than the blamed commit below will
range from impossible to useless.

Before:

  $ nstat -n; sleep 1; nstat -z TcpExtBeyondWindow
  TcpExtBeyondWindow              14                 0.0

After:

  $ nstat -n; sleep 1; nstat -z TcpExtBeyondWindow
  TcpExtBeyondWindow              0                  0.0

Fixes: fa3fe2b150 ("mptcp: track window announced to peer")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251118-net-mptcp-misc-fixes-6-18-rc6-v1-2-806d3781c95f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Conflicts in options.c, because the new rwin_update() helper has been
  added after __mptcp_snd_una_update() which is not in this version --
  see commit -- and then causing conflicts in the context. There were
  also some conflicts in mptcp_set_rwin(), because commit f3589be0c4
  ("mptcp: never shrink offered window") is not in this version. Only
  the update of subflow->rcv_wnd_sent has been added. Also
  msk->rcv_wnd_sent is a u64 before this commit: in rwin_update(),
  READ_ONCE() is used instead of atomic64_read(&). ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Paolo Abeni 2025-11-29 17:58:26 +01:00 • committed by Greg Kroah-Hartman
commit dad1e44ed9
2 changed files with 31 additions and 2 deletions