Re: [PATCH mptcp-next 1/2] mptcp: pm: userspace: decrement local_addr_used when remove
[email protected] Thu, 23 Jul 2026 10:48:28 +0000
| Newsgroups | dev.linux.lists.mptcp |
|---|---|
| Message-ID | <[email protected]> |
July 23, 2026 at 5:55 PM, "Gang Yan" <[email protected] mailto:[email protected]?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 <[email protected]> > > 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 <[email protected]> > --- > 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 >