[PATCH mptcp-next 1/2] Squash to "mptcp: explicitly drop over memory limits"
"Matthieu Baerts (NGI0)" <[email protected]> Fri, 31 Jul 2026 11:23:16 +0200
| Newsgroups | dev.linux.lists.mptcp |
|---|---|
| Message-ID | <[email protected]> |
Address comments from Clashiko [1]: - mib: typo: "constrains" -> "constraints". - mptcp_over_limit: precise it is not only 0-win, but retrans, dup or old acks. - mptcp_over_limit: bump LINUX_MIB_TCPRCVQDROP, as previously discussed in [2]. Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260724-net-next-mptcp-oooq-pruning-v1-0-5dd4dec63a54%40kernel.org?part=3 [1] Link: https://lore.kernel.org/[email protected] Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> --- net/mptcp/mib.h | 2 +- net/mptcp/options.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h index 18f35f7e0a2d..25f360724c57 100644 --- a/net/mptcp/mib.h +++ b/net/mptcp/mib.h @@ -89,7 +89,7 @@ enum linux_mptcp_mib_field { MPTCP_MIB_FALLBACKFAILED, /* Can't fallback due to msk status */ MPTCP_MIB_WINPROBE, /* MPTCP-level zero window probe */ MPTCP_MIB_BACKLOGDROP, /* Backlog over memory limit */ - MPTCP_MIB_RCVPRUNED, /* Dropped due to memory constrains */ + MPTCP_MIB_RCVPRUNED, /* Dropped due to memory constraints */ MPTCP_MIB_OFO_PRUNED, /* MPTCP-level OoO queue pruned */ __MPTCP_MIB_MAX }; diff --git a/net/mptcp/options.c b/net/mptcp/options.c index d6b009319839..23503984a084 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -1193,7 +1193,7 @@ static bool mptcp_over_limit(struct sock *sk, struct sock *ssk, if (likely(mem <= READ_ONCE(sk->sk_rcvbuf))) return false; - /* Avoid silently dropping pure acks, fin or zero win probes. */ + /* Avoid silently dropping pure acks, fin or already-acked segments. */ if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq || TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN || !after(TCP_SKB_CB(skb)->end_seq, tcp_sk(ssk)->rcv_nxt)) @@ -1202,6 +1202,10 @@ static bool mptcp_over_limit(struct sock *sk, struct sock *ssk, /* Dropped due to memory constraints, schedule an ack. */ inet_csk(ssk)->icsk_ack.pending |= ICSK_ACK_NOMEM | ICSK_ACK_NOW; inet_csk_schedule_ack(ssk); + + /* In fallback mode: skb is dropped before the TCP recv queue. */ + MPTCP_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP); + return true; } -- 2.53.0