All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn,
	shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org,
	mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR
Date: Sat, 05 Dec 2026 22:04:09 +0000	[thread overview]
Message-ID: <179650824960.3148.3618583985726885557@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-3-1449de51adae@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] This patch defers an RM_ADDR, but no packet is guaranteed to
  carry it later.

--

mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR

This patch changes mptcp_pm_remove_addr() so that it only drops a new
RM_ADDR when another RM_ADDR is already pending. Before, it dropped the
RM_ADDR when any bit of pm.addr_signal was set. A pending ADD_ADDR or echo
no longer stops the RM_ADDR from being queued, and the RM_ADDR is expected
to go out with a later packet.

> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index dacd3cf358f5a..f12a8bfbb2a9a 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -529,7 +529,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_
>  
>  	pr_debug("msk=%p, rm_list_nr=%d\n", msk, rm_list->nr);
>  
> -	if (rm_addr) {
> +	if (mptcp_pm_should_rm_signal(msk)) {
>  		MPTCP_ADD_STATS(sock_net((struct sock *)msk),
>  				MPTCP_MIB_RMADDRTXDROP, rm_list->nr);
>  		return -EINVAL;

[Severity: Medium]

The commit message says "the RM_ADDR goes with a later packet". Is a
later packet always scheduled for it?

When an ADD_ADDR or echo is pending, the RM_ADDR is now queued, and
mptcp_pm_remove_addr() sends one pure ACK through
mptcp_pm_addr_send_ack_avoid_list(). In mptcp_established_options(),
RM_ADDR is only tried if ADD_ADDR is not:

net/mptcp/options.c:mptcp_established_options() {
    ...
	if (mptcp_established_options_add_addr(sk, skb, &opt_size, remaining,
					       has_ts, opts)) {
		...
	} else if (mptcp_established_options_rm_addr(sk, &opt_size, remaining, opts)) {
    ...
}

That ACK therefore carries the ADD_ADDR or echo, and
MPTCP_RM_ADDR_SIGNAL stays set.

If an MPTCP_PM_ADD_ADDR_SEND_ACK worker run is already queued (the echo
case in the commit message), mptcp_pm_worker()->mptcp_pm_addr_send_ack()
sends the RM_ADDR later.

What happens if the ADD_ADDR is pending and no worker ACK is queued? The
ACK sent at announce time by mptcp_pm_create_subflow_or_signal_addr()
might not have carried it. That can happen if no subflow was active yet.
It can also happen if the pure ACK already carried an MPC ACK, in which
case mptcp_established_options_add_addr() skips the ADD_ADDR.

In that case nothing seems to schedule another ACK for the RM_ADDR. The
only helper that re-arms an ACK checks the ADD_ADDR bit only:

net/mptcp/pm.c:
static void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk)
{
	if (!mptcp_pm_should_add_signal(msk))
		return;

	mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
}

ADD_ADDR retransmissions from mptcp_pm_add_addr_timer() set the ADD_ADDR
bit again and queue one worker ACK. The ADD_ADDR takes that ACK again.

On an idle connection, could the RM_ADDR then stay pending indefinitely?

While it is pending, every later call to mptcp_pm_remove_addr() takes the
new mptcp_pm_should_rm_signal() branch. It counts RmAddrTxDrop and returns
-EINVAL. The callers have already updated their state and ignore the
result: mptcp_pm_remove_announced(), the other mptcp_pm_remove_addr()
callers in pm_kernel.c and the pm_userspace.c paths. So an RM_ADDR could
still be lost indirectly because of an ADD_ADDR.

The later patch "mptcp: pm: keep an RM_ADDR when computing the MSS" only
makes data packets carry a pending RM_ADDR. It does not add an ACK
trigger, so this gap seems to remain at the end of the series.

Would it make sense for mptcp_pm_remove_addr() to schedule
MPTCP_PM_ADD_ADDR_SEND_ACK directly with mptcp_pm_schedule_work()? It
could do so when an ADD_ADDR or echo is pending, or when the RM bit is
still set after the single ACK.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org

  parent reply	other threads:[~2026-12-05 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 21:44 [PATCH net-next 00/10] mptcp: misc improvements for v7.5 Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 01/10] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-12-05 21:45   ` sashiko-bot
2026-12-05 22:04   ` netdev-bot+sashiko [this message]
2026-12-04 21:44 ` [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 06/10] selftests: mptcp: join: dump stats with right title Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 09/10] mptcp: add msk_is_mptcp() helper Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 10/10] selftests: mptcp: print stats before socket closure Matthieu Baerts (NGI0)

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=179650824960.3148.3618583985726885557@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liyonglong@chinatelecom.cn \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    /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.