From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: mptcp@lists.linux.dev, kuba@kernel.org
Subject: Re: [PATCH mptcp-net v3 06/50] mptcp: reset the subflow on abort after fallback
Date: Thu, 26 Nov 2026 23:29:45 +0000 [thread overview]
Message-ID: <179573578572.3133.9946844363721576755@kernel.org> (raw)
In-Reply-To: <20261124-mptcp-cmason-fixes-v3-6-416c0920c73f@kernel.org>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message says that, after a fallback to TCP, closing
with SO_LINGER and a zero timeout "did not reset the connection as TCP…
- [Low] With the fallback early return gone, mptcp_do_fastclose()
(net/mptcp/protocol.c:3272-3289) sends a plain TCP RST with…
--
mptcp: reset the subflow on abort after fallback
This patch removes the fallback early return in mptcp_do_fastclose(). As
a result, a plain TCP reset is now sent on each subflow when an MPTCP
socket that fell back to TCP is aborted. It also moves the switch of
fastclosed subflows to TCP_CLOSE earlier in __mptcp_close_ssk(), so that
inet_child_forget() does not send a second reset to children of a closed
listener that were never accepted.
> After a fallback to TCP, closing an MPTCP socket with unread data, or
> with SO_LINGER and a zero timeout, did not reset the connection as TCP
> does: the data still in the MPTCP send queue was dropped, and the
> subflow was closed with a FIN.
[Severity: Low]
Is the SO_LINGER part of this description accurate? It looks like the
zero linger case already sent a TCP reset before this patch.
SO_LINGER is copied to every subflow. mptcp_setsockopt_sol_socket_linger()
does it for existing subflows, and sync_socket_options() does it for
subflows created later:
net/mptcp/sockopt.c:sync_socket_options() {
...
if (sock_flag(sk, SOCK_LINGER)) {
ssk->sk_lingertime = sk->sk_lingertime;
sock_set_flag(ssk, SOCK_LINGER);
...
}
Before this patch, the SO_LINGER(0) close of a fallen-back socket went
through:
__mptcp_close()
mptcp_do_fastclose() <- returned early after fallback
__mptcp_destroy_sock()
mptcp_destroy()
mptcp_destroy_common()
__mptcp_close_ssk()
__tcp_close(ssk, 0)
send_fastclose was never set, so the subflow was not moved to TCP_CLOSE.
__tcp_close() then reached the zero linger branch:
net/ipv4/tcp.c:__tcp_close() {
...
} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
/* Check zero linger _after_ checking for unread data. */
sk->sk_prot->disconnect(sk, 0);
...
}
tcp_disconnect() sends a reset for every state in tcp_need_reset().
Only the unread data case seems to have sent a FIN. That is the case the
Packetdrill test covers: the unread data was in the msk receive queue, so
__tcp_close() on the subflow saw neither unread data nor zero linger.
Could the commit message be limited to the unread data case?
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index f28262f072820..bbb28f778d81d 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
[ ... ]
> @@ -3268,10 +3269,7 @@ static void mptcp_do_fastclose(struct sock *sk)
> mptcp_backlog_purge(sk);
> msk->fastclosing = 1;
>
> - /* Explicitly send the fastclose reset as need */
> - if (__mptcp_check_fallback(msk))
> - return;
> -
> + /* Explicitly send the fastclose reset, a plain one after a fallback */
> mptcp_for_each_subflow_safe(msk, subflow, tmp) {
> struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
>
[Severity: Low]
With the early return gone, the loop now filters fallen-back subflows
only by LISTEN and CLOSE:
net/mptcp/protocol.c:mptcp_do_fastclose() {
...
/* Some subflow socket states don't allow/need a reset.*/
if ((1 << ssk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))
goto unlock;
...
tcp_send_active_reset(ssk, SK_RST_REASON_TCP_ABORT_ON_CLOSE);
...
}
Plain TCP uses a narrower rule in tcp_disconnect():
net/ipv4/tcp.c:tcp_disconnect() {
...
} else if (tcp_need_reset(old_state)) {
tcp_send_active_reset(sk, SK_RST_REASON_TCP_STATE);
WRITE_ONCE(sk->sk_err, ECONNRESET);
} else if (tp->snd_nxt != tp->write_seq &&
(1 << old_state) & (TCPF_CLOSING | TCPF_LAST_ACK)) {
...
}
tcp_need_reset() covers only ESTABLISHED, CLOSE_WAIT, FIN_WAIT1,
FIN_WAIT2 and SYN_RECV.
Before this patch, these fallen-back subflows were torn down by
tcp_disconnect(). On SO_LINGER(0) close, that happened through the zero
linger branch of __tcp_close(). On disconnect() and on the orphan close
timeout, it happened through __mptcp_subflow_disconnect().
Can a fallen-back subflow in CLOSING or LAST_ACK now get a reset that
plain TCP would not send? That would be the case when all its data and
its FIN were already sent (snd_nxt == write_seq), on close() with
SO_LINGER{1,0}, connect(AF_UNSPEC), the orphan close timeout in
mptcp_worker(), or mptcp_orphan_oom().
For close() with unread data, TCP also resets in these states, so that
path matches.
SYN_SENT subflows are handled later in this series by "mptcp: no
fastclose reset from SYN_SENT subflows". Only the CLOSING and LAST_ACK
difference remains at the end of the series.
The commit message says the reset is now sent as without a fallback.
Only the v2 note below the "---" line mentions this difference, and
git am drops that note. Should the permanent commit message, or a
comment in mptcp_do_fastclose(), mention it?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124-mptcp-cmason-fixes-v3-0-416c0920c73f%40kernel.org
next prev parent reply other threads:[~2026-11-26 23:29 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 21:59 [PATCH mptcp-net v3 00/50] mptcp: misc fixes Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 01/50] mptcp: keep an orphan while it can send its data Matthieu Baerts (NGI0)
2026-11-25 1:16 ` Mat Martineau
2026-11-25 1:17 ` Mat Martineau
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 02/50] mptcp: limit an orphan probing a zero window Matthieu Baerts (NGI0)
2026-11-25 1:19 ` Mat Martineau
2026-11-24 21:59 ` [PATCH mptcp-net v3 03/50] mptcp: count orphans as TCP does Matthieu Baerts (NGI0)
2026-11-25 1:21 ` Mat Martineau
2026-11-24 21:59 ` [PATCH mptcp-net v3 04/50] mptcp: return EOF after a DATA_FIN, " Matthieu Baerts (NGI0)
2026-11-26 1:57 ` Mat Martineau
2026-11-26 2:59 ` Geliang Tang
2026-11-26 8:06 ` Matthieu Baerts
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 05/50] mptcp: let TCP send orphan data after fallback Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 06/50] mptcp: reset the subflow on abort " Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko [this message]
2026-11-24 21:59 ` [PATCH mptcp-net v3 07/50] mptcp: wake up blocked senders when no sf left Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 08/50] mptcp: set SEND_SHUTDOWN on close by an sf error Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 09/50] mptcp: start close timeout on initial sf shutdown Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 10/50] mptcp: process a DATA_FIN received with old data Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 11/50] mptcp: no sf left: process pending MP_FASTCLOSE Matthieu Baerts (NGI0)
2026-11-27 1:12 ` Geliang Tang
2026-11-27 18:57 ` Matthieu Baerts
2026-12-01 8:59 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 12/50] mptcp: no sf left: process pending DATA_FIN Matthieu Baerts (NGI0)
2026-11-24 22:33 ` sashiko-bot
2026-11-26 16:50 ` Matthieu Baerts
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 13/50] mptcp: process pending close events at accept() Matthieu Baerts (NGI0)
2026-11-27 1:06 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 14/50] mptcp: report errors received before accept() Matthieu Baerts (NGI0)
2026-11-27 1:02 ` Geliang Tang
2026-11-27 1:04 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 15/50] mptcp: clear sk_err on connect(), as TCP does Matthieu Baerts (NGI0)
2026-11-26 6:40 ` Geliang Tang
2026-11-26 8:15 ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 16/50] mptcp: clear DEFER_CONNECT on disconnect Matthieu Baerts (NGI0)
2026-11-26 6:41 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 17/50] mptcp: report sf aborts during deferred connect Matthieu Baerts (NGI0)
2026-11-27 1:00 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 18/50] mptcp: no fastclose reset from SYN_SENT subflows Matthieu Baerts (NGI0)
2026-11-26 7:04 ` Geliang Tang
2026-11-26 7:35 ` Matthieu Baerts
2026-11-26 8:02 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 19/50] mptcp: fastopen: keep listeners and connections Matthieu Baerts (NGI0)
2026-11-26 8:20 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 20/50] mptcp: don't inherit fastopening from a listener Matthieu Baerts (NGI0)
2026-11-26 7:07 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 21/50] mptcp: drop non-MP_JOIN cookie ACKs on PM listeners Matthieu Baerts (NGI0)
2026-11-27 1:17 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 22/50] mptcp: close a subflow reset for a bad mapping Matthieu Baerts (NGI0)
2026-11-27 1:17 ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 23/50] mptcp: pm: kernel: count endpoint listeners as sockets in use Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 24/50] mptcp: count a listener once when listen() is called again Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 25/50] mptcp: send the infinite map in a single segment Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 26/50] mptcp: keep room for infinite map after fallback Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 27/50] mptcp: do not fallback while old data is in flight Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 28/50] mptcp: stop resending data to a peer that fell back Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 29/50] mptcp: don't resend data acked without MPTCP opts Matthieu Baerts (NGI0)
2026-11-24 22:36 ` sashiko-bot
2026-11-26 16:53 ` Matthieu Baerts
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 30/50] mptcp: pm: kernel: don't count signal+subflow ID 0 endp Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 31/50] selftests: mptcp: join: check re-adding " Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 32/50] mptcp: reclaim forward memory after coalescing skbs Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 33/50] mptcp: don't charge a shared page twice at accept() Matthieu Baerts (NGI0)
2026-11-26 2:20 ` Mat Martineau
2026-11-26 14:32 ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 34/50] mptcp: don't charge the backlog " Matthieu Baerts (NGI0)
2026-11-26 2:43 ` Mat Martineau
2026-11-26 14:41 ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 35/50] mptcp: don't charge a subflow twice when it joins during accept() Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 36/50] mptcp: continue the last mapping after a fallback Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 37/50] mptcp: keep the first byte after a simult connect Matthieu Baerts (NGI0)
2026-11-24 22:45 ` sashiko-bot
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 38/50] mptcp: move to ESTABLISHED " Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 39/50] mptcp: fix MSG_PEEK after a partly peeked skb Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 40/50] mptcp: send the DATA_ACK after moving the backlog Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 41/50] selftests: mptcp: join: infinite map: no spurious rtx Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 42/50] selftests: mptcp: connect: trunc: wait for acks Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-net v3 43/50] mptcp: order write_seq and DATA_FIN flag Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-net v3 44/50] mptcp: order write_seq and DATA_FIN flag for fallback Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-net v3 45/50] Squash to "bpf: Add mptcp packet scheduler struct_ops" Matthieu Baerts (NGI0)
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-net v3 46/50] Squash to "bpf: Export mptcp packet scheduler helpers" Matthieu Baerts (NGI0)
2026-11-24 22:45 ` sashiko-bot
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 47/50] mptcp: push pending data after a fallback on reception Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 48/50] mptcp: report errors as TCP does when closing Matthieu Baerts (NGI0)
2026-11-24 22:52 ` sashiko-bot
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 49/50] mptcp: trace: name all the mapping statuses Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH RFC mptcp-next mptcp-net v3 50/50] mptcp: reset when the DSS disappears after a DATA_ACK Matthieu Baerts (NGI0)
2026-11-24 22:36 ` sashiko-bot
2026-11-26 23:29 ` netdev-bot+sashiko
2026-11-25 0:39 ` [PATCH mptcp-net v3 00/50] mptcp: misc fixes MPTCP CI
2026-11-26 16:54 ` Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179573578572.3133.9946844363721576755@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=kuba@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.