FAILED: patch "[PATCH] mptcp: pm: fix RM_ADDR ID for the initial subflow" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 87b5896f3f7848130095656739b05881904e2697
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024083044-banked-tapered-91df@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
87b5896f3f78 ("mptcp: pm: fix RM_ADDR ID for the initial subflow") edd8b5d868a4 ("mptcp: pm: re-using ID of unused removed subflows") 4b317e0eb287 ("mptcp: fix NL PM announced address accounting") e38b117d7f3b ("mptcp: make pm_remove_addrs_and_subflows static")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 87b5896f3f7848130095656739b05881904e2697 Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Wed, 28 Aug 2024 08:14:25 +0200
Subject: [PATCH] mptcp: pm: fix RM_ADDR ID for the initial subflow
The initial subflow has a special local ID: 0. When an endpoint is being deleted, it is then important to check if its address is not linked to the initial subflow to send the right ID.
If there was an endpoint linked to the initial subflow, msk's mpc_endpoint_id field will be set. We can then use this info when an endpoint is being removed to see if it is linked to the initial subflow.
So now, the correct IDs are passed to mptcp_pm_nl_rm_addr_or_subflow(), it is no longer needed to use mptcp_local_id_match().
net/mptcp/pm_netlink.c +15 -13
@@ -800,11 +800,6 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,return -EINVAL ; } -static bool mptcp_local_id_match (const struct mptcp_sock *msk,u8 local_id,u8 id) -{ -return local_id == id || (!local_id && msk->mpc_endpoint_id == id); -} -static void mptcp_pm_nl_rm_addr_or_subflow (struct mptcp_sock *msk,const struct mptcp_rm_list *rm_list,enum linux_mptcp_mib_field rm_type)
@@ -839,7 +834,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,if (rm_type ==MPTCP_MIB_RMADDR && remote_id != rm_id)continue ; -if (rm_type ==MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match (msk, id, rm_id)) +if (rm_type ==MPTCP_MIB_RMSUBFLOW && id != rm_id)continue ; pr_debug(" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u\n",
@@ -1448,6 +1443,12 @@ static bool remove_anno_list_by_saddr(struct mptcp_sock *msk,return false; } +static u8 mptcp_endp_get_local_id (struct mptcp_sock *msk, +const struct mptcp_addr_info *addr) +{ +return msk->mpc_endpoint_id == addr->id ?0 : addr->id; +} +static bool mptcp_pm_remove_anno_addr (struct mptcp_sock *msk,const struct mptcp_addr_info *addr,bool force)
@@ -1455,7 +1456,7 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,struct mptcp_rm_list list = { .nr =0 };bool ret; - list.ids[list.nr++] = addr->id; + list.ids[list.nr++] =mptcp_endp_get_local_id (msk, addr); ret =remove_anno_list_by_saddr (msk, addr);if (ret || force) {
@@ -1482,14 +1483,12 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net, const struct mptcp_pm_addr_entry *entry) {const struct mptcp_addr_info *addr = &entry->addr; -struct mptcp_rm_list list = { .nr =0 }; +struct mptcp_rm_list list = { .nr =1 };long s_slot =0 , s_num =0 ;struct mptcp_sock *msk;pr_debug ("remove_id=%d\n" , addr->id); - list.ids[list.nr++] = addr->id; -while ((msk =mptcp_token_iter_next (net, &s_slot, &s_num)) !=NULL ) {struct sock *sk = (struct sock *)msk;bool remove_subflow;
@@ -1507,6 +1506,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,mptcp_pm_remove_anno_addr (msk, addr, remove_subflow && !(entry->flags &MPTCP_PM_ADDR_FLAG_IMPLICIT )); + list.ids[0 ] =mptcp_endp_get_local_id (msk, addr);if (remove_subflow) {spin_lock_bh (&msk->pm.lock);mptcp_pm_nl_rm_subflow_received (msk, &list);
@@ -1613,6 +1613,7 @@ int mptcp_pm_nl_del_addr_doit(struct sk_buff *skb, struct genl_info *info)return ret; } +/* Called from the userspace PM only */ void mptcp_pm_remove_addrs (struct mptcp_sock *msk,struct list_head *rm_list) {struct mptcp_rm_list alist = { .nr =0 };
@@ -1641,6 +1642,7 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list) } } +/* Called from the in-kernel PM only */ static void mptcp_pm_remove_addrs_and_subflows (struct mptcp_sock *msk,struct list_head *rm_list) {
@@ -1650,11 +1652,11 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,list_for_each_entry (entry, rm_list, list) {if (slist.nr <MPTCP_RM_IDS_MAX &&lookup_subflow_by_saddr (&msk->conn_list, &entry->addr)) - slist.ids[slist.nr++] = entry->addr.id; + slist.ids[slist.nr++] =mptcp_endp_get_local_id (msk, &entry->addr);if (alist.nr <MPTCP_RM_IDS_MAX &&remove_anno_list_by_saddr (msk, &entry->addr)) - alist.ids[alist.nr++] = entry->addr.id; + alist.ids[alist.nr++] =mptcp_endp_get_local_id (msk, &entry->addr); }spin_lock_bh (&msk->pm.lock);
@@ -1951,7 +1953,7 @@ static void mptcp_pm_nl_fullmesh(struct mptcp_sock *msk, {struct mptcp_rm_list list = { .nr =0 }; - list.ids[list.nr++] = addr->id; + list.ids[list.nr++] =mptcp_endp_get_local_id (msk, addr);spin_lock_bh (&msk->pm.lock);mptcp_pm_nl_rm_subflow_received (msk, &list);
Matthieu Baerts (NGI0)
maintainercover Backport of "mptcp: pm: fix RM_ADDR ID for the initial subflow"
87b5896f3f78 ("mptcp: pm: fix RM_ADDR ID for the initial subflow") depends on e38b117d7f3b ("mptcp: make pm_remove_addrs_and_subflows static") to avoid conflicts. Both can be backported to v6.6 without conflicts.
If you prefer, feel free to backport these commits to v6.6:
e38b117d7f3b 87b5896f3f78
Details:
- e38b117d7f3b ("mptcp: make pm_remove_addrs_and_subflows static")
- 87b5896f3f78 ("mptcp: pm: fix RM_ADDR ID for the initial subflow")
Geliang Tang (1):
mptcp: make pm_remove_addrs_and_subflows static
Matthieu Baerts (NGI0) (1):
mptcp: pm: fix RM_ADDR ID for the initial subflow
net/mptcp/pm_netlink.c | 32 +++++++++++++++++--------------- net/mptcp/protocol.h | 2 -- 2 files changed, 17 insertions(+), 17 deletions(-)
Signature · 1 line
2.45.2
Matthieu Baerts
maintainerRe: [PATCH 6.6.y 0/2] Backport of "mptcp: pm: fix RM_ADDR ID for the initial subflow"
Hi Greg, Sasha,
Quoted 5 lines · On 03/09/2024 12:16, Matthieu Baerts (NGI0) wrote:
87b5896f3f78("mptcp: pm: fixRM_ADDRID for the initial subflow") depends one38b117d7f3b("mptcp: makepm_remove_addrs_and_subflowsstatic") to avoid conflicts. Both can be backported to v6.6 without conflicts.
Quoted 8 lines
If you prefer, feel free to backport these commits to v6.6:
e38b117d7f3b87b5896f3f78Details:
-
e38b117d7f3b("mptcp: makepm_remove_addrs_and_subflowsstatic")
-87b5896f3f78("mptcp: pm: fixRM_ADDRID for the initial subflow")
FYI, Sasha has recently queued these 2 patches for v6.6. Nothing else needs to be done here.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Matthieu Baerts (NGI0)
maintainerPATCH 1/2 mptcp: make pm_remove_addrs_and_subflows static
In reply to [email protected]From: Geliang Tang <[email protected]>
commit e38b117d7f3b4a5d810f6d0069ad0f643e503796 upstream.
mptcp_pm_remove_addrs_and_subflows() is only used in pm_netlink.c, it's no longer used in pm_userspace.c any more since the commit 8b1c94da1e48 ("mptcp: only send RM_ADDR in nl_cmd_remove"). So this patch changes it to a static function.
Stable-dep-of: 87b5896f3f78 ("mptcp: pm: fix RM_ADDR ID for the initial subflow")
--- net/mptcp/pm_netlink.c | 4 ++-- net/mptcp/protocol.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
net/mptcp/pm_netlink.c +2 -2
@@ -1701,8 +1701,8 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list) } } -void mptcp_pm_remove_addrs_and_subflows (struct mptcp_sock *msk, -struct list_head *rm_list) +static void mptcp_pm_remove_addrs_and_subflows (struct mptcp_sock *msk, +struct list_head *rm_list) {struct mptcp_rm_list alist = { .nr =0 }, slist = { .nr =0 };struct mptcp_pm_addr_entry *entry;
net/mptcp/protocol.h +0 -2
@@ -948,8 +948,6 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, bool echo);int mptcp_pm_remove_addr (struct mptcp_sock *msk,const struct mptcp_rm_list *rm_list);void mptcp_pm_remove_addrs (struct mptcp_sock *msk,struct list_head *rm_list); -void mptcp_pm_remove_addrs_and_subflows (struct mptcp_sock *msk, -struct list_head *rm_list);void mptcp_free_local_addr_list (struct mptcp_sock *msk);int mptcp_nl_cmd_announce (struct sk_buff *skb,struct genl_info *info);
Signature · 1 line
2.45.2
Matthieu Baerts (NGI0)
maintainerPATCH 2/2 mptcp: pm: fix RM_ADDR ID for the initial subflow
In reply to [email protected]commit 87b5896f3f7848130095656739b05881904e2697 upstream.
The initial subflow has a special local ID: 0. When an endpoint is being deleted, it is then important to check if its address is not linked to the initial subflow to send the right ID.
If there was an endpoint linked to the initial subflow, msk's mpc_endpoint_id field will be set. We can then use this info when an endpoint is being removed to see if it is linked to the initial subflow.
So now, the correct IDs are passed to mptcp_pm_nl_rm_addr_or_subflow(), it is no longer needed to use mptcp_local_id_match().
--- net/mptcp/pm_netlink.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
net/mptcp/pm_netlink.c +15 -13
@@ -826,11 +826,6 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,return -EINVAL ; } -static bool mptcp_local_id_match (const struct mptcp_sock *msk,u8 local_id,u8 id) -{ -return local_id == id || (!local_id && msk->mpc_endpoint_id == id); -} -static void mptcp_pm_nl_rm_addr_or_subflow (struct mptcp_sock *msk,const struct mptcp_rm_list *rm_list,enum linux_mptcp_mib_field rm_type)
@@ -867,7 +862,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,continue ;if (rm_type ==MPTCP_MIB_RMADDR && remote_id != rm_id)continue ; -if (rm_type ==MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match (msk, id, rm_id)) +if (rm_type ==MPTCP_MIB_RMSUBFLOW && id != rm_id)continue ; pr_debug(" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u\n",
@@ -1506,6 +1501,12 @@ static bool remove_anno_list_by_saddr(struct mptcp_sock *msk,return false; } +static u8 mptcp_endp_get_local_id (struct mptcp_sock *msk, +const struct mptcp_addr_info *addr) +{ +return msk->mpc_endpoint_id == addr->id ?0 : addr->id; +} +static bool mptcp_pm_remove_anno_addr (struct mptcp_sock *msk,const struct mptcp_addr_info *addr,bool force)
@@ -1513,7 +1514,7 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,struct mptcp_rm_list list = { .nr =0 };bool ret; - list.ids[list.nr++] = addr->id; + list.ids[list.nr++] =mptcp_endp_get_local_id (msk, addr); ret =remove_anno_list_by_saddr (msk, addr);if (ret || force) {
@@ -1540,14 +1541,12 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net, const struct mptcp_pm_addr_entry *entry) {const struct mptcp_addr_info *addr = &entry->addr; -struct mptcp_rm_list list = { .nr =0 }; +struct mptcp_rm_list list = { .nr =1 };long s_slot =0 , s_num =0 ;struct mptcp_sock *msk;pr_debug ("remove_id=%d\n" , addr->id); - list.ids[list.nr++] = addr->id; -while ((msk =mptcp_token_iter_next (net, &s_slot, &s_num)) !=NULL ) {struct sock *sk = (struct sock *)msk;bool remove_subflow;
@@ -1565,6 +1564,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,mptcp_pm_remove_anno_addr (msk, addr, remove_subflow && !(entry->flags &MPTCP_PM_ADDR_FLAG_IMPLICIT )); + list.ids[0 ] =mptcp_endp_get_local_id (msk, addr);if (remove_subflow) {spin_lock_bh (&msk->pm.lock);mptcp_pm_nl_rm_subflow_received (msk, &list);
@@ -1673,6 +1673,7 @@ static int mptcp_nl_cmd_del_addr(struct sk_buff *skb, struct genl_info *info)return ret; } +/* Called from the userspace PM only */ void mptcp_pm_remove_addrs (struct mptcp_sock *msk,struct list_head *rm_list) {struct mptcp_rm_list alist = { .nr =0 };
@@ -1701,6 +1702,7 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list) } } +/* Called from the in-kernel PM only */ static void mptcp_pm_remove_addrs_and_subflows (struct mptcp_sock *msk,struct list_head *rm_list) {
@@ -1710,11 +1712,11 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,list_for_each_entry (entry, rm_list, list) {if (slist.nr <MPTCP_RM_IDS_MAX &&lookup_subflow_by_saddr (&msk->conn_list, &entry->addr)) - slist.ids[slist.nr++] = entry->addr.id; + slist.ids[slist.nr++] =mptcp_endp_get_local_id (msk, &entry->addr);if (alist.nr <MPTCP_RM_IDS_MAX &&remove_anno_list_by_saddr (msk, &entry->addr)) - alist.ids[alist.nr++] = entry->addr.id; + alist.ids[alist.nr++] =mptcp_endp_get_local_id (msk, &entry->addr); }spin_lock_bh (&msk->pm.lock);
@@ -2002,7 +2004,7 @@ static void mptcp_pm_nl_fullmesh(struct mptcp_sock *msk, {struct mptcp_rm_list list = { .nr =0 }; - list.ids[list.nr++] = addr->id; + list.ids[list.nr++] =mptcp_endp_get_local_id (msk, addr);spin_lock_bh (&msk->pm.lock);mptcp_pm_nl_rm_subflow_received (msk, &list);
Signature · 1 line
2.45.2