]> Gentwo Git Trees - linux/.git/commit
mptcp: borrow forward memory from subflow
authorPaolo Abeni <pabeni@redhat.com>
Fri, 21 Nov 2025 17:02:11 +0000 (18:02 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Nov 2025 03:49:42 +0000 (19:49 -0800)
commit9db5b3cec4ec1c0cd3239689f5c8653d691a1754
tree6b0b6b0d2cb8c8ad78c48bcad8b214ac3b1a02a6
parent0eeb372deebce6c25b9afc09e35d6c75a744299a
mptcp: borrow forward memory from subflow

In the MPTCP receive path, we release the subflow allocated fwd
memory just to allocate it again shortly after for the msk.

That could increases the failures chances, especially when we will
add backlog processing, with other actions could consume the just
released memory before the msk socket has a chance to do the
rcv allocation.

Replace the skb_orphan() call with an open-coded variant that
explicitly borrows, the fwd memory from the subflow socket instead
of releasing it.

The borrowed memory does not have PAGE_SIZE granularity; rounding to
the page size will make the fwd allocated memory higher than what is
strictly required and could make the incoming subflow fwd mem
consistently negative. Instead, keep track of the accumulated frag and
borrow the full page at subflow close time.

This allow removing the last drop in the TCP to MPTCP transition and
the associated, now unused, MIB.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251121-net-next-mptcp-memcg-backlog-imp-v1-12-1f34b6c1e0b1@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/fastopen.c
net/mptcp/mib.c
net/mptcp/mib.h
net/mptcp/protocol.c
net/mptcp/protocol.h