* [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning
@ 2026-11-20 7:54 Lin Lei
2026-11-20 7:57 ` netdev-bot+sinfo
2026-11-20 10:15 ` MPTCP CI
0 siblings, 2 replies; 3+ messages in thread
From: Lin Lei @ 2026-11-20 7:54 UTC (permalink / raw)
To: netdev, mptcp
Cc: matttbe, martineau, geliang, davem, edumazet, kuba, pabeni,
willemb, horms
__mptcp_recvmsg_mskq() passes bytes copied by MSG_PEEK to
mptcp_rcv_space_adjust(), although those bytes remain in the receive
queue. Repeated peeks count the same data as new application
consumption and can inflate the receive-memory budget. Subtracting the
unread queue at a measurement boundary cannot undo that repeated count.
The receive path originally skipped this adjustment for MSG_PEEK.
Commit 581302298524 ("mptcp: error out earlier on disconnect") moved
the adjustment calls without preserving that check.
Only adjust receive space for non-peeking reads. Keep the returned
byte count unchanged.
A loopback test leaves a fixed 32 KiB queue unread and peeks 4096 times.
Before this change, sk_rcvbuf grows to the configured 8 MiB limit.
Afterwards, both the budget and the queue remain unchanged, and a
subsequent consuming read returns the original data intact.
Fixes: 581302298524 ("mptcp: error out earlier on disconnect")
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Lin Lei <llleigoing@gmail.com>
---
Changes in v2:
- Send this fix separately from the other patches.
- Update the author and sign-off and add the Reviewed-by tags.
v1: https://lore.kernel.org/all/20261117052200.1507847-4-llleigoing@outlook.com/
net/mptcp/protocol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b375da1f17fed..ca0ebcf11e02c 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2216,7 +2216,8 @@ static int __mptcp_recvmsg_mskq(struct sock *sk, struct msghdr *msg,
break;
}
- mptcp_rcv_space_adjust(msk, copied);
+ if (!(flags & MSG_PEEK))
+ mptcp_rcv_space_adjust(msk, copied);
return copied;
}
base-commit: 4d67cf2fd2352f130c42494a933ba9158b925c65
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning
2026-11-20 7:54 [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning Lin Lei
@ 2026-11-20 7:57 ` netdev-bot+sinfo
2026-11-20 10:15 ` MPTCP CI
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-20 7:57 UTC (permalink / raw)
To: Lin Lei
Cc: netdev, mptcp, matttbe, martineau, geliang, davem, edumazet, kuba,
pabeni, willemb, horms
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning
2026-11-20 7:54 [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning Lin Lei
2026-11-20 7:57 ` netdev-bot+sinfo
@ 2026-11-20 10:15 ` MPTCP CI
1 sibling, 0 replies; 3+ messages in thread
From: MPTCP CI @ 2026-11-20 10:15 UTC (permalink / raw)
To: Lin Lei; +Cc: mptcp
Hi Lin,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Perf: Unstable: 6 failed test(s): regression:sched-baseline(3) regression:sched-bbr regression:sched-clientlim regression:sched-rmem(4) regression:sched-serverlim validation:sched-loss(2) ⚠️ (1 improvements, 90 new outliers to review)
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/44702283372
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/5ac9fdbe3174
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1217034
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-20 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 7:54 [PATCH net v2] mptcp: exclude MSG_PEEK from receive buffer autotuning Lin Lei
2026-11-20 7:57 ` netdev-bot+sinfo
2026-11-20 10:15 ` MPTCP CI
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.