Squash-to: "mptcp: remove addr and subflow in PM netlink v9"
Subsystems (2)
Geliang Tang
v3 cover Squash-to: "mptcp: remove addr and subflow in PM netlink v9"
v3:
- use "goto next" in mptcp_nl_remove_subflow_and_signal_addr
- update mptcp_destroy_common
v2:
- add mptcp_pm_remove_anno_addr and update logic in mptcp_nl_remove_subflow_and_signal_addr
- call mptcp_pm_free_anno_list in mptcp_destroy and mptcp_sock_destruct
- add mptcp_destroy_common helper
Geliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: add mptcp_destroy_common helper
net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.1
Geliang Tang
PATCH v3 1/2 Squash-to: "mptcp: remove addr and subflow in PM netlink"
Commit message should be rewritten entirely:
'''
This patch implements the remove announced addr and subflow logic in PM netlink.
When the PM netlink removes an address, we traverse all the existing msk sockets to find the relevant sockets.
We add a new list named anno_list in mptcp_pm_data, to record all the announced addrs. In the traversing, we check if it has been recorded. If it has been, we trigger the RM_ADDR signal.
We also check if this address is in conn_list. If it is, we remove the subflow which using this local address.
'''
--- net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 1 + net/mptcp/protocol.h | 2 + net/mptcp/subflow.c | 1 + 5 files changed, 90 insertions(+), 6 deletions(-)
net/mptcp/pm.c +1 -0
@@ -240,6 +240,7 @@ void mptcp_pm_data_init(struct mptcp_sock *msk) msk->pm.status =0 ;spin_lock_init (&msk->pm.lock); +INIT_LIST_HEAD (&msk->pm.anno_list);mptcp_pm_nl_data_init (msk); }
net/mptcp/pm_netlink.c +85 -6
120 lines not on this page · raw message
net/mptcp/protocol.c +1 -0
@@ -2162,6 +2162,7 @@ static void mptcp_destroy(struct sock *sk)if (msk->cached_ext)__skb_ext_put (msk->cached_ext); +mptcp_pm_free_anno_list (msk);sk_sockets_allocated_dec (sk); }
net/mptcp/protocol.h +2 -0
@@ -160,6 +160,7 @@ enum mptcp_pm_status {struct mptcp_pm_data {struct mptcp_addr_info local;struct mptcp_addr_info remote; +struct list_head anno_list;spinlock_t lock;/*protects the whole PM data */
@@ -441,6 +442,7 @@ void mptcp_pm_subflow_closed(struct mptcp_sock *msk, u8 id);void mptcp_pm_add_addr_received (struct mptcp_sock *msk,const struct mptcp_addr_info *addr);void mptcp_pm_rm_addr_received (struct mptcp_sock *msk,u8 rm_id); +void mptcp_pm_free_anno_list (struct mptcp_sock *msk); int mptcp_pm_announce_addr(struct mptcp_sock *msk, const struct mptcp_addr_info *addr,
net/mptcp/subflow.c +1 -0
@@ -437,6 +437,7 @@ static void mptcp_sock_destruct(struct sock *sk)skb_rbtree_purge (&mptcp_sk (sk)->out_of_order_queue);mptcp_token_destroy (mptcp_sk (sk)); +mptcp_pm_free_anno_list (mptcp_sk (sk));inet_sock_destruct (sk); }
Signature · 1 line
2.17.1
Geliang Tang
PATCH v3 2/2 mptcp: add mptcp_destroy_common helper
In reply to Geliang TangThis patch added a new helper named mptcp_destroy_common containing the shared code between mptcp_destroy() and mptcp_sock_destruct().
--- net/mptcp/protocol.c | 11 ++++++++--- net/mptcp/protocol.h | 1 + net/mptcp/subflow.c | 4 +--- 3 files changed, 10 insertions(+), 6 deletions(-)
net/mptcp/protocol.c +8 -3
@@ -2153,16 +2153,21 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,return newsk; } +void mptcp_destroy_common (struct mptcp_sock *msk) +{ +skb_rbtree_purge (&msk->out_of_order_queue); +mptcp_token_destroy (msk); +mptcp_pm_free_anno_list (msk); +} +static void mptcp_destroy (struct sock *sk) {struct mptcp_sock *msk =mptcp_sk (sk); -skb_rbtree_purge (&msk->out_of_order_queue); -mptcp_token_destroy (msk);if (msk->cached_ext)__skb_ext_put (msk->cached_ext); -mptcp_pm_free_anno_list (msk); +mptcp_destroy_common (msk);sk_sockets_allocated_dec (sk); }
net/mptcp/protocol.h +1 -0
@@ -408,6 +408,7 @@ bool mptcp_finish_join(struct sock *sk);void mptcp_data_acked (struct sock *sk);void mptcp_subflow_eof (struct sock *sk);bool mptcp_update_rcv_data_fin (struct mptcp_sock *msk,u64 data_fin_seq); +void mptcp_destroy_common (struct mptcp_sock *msk);void __init mptcp_token_init (void );static inline void mptcp_token_init_request (struct request_sock *req)
net/mptcp/subflow.c +1 -3
@@ -435,9 +435,7 @@ static void mptcp_sock_destruct(struct sock *sk)sock_orphan (sk); } -skb_rbtree_purge (&mptcp_sk (sk)->out_of_order_queue); -mptcp_token_destroy (mptcp_sk (sk)); -mptcp_pm_free_anno_list (mptcp_sk (sk)); +mptcp_destroy_common (mptcp_sk (sk));inet_sock_destruct (sk); }
Signature · 1 line
2.17.1
Paolo Abeni
Quoted 14 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelper
Quoted 7 lines
net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)
Both patches LGTM, thanks!
Paolo
Matthieu Baerts
Hi Geliang, Paolo,
Quoted 23 lines · Paolo Abeni
Quoted 14 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelperQuoted 7 lines
net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)
Quoted 1 line
Both patches LGTM, thanks!
Thank you for the patches and the review!
Just to be sure, can I squash the two of them in the same "mptcp: remove addr and subflow in PM netlink" commit? (+ update the commit message as written in 1/2 patch)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Geliang Tang
Hi Matt, Paolo,
Quoted 27 lines · Matthieu Baerts <matthieu.baerts(a)tessares.net> 于2020年9月16日周三 上午4:26写道:
Hi Geliang, Paolo,
Quoted 23 lines · Paolo Abeni
Quoted 21 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelpernet/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)
Quoted 7 lines
Quoted 1 line
Both patches LGTM, thanks!
Thank you for the patches and the review!
Just to be sure, can I squash the two of them in the same "mptcp: remove addr and subflow in PM netlink" commit? (+ update the commit message as written in 1/2 patch)
Please only squash 1/2 patch to "mptcp: remove addr and subflow in PM netlink" commit. And apply patch 2/2 (mptcp: add mptcp_destroy_common helper) as a new commit.
Thanks.
-Geliang
Quoted 6 lines
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Matthieu Baerts
Hi Geliang,
Quoted 34 lines · Geliang Tang
Hi Matt, Paolo,
Quoted 31 lines · Matthieu Baerts <matthieu.baerts(a)tessares.net> 于2020年9月16日周三 上午4:26写道:
Hi Geliang, Paolo,
Quoted 23 lines · Paolo Abeni
Quoted 14 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelperQuoted 7 lines
net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)Quoted 1 line
Both patches LGTM, thanks!
Thank you for the patches and the review!
Quoted 7 lines
Quoted 3 lines
Just to be sure, can I squash the two of them in the same "mptcp: remove addr and subflow in PM netlink" commit? (+ update the commit message as written in 1/2 patch)
Please only squash 1/2 patch to "mptcp: remove addr and subflow in PM netlink" commit. And apply patch 2/2 (mptcp: add
mptcp_destroy_commonhelper) as a new commit.
Thank you for the clarification.
- 96141df51494: "squashed" patch 1/2 in "mptcp: remove addr and subflow in PM netlink"
- 4c292fe817d5..79a312a49fee: result
The second patch has been added before your two commits modifying the selftests.
- 6d043d6c3dc2: mptcp: add mptcp_destroy_common helper
- c3f59bbd90df..653f02bb3161: result
Tests + export are in progress.
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Matthieu Baerts
Hi Geliang,
Quoted 55 lines · Matthieu Baerts
Hi Geliang,
Quoted 37 lines · Geliang Tang
Hi Matt, Paolo,
Matthieu Baerts <matthieu.baerts(a)tessares.net> 于2020年9月16日周三 上
Quoted 33 lines · 午4:26写道:
Hi Geliang, Paolo,
Quoted 25 lines · Paolo Abeni
Quoted 15 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelperQuoted 8 lines
net/mptcp/pm.c | 1 +
net/mptcp/pm_netlink.c| 91
+++++++++++++++++++++++++++++++++++++++---
net/mptcp/protocol.c | 10 ++++-
net/mptcp/protocol.h | 3 ++
net/mptcp/subflow.c | 3 +-5 files changed, 98 insertions(+), 10 deletions(-)Quoted 1 line
Both patches LGTM, thanks!
Thank you for the patches and the review!
Quoted 8 lines
Quoted 3 lines
Just to be sure, can I squash the two of them in the same "mptcp: remove addr and subflow in PM netlink" commit? (+ update the commit message as written in 1/2 patch)
Please only squash 1/2 patch to "mptcp: remove addr and subflow in PM netlink"
commit. And apply patch 2/2 (mptcp: addmptcp_destroy_commonhelper) as a new commit.Thank you for the clarification.
-
96141df51494: "squashed" patch 1/2 in "mptcp: remove addr and subflow in PM netlink"
-4c292fe817d5..79a312a49fee: result
Quoted 6 lines
The second patch has been added before your two commits modifying the selftests.
-6d043d6c3dc2: mptcp: addmptcp_destroy_commonhelper
-c3f59bbd90df..653f02bb3161: resultTests + export are in progress.
It looks like these two patches are causing a crash:
https://github.com/multipath-tcp/mptcp_net-next/issues/90
Sadly I always see that when I have to leave, I didn't investigate more so far nor removing the two patches.
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Geliang Tang
Hi Matt,
Quoted 64 lines · Matthieu Baerts <matthieu.baerts(a)tessares.net> 于2020年9月17日周四 上午12:10写道:
Hi Geliang,
Quoted 60 lines · Matthieu Baerts
Hi Geliang,
Quoted 37 lines · Geliang Tang
Hi Matt, Paolo,
Matthieu Baerts <matthieu.baerts(a)tessares.net> 于2020年9月16日周三 上
Quoted 33 lines · 午4:26写道:
Hi Geliang, Paolo,
Quoted 25 lines · Paolo Abeni
Quoted 15 lines · Geliang Tang
v3:
- use "goto next" inmptcp_nl_remove_subflow_and_signal_addr
- updatemptcp_destroy_commonv2:
- addmptcp_pm_remove_anno_addrand update logic inmptcp_nl_remove_subflow_and_signal_addr
- callmptcp_pm_free_anno_listinmptcp_destroyandmptcp_sock_destruct
- addmptcp_destroy_commonhelperGeliang Tang (2):
Squash-to: "mptcp: remove addr and subflow in PM netlink"
mptcp: addmptcp_destroy_commonhelperQuoted 8 lines
net/mptcp/pm.c | 1 + net/mptcp/pm_netlink.c | 91 +++++++++++++++++++++++++++++++++++++++--- net/mptcp/protocol.c | 10 ++++- net/mptcp/protocol.h | 3 ++ net/mptcp/subflow.c | 3 +- 5 files changed, 98 insertions(+), 10 deletions(-)Quoted 1 line
Both patches LGTM, thanks!
Thank you for the patches and the review!
Quoted 8 lines
Quoted 3 lines
Just to be sure, can I squash the two of them in the same "mptcp: remove addr and subflow in PM netlink" commit? (+ update the commit message as written in 1/2 patch)
Please only squash 1/2 patch to "mptcp: remove addr and subflow in PM netlink"
commit. And apply patch 2/2 (mptcp: addmptcp_destroy_commonhelper) as a new commit.Thank you for the clarification.
-
96141df51494: "squashed" patch 1/2 in "mptcp: remove addr and subflow in PM netlink"
-4c292fe817d5..79a312a49fee: resultThe second patch has been added before your two commits modifying the selftests.
-6d043d6c3dc2: mptcp: addmptcp_destroy_commonhelper
-c3f59bbd90df..653f02bb3161: result
Quoted 8 lines
Quoted 1 line
Tests + export are in progress.
It looks like these two patches are causing a crash:
https://github.com/multipath-tcp/mptcp_net-next/issues/90
Sadly I always see that when I have to leave, I didn't investigate more so far nor removing the two patches.
Sorry. I have just sent out a patch named (Squash-to: "mptcp: remove addr and subflow in PM netlink v9" Part 2) to fix this bug.
Thanks.
-Geliang
Quoted 6 lines
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net