All of lore.kernel.org
 help / color / mirror / Atom feed
From: gang.yan@linux.dev
To: "MPTCP Linux" <mptcp@lists.linux.dev>
Cc: "Gang Yan" <yangang@kylinos.cn>
Subject: Re: [PATCH mptcp-next 1/2] mptcp: pm: userspace: decrement local_addr_used when remove
Date: Thu, 23 Jul 2026 10:48:28 +0000	[thread overview]
Message-ID: <b05aee1e4487409adb2fae8b665454c64b760a24@linux.dev> (raw)
In-Reply-To: <20260723-localaddr-v1-1-ce84b865594a@kylinos.cn>

July 23, 2026 at 5:55 PM, "Gang Yan" <gang.yan@linux.dev mailto:gang.yan@linux.dev?to=%22Gang%20Yan%22%20%3Cgang.yan%40linux.dev%3E > wrote:


Hi Matt, Hi Ge Liang,
 
Sorry for the confusion. I didn’t notice you(Geliang) had squashed this patch in your prior submission, and I didn’t mean to duplicate work on purpose. My
apologies for the oversight.
 
Separately, I recently spotted a TODO item in the userspace PM code that requires
adding refcount support for entry. I’ve been going through the relevant source
code to get familiar with the logic these days.
 
I’m writing to ask if you have a timeline to merge Ge Liang’s patch series
anytime soon. This is not a reminder by any means. If the merge is still pending,
I can build my development work directly on top of his patches to avoid extra
conflicts.
 
Thanks,
Gang

> 
> From: Gang Yan <yangang@kylinos.cn>
> 
> mptcp_userspace_pm_append_new_local_addr() increments msk->pm.local_addr_used
> when a new local address is appended, and mptcp_userspace_pm_delete_local_addr()
> decrements it when an entry is removed via the subflow destroy path. The
> mptcp_pm_nl_remove_doit() netlink REMOVE_ADDR handler, however, only unlinks
> the matching entry from msk->pm.userspace_pm_local_addr_list via
> list_del_rcu() without touching the counter, so the counter is not changed every
> time userspace removes an address by id.
> 
> Decrement msk->pm.local_addr_used under the pm lock right after list_del_rcu(),
> mirroring the increment site, so the counter stays in sync with the actual
> number of entries left in the list.
> 
> Assisted-by: Codex:GLM-5.2
> Fixes: 77e4b94a3de6 ("mptcp: update userspace pm infos")
> Signed-off-by: Gang Yan <yangang@kylinos.cn>
> ---
>  net/mptcp/pm_userspace.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> index 73094bdbdbf2..6402226a9f0e 100644
> --- a/net/mptcp/pm_userspace.c
> +++ b/net/mptcp/pm_userspace.c
> @@ -334,6 +334,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
>  }
>  
>  list_del_rcu(&match->list);
> + msk->pm.local_addr_used--;
>  spin_unlock_bh(&msk->pm.lock);
>  
>  mptcp_pm_remove_addr_entry(msk, match);
> 
> -- 
> 2.43.0
>

  reply	other threads:[~2026-07-23 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  9:55 [PATCH mptcp-next 0/2] mptcp: fix local_addr_used issue in userspace PM Gang Yan
2026-07-23  9:55 ` [PATCH mptcp-next 1/2] mptcp: pm: userspace: decrement local_addr_used when remove Gang Yan
2026-07-23 10:48   ` gang.yan [this message]
2026-07-23  9:55 ` [PATCH mptcp-next 2/2] selftests: mptcp: check local_addr_used in userspace PM Gang Yan

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=b05aee1e4487409adb2fae8b665454c64b760a24@linux.dev \
    --to=gang.yan@linux.dev \
    --cc=mptcp@lists.linux.dev \
    --cc=yangang@kylinos.cn \
    /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.