prepare interfaces for kTLS and sockmap support
Subsystems (3)
Geliang Tang
reviewerv12 cover prepare interfaces for kTLS and sockmap support
From: Geliang Tang <[email protected]>
v12:
- patch 1, replace msk->app_limited with a one-shot local bool passed through __mptcp_push_pending(), async pushes pass false; add a per-subflow check_app_limited flag consumed in mptcp_sendmsg_frag(); also check recovery state and send window space in mptcp_rate_check_app_limited().
v11:
- patch 1, clear app_limited on sendmsg exit and in the wait_for_memory
path instead of in __subflow_push_pending, so all subflows pushed
within one sendmsg are marked; read MPTCP_RETRANSMIT under mptcp_data_lock; move app_limited to a separate u8 bitfield.
- patch 2, guard the app_limited assertion with tcpi_delivery_rate
instead of asserting tcpi_delivery_rate > 0.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v10:
- patch 1, clear app_limited flag in __subflow_push_pending.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v9:
- Move SIOCINQ patches out of this set.
- patch 1, add app_limited flag in struct mptcp_sock, call tcp_rate_check_app_limited in __subflow_push_pending instead of mptcp_sendmsg.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v8:
- patch 1: change mptcp_inq_hint() to maintain TCP semantics by adding 1
to hint_val when RCV_SHUTDOWN is set or sk_state is TCP_CLOSE, matching TCP behavior where FIN consumes a sequence number.
- patch 2: update the test.
- patches 3-7: no changes.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v7:
- patch 1: add 1 to hint_val when RCV_SHUTDOWN is set to include the FIN
byte, matching the previous ack_seq - map_seq behavior. Simplify the
EOF condition accordingly.
- patch 2: replace poll()-based check with a wait_for_remote_key() helper
that polls MPTCP_INFO until MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED is set, ensuring the third ACK has been processed before checking SIOCINQ. Add SOL_MPTCP fallback definition and handle ENOPROTOOPT/EOPNOTSUPP for
TCP or fallback sockets.
- patches 3-7: no changes.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v6:
- patch 2: add Fixes tag, and use '-net' prefix.
- patch 3: remove poll() call, check SIOCINQ directly after accept().
- patch 6: add READ_ONCE() for msk->flags and msk->cb_flags reads in mptcp_rate_check_app_limited() to annotate intentionally racy accesses.
- update commit logs.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v5:
- patch 2: new patch - rewrite mptcp_inq_hint() to use mptcp_data_avail() instead of ack_seq - map_seq, completely avoiding TFO overflow issues.
- patch 3: new patch - add TFO SIOCINQ overflow detection in
mptcp_connect test to catch INT_MAX returns on TFO connections.
- patch 4: mptcp_inq() now returns INT_MAX instead of 0 when avail >=
INT_MAX. Removed mptcp_inq_hint() changes (moved to patch 2).
- patch 6: replace mptcp_rtx_head() check with MPTCP_WORK_RTX and MPTCP_RETRANSMIT flag checks in mptcp_rate_check_app_limited() to
properly detect pending retransmissions without data race issues.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v4:
- patch 2: fix mptcp_inq_hint() to return 0 instead of INT_MAX on
passive TFO overflow (ack_seq - map_seq >= INT_MAX).
- patch 4: add mptcp_rtx_head(sk) to the early-return check in mptcp_rate_check_app_limited() so pending retransmissions also
prevent false app-limited marking.
- patch 5: update comment message.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v3:
- patch 2: drop DATA_FIN subtraction in mptcp_inq(), remove the
intermediate 'answ' variable and return (unsigned int)avail
directly. Update commit message accordingly.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v2:
- drop the patch "prevent dummy DATA_FIN on RST in fallback mode".
- keep mptcp_inq_hint in mptcp_ioctl unchanged.
- use mptcp_data_avail in mptcp_inq.
- add msk_owned_by_me check in mptcp_sendmsg_locked.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v1:
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
This series was previously posted as part of "Reduce the differences between TCP and MPTCP for TLS usage" v15. It creates the mptcp_inq() and mptcp_sendmsg_locked() interfaces that are required for the upcoming MPTCP kTLS and MPTCP sockmap implementations.
The series has been rebased and no longer depends on Paolo's CB layout refactoring patches (mptcp: drop the mptcp_ooo_try_coalesce() helper,
mptcp: drop the cant_coalesce CB field, mptcp: remove CB offset field,
mptcp: sync mptcp skb cb layout with tcp one, mptcp: defer read_sock cleanup to mptcp_worker). Those patches are more complex and will be sent in a separate series.
Gang Yan (1):
mptcp: update mptcp_check_readable
Geliang Tang (3):
mptcp: track app-limited state in mptcp_sendmsg
selftests: mptcp: sockopt: check app_limited
mptcp: add sendmsg_locked to proto_ops
net/mptcp/pm.c | 2 +- net/mptcp/protocol.c | 89 +++++++++++++++---- net/mptcp/protocol.h | 4 +- .../selftests/net/mptcp/mptcp_sockopt.c | 5 ++ 4 files changed, 83 insertions(+), 17 deletions(-)
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v12 1/4 mptcp: track app-limited state in mptcp_sendmsg
From: Geliang Tang <[email protected]>
MPTCP sends bypass tcp_sendmsg(), so subflows never get the application-limited marking that rate estimators like BBR rely on.
Add mptcp_rate_check_app_limited() to check the MPTCP-level conditions (write_seq == snd_nxt, no pending dfrags, no pending retransmission or recovery) at sendmsg entry. The decision is carried by a stack-local one-shot bool through struct mptcp_sendmsg_info, and each subflow's new check_app_limited flag records whether its transmit queue is drained. mptcp_sendmsg_frag() consumes both on the locked subflow, calls tcp_rate_check_app_limited() and clears the per-subflow flag.
The local bool is reset before waiting for memory, and every asynchronous push and retransmission path passes app_limited=false, so only a synchronous push in the same sendmsg can act on the decision. The per-subflow flags are fully refreshed by each successful mptcp_rate_check_app_limited() run, so any flag left behind by an unconsumed sendmsg is inert.
--- net/mptcp/pm.c | 2 +- net/mptcp/protocol.c | 60 ++++++++++++++++++++++++++++++++++++++------ net/mptcp/protocol.h | 4 ++- 3 files changed, 56 insertions(+), 10 deletions(-)
net/mptcp/pm.c +1 -1
@@ -1113,7 +1113,7 @@ mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk)* we can possibly use backup subflows now, and subflow selection * is cheap under the msk socket lock */ -__mptcp_push_pending (sk,0 ); +__mptcp_push_pending (sk,0 , false);return ; } }
net/mptcp/protocol.c +52 -8
133 lines not on this page · raw message
net/mptcp/protocol.h +3 -1
@@ -617,6 +617,7 @@ struct mptcp_subflow_context {bool close_event_done;/* has done the post-closed part, * protected by msk socket lock */ +bool check_app_limited;/* protected by msk socket lock */ u32 lent_mem_frag;u32 remote_nonce;u32 local_nonce;
@@ -856,7 +857,8 @@ void __mptcp_subflow_fully_established(struct mptcp_sock *msk, const struct mptcp_options_received *mp_opt);bool __mptcp_retransmit_pending_data (struct sock *sk);void mptcp_check_and_set_pending (struct sock *sk); -void __mptcp_push_pending (struct sock *sk,unsigned int flags); +void __mptcp_push_pending (struct sock *sk,unsigned int flags, +bool app_limited);bool mptcp_subflow_data_available (struct sock *sk);void __init mptcp_subflow_init (void );void mptcp_subflow_shutdown (struct sock *sk,struct sock *ssk,int how);
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v12 2/4 selftests: mptcp: sockopt: check app_limited
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
After a small data exchange, assert tcpi_delivery_rate_app_limited == 1 when expect_all_features() is enabled and tcpi_delivery_rate is non-zero.
rate_app_limited starts at 1 (tcp_init_sock) and is cleared only by non-app-limited rate samples. The preceding commit evaluates MPTCP-level conditions in mptcp_rate_check_app_limited(), stores the result in msk->app_limited, and calls tcp_rate_check_app_limited() on each scheduled subflow during push. This marks outgoing skbs as app-limited so rate samples don't clear rate_app_limited.
The tcpi_delivery_rate guard skips the assertion when no rate sample was measured yet, where rate_app_limited would trivially still be 1.
--- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +5 -0
@@ -635,6 +635,11 @@ static void connect_one_server(int fd, int pipefd)do_getsockopts (&s, fd, total, total);assert (s.mptcpi_rcv_delta == (uint64_t )total); + +/* app-limited accounting only checked under EXPECT_ALL_FEATURES */ +if (expect_all_features () && s.tcp_info.tcpi_delivery_rate) +assert (s.tcp_info.tcpi_delivery_rate_app_limited ==1 ); +close (fd); }
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v12 3/4 mptcp: add sendmsg_locked to proto_ops
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
MPTCP currently provides a standard sendmsg() implementation which acquires and releases the socket lock internally. However, certain upper layers need to call the sendmsg method while the socket lock is already held.
Split the existing mptcp_sendmsg() into mptcp_sendmsg_locked() which assumes the caller holds lock_sock() in process context, and a tiny wrapper mptcp_sendmsg() that acquires the lock and calls the locked version. Add msk_owned_by_me() assertion to enforce the locking requirement. Expose .sendmsg_locked in both mptcp_stream_ops and mptcp_v6_stream_ops.
mptcp_sendmsg_locked() keeps the existing flag mask, which, unlike tcp_sendmsg_locked(), ignores MSG_SPLICE_PAGES, MSG_ZEROCOPY and MSG_SENDPAGE_DECRYPTED. The upcoming kTLS and sockmap support will require additional changes to call through proto_ops->sendmsg_locked instead of tcp_sendmsg_locked() directly.
--- net/mptcp/protocol.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
net/mptcp/protocol.c +16 -4
@@ -2150,7 +2150,7 @@ static bool mptcp_rate_check_app_limited(struct sock *sk)return true; } -static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) +static int mptcp_sendmsg_locked (struct sock *sk,struct msghdr *msg,size_t len) {struct mptcp_sock *msk =mptcp_sk (sk);bool app_limited = false;
@@ -2159,12 +2159,12 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)int ret =0 ;long timeo; +msk_owned_by_me (msk); +/* silently ignore everything else */ msg->msg_flags &=MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL |MSG_FASTOPEN |MSG_EOR ; -lock_sock (sk); -mptcp_rps_record_subflows (msk); if (unlikely(inet_test_bit(DEFER_CONNECT, sk) ||
@@ -2285,7 +2285,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) } out: -release_sock (sk);return copied; do_error:
@@ -2298,6 +2297,17 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) goto out; } +static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) +{ +int ret; + +lock_sock (sk); + ret =mptcp_sendmsg_locked (sk, msg, len); +release_sock (sk); + +return ret; +} +static void mptcp_rcv_space_adjust (struct mptcp_sock *msk,int copied);static void mptcp_eat_recv_skb (struct sock *sk,struct sk_buff *skb)
@@ -5116,6 +5126,7 @@ static const struct proto_ops mptcp_stream_ops = { .set_rcvlowat = mptcp_set_rcvlowat, .read_sock = mptcp_read_sock, .splice_read = mptcp_splice_read, + .sendmsg_locked = mptcp_sendmsg_locked, };static struct inet_protosw mptcp_protosw = {
@@ -5235,6 +5246,7 @@ static const struct proto_ops mptcp_v6_stream_ops = { .set_rcvlowat = mptcp_set_rcvlowat, .read_sock = mptcp_read_sock, .splice_read = mptcp_splice_read, + .sendmsg_locked = mptcp_sendmsg_locked, };static struct proto mptcp_v6_prot;
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v12 4/4 mptcp: update mptcp_check_readable
In reply to Geliang TangFrom: Gang Yan <[email protected]>
This patch makes mptcp_check_readable() aligned with TCP, and renames it to mptcp_stream_is_readable(). It will be used in the case of KTLS, because 'prot' will be modified, tls_sw_sock_is_readable() is expected to be called from prot->sock_is_readable().
--- net/mptcp/protocol.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/mptcp/protocol.c +6 -3
@@ -3760,9 +3760,11 @@ void __mptcp_unaccepted_force_close(struct sock *sk)__mptcp_destroy_sock (sk); } -static __poll_t mptcp_check_readable (struct sock *sk) +static bool mptcp_stream_is_readable (struct sock *sk) { -return mptcp_epollin_ready (sk) ?EPOLLIN |EPOLLRDNORM :0 ; +if (mptcp_epollin_ready (sk)) +return true; +return sk_is_readable (sk); }static void mptcp_check_listen_stop (struct sock *sk)
@@ -4890,7 +4892,8 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock, mask |=EPOLLIN |EPOLLRDNORM |EPOLLRDHUP ;if (state !=TCP_SYN_SENT && state !=TCP_SYN_RECV ) { - mask |=mptcp_check_readable (sk); +if (mptcp_stream_is_readable (sk)) + mask |=EPOLLIN |EPOLLRDNORM ;if (shutdown &SEND_SHUTDOWN ) mask |=EPOLLOUT |EPOLLWRNORM ;else
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH mptcp-next v12 2/4] selftests: mptcp: sockopt: check app_limited
In reply to Geliang TangThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] selftests: mptcp: commit message references nonexistent msk->app_limited --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] selftests: mptcp: commit message references nonexistent msk->app_limited
--
commit fbf82a8dfd82831f855578b60463eb6c0d829fd5
Author: Geliang Tang <[email protected]>
selftests: mptcp: sockopt: check app_limited
This commit adds an assertion in mptcp_sockopt.c to verify that tcpi_delivery_rate_app_limited is 1 after a small data exchange when expect_all_features() is enabled and tcpi_delivery_rate is non-zero.
Quoted 4 lines
The preceding commit evaluates MPTCP-level
conditions inmptcp_rate_check_app_limited(), stores the result inmsk->app_limited, and callstcp_rate_check_app_limited()on each scheduled subflow during push.
[Severity: Low]
Does struct mptcp_sock have an app_limited field?
In commit "mptcp: track app-limited state in mptcp_sendmsg", mptcp_rate_check_app_limited() returns a bool kept in a local variable in mptcp_sendmsg() (passed via struct mptcp_sendmsg_info) and sets subflow->check_app_limited instead of storing into msk->app_limited.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewRe: [PATCH mptcp-next v12 1/4] mptcp: track app-limited state in mptcp_sendmsg
In reply to Geliang TangThank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] mptcp: wait_for_memory in mptcp_sendmsg() drops app_limited before copy - [Medium] mptcp…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] mptcp: wait_for_memory in mptcp_sendmsg() drops app_limited before copy
- [Medium] mptcp: unnecessary mptcp_data_lock() in mptcp_rate_check_app_limited()
--
commit 36682c147f4e37f3adc6c7a4255afd1bde0e45ce
Author: Geliang Tang <[email protected]>
mptcp: track app-limited state in mptcp_sendmsg
This commit tracks application-limited state in mptcp_sendmsg() by checking MPTCP-level send conditions at entry and calling tcp_rate_check_app_limited() on drained subflows in mptcp_sendmsg_frag().
Quoted 4 lines
net/mptcp/protocol.c +0
-0
[ ... ]
Quoted 13 lines
net/mptcp/protocol.c +9
-0@@ -2112,9 +2121,39 @@ static void mptcp_rps_record_subflows(const struct mptcp_sock *msk) } } +static bool mptcp_rate_check_app_limited (struct sock *sk) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +struct mptcp_subflow_context *subflow; +bool app_limited; + +if (msk->write_seq != msk->snd_nxt ||mptcp_send_head (sk) || +test_bit (MPTCP_WORK_RTX , &msk->flags)) +return false;
net/mptcp/protocol.c static void mptcp_rps_record_subflows(const struct mptcp_sock *msk) · line 2142
Quoted 10 lines
net/mptcp/protocol.c +10
-0+ +mptcp_data_lock (sk); + app_limited = !test_bit (MPTCP_RETRANSMIT , &msk->cb_flags) && + !(msk->recovery && +before64 (msk->snd_una, msk->recovery_snd_nxt)) && + (__mptcp_check_fallback (msk) || +after64 (mptcp_wnd_end (msk), msk->snd_nxt)); +mptcp_data_unlock (sk); +if (!app_limited) +return false;
[Severity: Medium]
Is mptcp_data_lock(sk) needed here on the mptcp_sendmsg() hot path?
Acquiring sk->sk_lock.slock on every drained-queue sendmsg() doubles spinlock acquisitions per syscall on 64-bit, adds a BH disable/enable pair, and contends with softirq processing in ack_update_msk() and mptcp_data_ready().
Under lock_sock(sk), __mptcp_check_fallback(msk), mptcp_wnd_end(msk), msk->snd_nxt, msk->recovery, and msk->recovery_snd_nxt are already lockless or stable, and msk->snd_una is only checked when msk->recovery is set.
Since mptcp_retransmit_timer() can set MPTCP_RETRANSMIT in msk->cb_flags right after unlock anyway, reading these fields locklessly would avoid the spinlock.
[ ... ]
net/mptcp/protocol.c static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) · line 2273
Quoted 10 lines
net/mptcp/protocol.c +2
-1@@ -2223,7 +2266,8 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) wait_for_memory:sk_set_nospace (sk); -__mptcp_push_pending (sk, msg->msg_flags); +__mptcp_push_pending (sk, msg->msg_flags, app_limited); + app_limited = false; ret =sk_stream_wait_memory (sk, &timeo);if (ret) goto do_error;
[Severity: Medium]
Can clearing app_limited here drop the app-limited marking when wait_for_memory is reached before any data is copied?
When unacked in-flight dfrags fill sk->sk_sndbuf while msk->write_seq == msk->snd_nxt and mptcp_send_head(sk) == NULL, mptcp_rate_check_app_limited() returns true, but mptcp_send_limit() returns 0 on the first iteration and jumps straight to wait_for_memory.
__mptcp_push_pending() then returns without calling tcp_rate_check_app_limited(ssk), and app_limited = false discards the decision before sk_stream_wait_memory(). After wakeup, tp->app_limited stays unset, so BBR treats send-buffer-limited flights as network-limited.
Clearing app_limited only when data was actually queued to push (or marking drained subflows before sleeping, as tcp_sendmsg_locked() does) would preserve the app-limited state across the wait.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Hi Gang,
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: regression:sched-bidir(2) regression:sched-loss(4) regression:sched-mem-pressure(2) regression:sched-weak-secondary(2) validation:sched-weak-secondary ⚠️ (2 improvements, 232 new outliers to review)
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/47496537274
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/bade375276e2
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1232723
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-normalFor 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)
Matthieu Baerts
maintainerRe: [PATCH mptcp-next v12 1/4] mptcp: track app-limited state in mptcp_sendmsg
In reply to Geliang TangHi Geliang,
Quoted 13 lines · Geliang Tang
From: Geliang Tang <[email protected]>
MPTCP sends bypass
tcp_sendmsg(), so subflows never get the application-limited marking that rate estimators like BBR rely on.Add
mptcp_rate_check_app_limited()to check the MPTCP-level conditions (write_seq==snd_nxt, no pending dfrags, no pending retransmission or recovery) at sendmsg entry. The decision is carried by a stack-local one-shot bool through structmptcp_sendmsg_info, and each subflow's newcheck_app_limitedflag records whether its transmit queue is drained.mptcp_sendmsg_frag()consumes both on the locked subflow, callstcp_rate_check_app_limited()and clears the per-subflow flag.
Quoted 6 lines
The local bool is reset before waiting for memory, and every asynchronous push and retransmission path passes app_limited=false, so only a synchronous push in the same sendmsg can act on the decision. The per-subflow flags are fully refreshed by each successful
mptcp_rate_check_app_limited()run, so any flag left behind by an unconsumed sendmsg is inert.
This looks quite complex. I'm thinking about another alternative, way smaller. If it works, I can send it in my huge pile of fixes when I can if that's OK for you.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Geliang Tang
reviewerRe: [PATCH mptcp-next v12 1/4] mptcp: track app-limited state in mptcp_sendmsg
Hi Matt,
Quoted 23 lines · Matthieu Baerts
Hi Geliang,
Quoted 13 lines · Geliang Tang
From: Geliang Tang <[email protected]>
MPTCP sends bypass
tcp_sendmsg(), so subflows never get the application-limited marking that rate estimators like BBR rely on.Add
mptcp_rate_check_app_limited()to check the MPTCP-level conditions (write_seq==snd_nxt, no pending dfrags, no pending retransmission or recovery) at sendmsg entry. The decision is carried by a stack-local one-shot bool through structmptcp_sendmsg_info, and each subflow's newcheck_app_limitedflag records whether its transmit queue is drained.mptcp_sendmsg_frag()consumes both on the locked subflow, callstcp_rate_check_app_limited()and clears the per-subflow flag.Quoted 6 lines
The local bool is reset before waiting for memory, and every asynchronous push and retransmission path passes app_limited=false, so only a synchronous push in the same sendmsg can act on the decision. The per-subflow flags are fully refreshed by each successful
mptcp_rate_check_app_limited()run, so any flag left behind by an unconsumed sendmsg is inert.
Quoted 3 lines
This looks quite complex. I'm thinking about another alternative, way smaller. If it works, I can send it in my huge pile of fixes when I can if that's OK for you.
Of course, no problem at all. Thank you very much for investing your time in my patch. Looking forward to your fix.
Thanks,
-Geliang
Quoted 3 lines
Cheers,
Matt