* [PATCH net 00/15] mptcp: more fixes for the in-kernel PM
@ 2024-08-26 15:58 Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 01/15] mptcp: pm: reuse ID 0 after delete and re-add Matthieu Baerts (NGI0)
` (15 more replies)
0 siblings, 16 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:58 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable, Arınç ÜNAL, syzbot+455d38ecd5f655fc45cf
Here is a new batch of fixes for the MPTCP in-kernel path-manager:
Patch 1 ensures the address ID is set to 0 when the path-manager sends
an ADD_ADDR for the address of the initial subflow. The same fix is
applied when a new subflow is created re-using this special address. A
fix for v6.0.
Patch 2 is similar, but for the case where an endpoint is removed: if
this endpoint was used for the initial address, it is important to send
a RM_ADDR with this ID set to 0, and look for existing subflows with the
ID set to 0. A fix for v6.0 as well.
Patch 3 validates the two previous patches.
Patch 4 makes the PM selecting an "active" path to send an address
notification in an ACK, instead of taking the first path in the list. A
fix for v5.11.
Patch 5 fixes skipping the establishment of a new subflow if a previous
subflow using the same pair of addresses is being closed. A fix for
v5.13.
Patch 6 resets the ID linked to the initial subflow when the linked
endpoint is re-added, possibly with a different ID. A fix for v6.0.
Patch 7 validates the three previous patches.
Patch 8 is a small fix for the MPTCP Join selftest, when being used with
older subflows not supporting all MIB counters. A fix for a commit
introduced in v6.4, but backported up to v5.10.
Patch 9 avoids the PM to try to close the initial subflow multiple
times, and increment counters while nothing happened. A fix for v5.10.
Patch 10 stops incrementing local_addr_used and add_addr_accepted
counters when dealing with the address ID 0, because these counters are
not taking into account the initial subflow, and are then not
decremented when the linked addresses are removed. A fix for v6.0.
Patch 11 validates the previous patch.
Patch 12 avoids the PM to send multiple SUB_CLOSED events for the
initial subflow. A fix for v5.12.
Patch 13 validates the previous patch.
Patch 14 stops treating the ADD_ADDR 0 as a new address, and accepts it
in order to re-create the initial subflow if it has been closed, even if
the limit for *new* addresses -- not taking into account the address of
the initial subflow -- has been reached. A fix for v5.10.
Patch 15 validates the previous patch.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (15):
mptcp: pm: reuse ID 0 after delete and re-add
mptcp: pm: fix RM_ADDR ID for the initial subflow
selftests: mptcp: join: check removing ID 0 endpoint
mptcp: pm: send ACK on an active subflow
mptcp: pm: skip connecting to already established sf
mptcp: pm: reset MPC endp ID when re-added
selftests: mptcp: join: check re-adding init endp with != id
selftests: mptcp: join: no extra msg if no counter
mptcp: pm: do not remove already closed subflows
mptcp: pm: fix ID 0 endp usage after multiple re-creations
selftests: mptcp: join: check re-re-adding ID 0 endp
mptcp: avoid duplicated SUB_CLOSED events
selftests: mptcp: join: validate event numbers
mptcp: pm: ADD_ADDR 0 is not a new address
selftests: mptcp: join: check re-re-adding ID 0 signal
net/mptcp/pm.c | 4 +-
net/mptcp/pm_netlink.c | 87 ++++++++++----
net/mptcp/protocol.c | 6 +
net/mptcp/protocol.h | 5 +-
tools/testing/selftests/net/mptcp/mptcp_join.sh | 149 ++++++++++++++++++++----
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 +
6 files changed, 207 insertions(+), 48 deletions(-)
---
base-commit: 8af174ea863c72f25ce31cee3baad8a301c0cf0f
change-id: 20240826-net-mptcp-more-pm-fix-ffa61a36f817
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH net 01/15] mptcp: pm: reuse ID 0 after delete and re-add
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 02/15] mptcp: pm: fix RM_ADDR ID for the initial subflow Matthieu Baerts (NGI0)
` (14 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
When the endpoint used by the initial subflow is removed and re-added
later, the PM has to force the ID 0, it is a special case imposed by the
MPTCP specs.
Note that the endpoint should then need to be re-added reusing the same
ID.
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 3e4ad801786f..9ee68ab4665e 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -585,6 +585,11 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
__clear_bit(local.addr.id, msk->pm.id_avail_bitmap);
msk->pm.add_addr_signaled++;
+
+ /* Special case for ID0: set the correct ID */
+ if (local.addr.id == msk->mpc_endpoint_id)
+ local.addr.id = 0;
+
mptcp_pm_announce_addr(msk, &local.addr, false);
mptcp_pm_nl_addr_send_ack(msk);
@@ -609,6 +614,11 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
msk->pm.local_addr_used++;
__clear_bit(local.addr.id, msk->pm.id_avail_bitmap);
+
+ /* Special case for ID0: set the correct ID */
+ if (local.addr.id == msk->mpc_endpoint_id)
+ local.addr.id = 0;
+
nr = fill_remote_addresses_vec(msk, &local.addr, fullmesh, addrs);
if (nr == 0)
continue;
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 02/15] mptcp: pm: fix RM_ADDR ID for the initial subflow
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 01/15] mptcp: pm: reuse ID 0 after delete and re-add Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 03/15] selftests: mptcp: join: check removing ID 0 endpoint Matthieu Baerts (NGI0)
` (13 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
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().
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 9ee68ab4665e..042cd65d974a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -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",
@@ -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", 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);
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 03/15] selftests: mptcp: join: check removing ID 0 endpoint
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 01/15] mptcp: pm: reuse ID 0 after delete and re-add Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 02/15] mptcp: pm: fix RM_ADDR ID for the initial subflow Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 04/15] mptcp: pm: send ACK on an active subflow Matthieu Baerts (NGI0)
` (12 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
Removing the endpoint linked to the initial subflow should trigger a
RM_ADDR for the right ID, and the removal of the subflow. That's what is
now being verified in the "delete and re-add" test.
Note that removing the initial subflow will not decrement the 'subflows'
counters, which corresponds to the *additional* subflows. On the other
hand, when the same endpoint is re-added, it will increment this
counter, as it will be seen as an additional subflow this time.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 89e553e0e0c2..d2dd48a539c5 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3575,8 +3575,9 @@ endpoint_tests()
if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
- pm_nl_set_limits $ns1 0 2
- pm_nl_set_limits $ns2 0 2
+ pm_nl_set_limits $ns1 0 3
+ pm_nl_set_limits $ns2 0 3
+ pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
test_linkfail=4 speed=20 \
run_tests $ns1 $ns2 10.0.1.1 &
@@ -3585,17 +3586,17 @@ endpoint_tests()
wait_mpj $ns2
pm_nl_check_endpoint "creation" \
$ns2 10.0.2.2 id 2 flags subflow dev ns2eth2
- chk_subflow_nr "before delete" 2
+ chk_subflow_nr "before delete id 2" 2
chk_mptcp_info subflows 1 subflows 1
pm_nl_del_endpoint $ns2 2 10.0.2.2
sleep 0.5
- chk_subflow_nr "after delete" 1
+ chk_subflow_nr "after delete id 2" 1
chk_mptcp_info subflows 0 subflows 0
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
wait_mpj $ns2
- chk_subflow_nr "after re-add" 2
+ chk_subflow_nr "after re-add id 2" 2
chk_mptcp_info subflows 1 subflows 1
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
@@ -3610,10 +3611,20 @@ endpoint_tests()
chk_subflow_nr "after no reject" 3
chk_mptcp_info subflows 2 subflows 2
+ pm_nl_del_endpoint $ns2 1 10.0.1.2
+ sleep 0.5
+ chk_subflow_nr "after delete id 0" 2
+ chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf
+
+ pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
+ wait_mpj $ns2
+ chk_subflow_nr "after re-add id 0" 3
+ chk_mptcp_info subflows 3 subflows 3
+
mptcp_lib_kill_wait $tests_pid
- chk_join_nr 3 3 3
- chk_rm_nr 1 1
+ chk_join_nr 4 4 4
+ chk_rm_nr 2 2
fi
# remove and re-add
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 04/15] mptcp: pm: send ACK on an active subflow
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (2 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 03/15] selftests: mptcp: join: check removing ID 0 endpoint Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 05/15] mptcp: pm: skip connecting to already established sf Matthieu Baerts (NGI0)
` (11 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
Taking the first one on the list doesn't work in some cases, e.g. if the
initial subflow is being removed. Pick another one instead of not
sending anything.
Fixes: 84dfe3677a6f ("mptcp: send out dedicated ADD_ADDR packet")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 042cd65d974a..380647f7bc33 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -765,9 +765,12 @@ void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk)
!mptcp_pm_should_rm_signal(msk))
return;
- subflow = list_first_entry_or_null(&msk->conn_list, typeof(*subflow), node);
- if (subflow)
- mptcp_pm_send_ack(msk, subflow, false, false);
+ mptcp_for_each_subflow(msk, subflow) {
+ if (__mptcp_subflow_active(subflow)) {
+ mptcp_pm_send_ack(msk, subflow, false, false);
+ break;
+ }
+ }
}
int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 05/15] mptcp: pm: skip connecting to already established sf
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (3 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 04/15] mptcp: pm: send ACK on an active subflow Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 06/15] mptcp: pm: reset MPC endp ID when re-added Matthieu Baerts (NGI0)
` (10 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
The lookup_subflow_by_daddr() helper checks if there is already a
subflow connected to this address. But there could be a subflow that is
closing, but taking time due to some reasons: latency, losses, data to
process, etc.
If an ADD_ADDR is received while the endpoint is being closed, it is
better to try connecting to it, instead of rejecting it: the peer which
has sent the ADD_ADDR will not be notified that the ADD_ADDR has been
rejected for this reason, and the expected subflow will not be created
at the end.
This helper should then only look for subflows that are established, or
going to be, but not the ones being closed.
Fixes: d84ad04941c3 ("mptcp: skip connecting the connected address")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 380647f7bc33..0c91d961f51f 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -130,12 +130,15 @@ static bool lookup_subflow_by_daddr(const struct list_head *list,
{
struct mptcp_subflow_context *subflow;
struct mptcp_addr_info cur;
- struct sock_common *skc;
list_for_each_entry(subflow, list, node) {
- skc = (struct sock_common *)mptcp_subflow_tcp_sock(subflow);
+ struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
- remote_address(skc, &cur);
+ if (!((1 << inet_sk_state_load(ssk)) &
+ (TCPF_ESTABLISHED | TCPF_SYN_SENT | TCPF_SYN_RECV)))
+ continue;
+
+ remote_address((struct sock_common *)ssk, &cur);
if (mptcp_addresses_equal(&cur, daddr, daddr->port))
return true;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 06/15] mptcp: pm: reset MPC endp ID when re-added
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (4 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 05/15] mptcp: pm: skip connecting to already established sf Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 07/15] selftests: mptcp: join: check re-adding init endp with != id Matthieu Baerts (NGI0)
` (9 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
The initial subflow has a special local ID: 0. It is specific per
connection.
When a global endpoint is deleted and re-added later, it can have a
different ID -- most services managing the endpoints automatically don't
force the ID to be the same as before. It is then important to track
these modifications to be consistent with the ID being used for the
address used by the initial subflow, not to confuse the other peer or to
send the ID 0 for the wrong address.
Now when removing an endpoint, msk->mpc_endpoint_id is reset if it
corresponds to this endpoint. When adding a new endpoint, the same
variable is updated if the address match the one of the initial subflow.
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 0c91d961f51f..75c8aede7026 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1318,20 +1318,27 @@ static struct pm_nl_pernet *genl_info_pm_nl(struct genl_info *info)
return pm_nl_get_pernet(genl_info_net(info));
}
-static int mptcp_nl_add_subflow_or_signal_addr(struct net *net)
+static int mptcp_nl_add_subflow_or_signal_addr(struct net *net,
+ struct mptcp_addr_info *addr)
{
struct mptcp_sock *msk;
long s_slot = 0, s_num = 0;
while ((msk = mptcp_token_iter_next(net, &s_slot, &s_num)) != NULL) {
struct sock *sk = (struct sock *)msk;
+ struct mptcp_addr_info mpc_addr;
if (!READ_ONCE(msk->fully_established) ||
mptcp_pm_is_userspace(msk))
goto next;
+ /* if the endp linked to the init sf is re-added with a != ID */
+ mptcp_local_address((struct sock_common *)msk, &mpc_addr);
+
lock_sock(sk);
spin_lock_bh(&msk->pm.lock);
+ if (mptcp_addresses_equal(addr, &mpc_addr, addr->port))
+ msk->mpc_endpoint_id = addr->id;
mptcp_pm_create_subflow_or_signal_addr(msk);
spin_unlock_bh(&msk->pm.lock);
release_sock(sk);
@@ -1404,7 +1411,7 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info)
goto out_free;
}
- mptcp_nl_add_subflow_or_signal_addr(sock_net(skb->sk));
+ mptcp_nl_add_subflow_or_signal_addr(sock_net(skb->sk), &entry->addr);
return 0;
out_free:
@@ -1525,6 +1532,8 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
spin_unlock_bh(&msk->pm.lock);
}
+ if (msk->mpc_endpoint_id == entry->addr.id)
+ msk->mpc_endpoint_id = 0;
release_sock(sk);
next:
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 07/15] selftests: mptcp: join: check re-adding init endp with != id
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (5 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 06/15] mptcp: pm: reset MPC endp ID when re-added Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 08/15] selftests: mptcp: join: no extra msg if no counter Matthieu Baerts (NGI0)
` (8 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
The initial subflow has a special local ID: 0. It is specific per
connection.
When a global endpoint is deleted and re-added later, it can have a
different ID, but the kernel should still use the ID 0 if it corresponds
to the initial address.
This test validates this behaviour: the endpoint linked to the initial
subflow is removed, and re-added with a different ID.
Note that removing the initial subflow will not decrement the 'subflows'
counters, which corresponds to the *additional* subflows. On the other
hand, when the same endpoint is re-added, it will increment this
counter, as it will be seen as an additional subflow this time.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index d2dd48a539c5..0fd4bd609565 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3630,11 +3630,12 @@ endpoint_tests()
# remove and re-add
if reset "delete re-add signal" &&
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
- pm_nl_set_limits $ns1 0 2
- pm_nl_set_limits $ns2 2 2
+ pm_nl_set_limits $ns1 0 3
+ pm_nl_set_limits $ns2 3 3
pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
# broadcast IP: no packet for this address will be received on ns1
pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal
+ pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal
test_linkfail=4 speed=20 \
run_tests $ns1 $ns2 10.0.1.1 &
local tests_pid=$!
@@ -3656,11 +3657,21 @@ endpoint_tests()
wait_mpj $ns2
chk_subflow_nr "after re-add" 3
chk_mptcp_info subflows 2 subflows 2
+
+ pm_nl_del_endpoint $ns1 42 10.0.1.1
+ sleep 0.5
+ chk_subflow_nr "after delete ID 0" 2
+ chk_mptcp_info subflows 2 subflows 2
+
+ pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
+ wait_mpj $ns2
+ chk_subflow_nr "after re-add" 3
+ chk_mptcp_info subflows 3 subflows 3
mptcp_lib_kill_wait $tests_pid
- chk_join_nr 3 3 3
- chk_add_nr 4 4
- chk_rm_nr 2 1 invert
+ chk_join_nr 4 4 4
+ chk_add_nr 5 5
+ chk_rm_nr 3 2 invert
fi
# flush and re-add
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 08/15] selftests: mptcp: join: no extra msg if no counter
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (6 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 07/15] selftests: mptcp: join: check re-adding init endp with != id Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 09/15] mptcp: pm: do not remove already closed subflows Matthieu Baerts (NGI0)
` (7 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
The checksum and fail counters might not be available. Then no need to
display an extra message with missing info.
While at it, fix the indentation around, which is wrong since the same
commit.
Fixes: 47867f0a7e83 ("selftests: mptcp: join: skip check if MIB counter not supported")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 0fd4bd609565..0ffa6f6b04e2 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1112,26 +1112,26 @@ chk_csum_nr()
print_check "sum"
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtDataCsumErr")
- if [ "$count" != "$csum_ns1" ]; then
+ if [ -n "$count" ] && [ "$count" != "$csum_ns1" ]; then
extra_msg+=" ns1=$count"
fi
if [ -z "$count" ]; then
print_skip
elif { [ "$count" != $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 0 ]; } ||
- { [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
+ { [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
fail_test "got $count data checksum error[s] expected $csum_ns1"
else
print_ok
fi
print_check "csum"
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtDataCsumErr")
- if [ "$count" != "$csum_ns2" ]; then
+ if [ -n "$count" ] && [ "$count" != "$csum_ns2" ]; then
extra_msg+=" ns2=$count"
fi
if [ -z "$count" ]; then
print_skip
elif { [ "$count" != $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 0 ]; } ||
- { [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
+ { [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
fail_test "got $count data checksum error[s] expected $csum_ns2"
else
print_ok
@@ -1169,13 +1169,13 @@ chk_fail_nr()
print_check "ftx"
count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx")
- if [ "$count" != "$fail_tx" ]; then
+ if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then
extra_msg+=",tx=$count"
fi
if [ -z "$count" ]; then
print_skip
elif { [ "$count" != "$fail_tx" ] && [ $allow_tx_lost -eq 0 ]; } ||
- { [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
+ { [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
fail_test "got $count MP_FAIL[s] TX expected $fail_tx"
else
print_ok
@@ -1183,13 +1183,13 @@ chk_fail_nr()
print_check "failrx"
count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx")
- if [ "$count" != "$fail_rx" ]; then
+ if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then
extra_msg+=",rx=$count"
fi
if [ -z "$count" ]; then
print_skip
elif { [ "$count" != "$fail_rx" ] && [ $allow_rx_lost -eq 0 ]; } ||
- { [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
+ { [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
fail_test "got $count MP_FAIL[s] RX expected $fail_rx"
else
print_ok
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 09/15] mptcp: pm: do not remove already closed subflows
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (7 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 08/15] selftests: mptcp: join: no extra msg if no counter Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 10/15] mptcp: pm: fix ID 0 endp usage after multiple re-creations Matthieu Baerts (NGI0)
` (6 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
It is possible to have in the list already closed subflows, e.g. the
initial subflow has been already closed, but still in the list. No need
to try to close it again, and increments the related counters again.
Fixes: 0ee4261a3681 ("mptcp: implement mptcp_pm_remove_subflow")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 75c8aede7026..90b7c8b45027 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -838,6 +838,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
int how = RCV_SHUTDOWN | SEND_SHUTDOWN;
u8 id = subflow_get_local_id(subflow);
+ if (inet_sk_state_load(ssk) == TCP_CLOSE)
+ continue;
if (rm_type == MPTCP_MIB_RMADDR && remote_id != rm_id)
continue;
if (rm_type == MPTCP_MIB_RMSUBFLOW && id != rm_id)
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 10/15] mptcp: pm: fix ID 0 endp usage after multiple re-creations
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (8 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 09/15] mptcp: pm: do not remove already closed subflows Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 11/15] selftests: mptcp: join: check re-re-adding ID 0 endp Matthieu Baerts (NGI0)
` (5 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
Arınç ÜNAL, syzbot+455d38ecd5f655fc45cf, stable
'local_addr_used' and 'add_addr_accepted' are decremented for addresses
not related to the initial subflow (ID0), because the source and
destination addresses of the initial subflows are known from the
beginning: they don't count as "additional local address being used" or
"ADD_ADDR being accepted".
It is then required not to increment them when the entrypoint used by
the initial subflow is removed and re-added during a connection. Without
this modification, this entrypoint cannot be removed and re-added more
than once.
Reported-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/512
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Reported-by: syzbot+455d38ecd5f655fc45cf@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/00000000000049861306209237f4@google.com
Cc: stable@vger.kernel.org
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 90b7c8b45027..591ae2ffb4dd 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -615,12 +615,13 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
fullmesh = !!(local.flags & MPTCP_PM_ADDR_FLAG_FULLMESH);
- msk->pm.local_addr_used++;
__clear_bit(local.addr.id, msk->pm.id_avail_bitmap);
/* Special case for ID0: set the correct ID */
if (local.addr.id == msk->mpc_endpoint_id)
local.addr.id = 0;
+ else /* local_addr_used is not decr for ID 0 */
+ msk->pm.local_addr_used++;
nr = fill_remote_addresses_vec(msk, &local.addr, fullmesh, addrs);
if (nr == 0)
@@ -750,7 +751,9 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
spin_lock_bh(&msk->pm.lock);
if (sf_created) {
- msk->pm.add_addr_accepted++;
+ /* add_addr_accepted is not decr for ID 0 */
+ if (remote.id)
+ msk->pm.add_addr_accepted++;
if (msk->pm.add_addr_accepted >= add_addr_accept_max ||
msk->pm.subflows >= subflows_max)
WRITE_ONCE(msk->pm.accept_addr, false);
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 11/15] selftests: mptcp: join: check re-re-adding ID 0 endp
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (9 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 10/15] mptcp: pm: fix ID 0 endp usage after multiple re-creations Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 12/15] mptcp: avoid duplicated SUB_CLOSED events Matthieu Baerts (NGI0)
` (4 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
This test extends "delete and re-add" to validate the previous commit:
when the endpoint linked to the initial subflow (ID 0) is re-added
multiple times, it was no longer being used, because the internal linked
counters are not decremented for this special endpoint: it is not an
additional endpoint.
Here, the "del/add id 0" steps are done 3 times to unsure this case is
validated.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 0ffa6f6b04e2..7708ac99ccb6 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3611,20 +3611,23 @@ endpoint_tests()
chk_subflow_nr "after no reject" 3
chk_mptcp_info subflows 2 subflows 2
- pm_nl_del_endpoint $ns2 1 10.0.1.2
- sleep 0.5
- chk_subflow_nr "after delete id 0" 2
- chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf
+ local i
+ for i in $(seq 3); do
+ pm_nl_del_endpoint $ns2 1 10.0.1.2
+ sleep 0.5
+ chk_subflow_nr "after delete id 0 ($i)" 2
+ chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf
- pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
- wait_mpj $ns2
- chk_subflow_nr "after re-add id 0" 3
- chk_mptcp_info subflows 3 subflows 3
+ pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
+ wait_mpj $ns2
+ chk_subflow_nr "after re-add id 0 ($i)" 3
+ chk_mptcp_info subflows 3 subflows 3
+ done
mptcp_lib_kill_wait $tests_pid
- chk_join_nr 4 4 4
- chk_rm_nr 2 2
+ chk_join_nr 6 6 6
+ chk_rm_nr 4 4
fi
# remove and re-add
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 12/15] mptcp: avoid duplicated SUB_CLOSED events
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (10 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 11/15] selftests: mptcp: join: check re-re-adding ID 0 endp Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 13/15] selftests: mptcp: join: validate event numbers Matthieu Baerts (NGI0)
` (3 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable, Arınç ÜNAL
The initial subflow might have already been closed, but still in the
connection list. When the worker is instructed to close the subflows
that have been marked as closed, it might then try to close the initial
subflow again.
A consequence of that is that the SUB_CLOSED event can be seen twice:
# ip mptcp endpoint
1.1.1.1 id 1 subflow dev eth0
2.2.2.2 id 2 subflow dev eth1
# ip mptcp monitor &
[ CREATED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
[ ESTABLISHED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
[ SF_ESTABLISHED] remid=0 locid=2 saddr4=2.2.2.2 daddr4=9.9.9.9
# ip mptcp endpoint delete id 1
[ SF_CLOSED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
[ SF_CLOSED] remid=0 locid=0 saddr4=1.1.1.1 daddr4=9.9.9.9
The first one is coming from mptcp_pm_nl_rm_subflow_received(), and the
second one from __mptcp_close_subflow().
To avoid doing the post-closed processing twice, the subflow is now
marked as closed the first time.
Note that it is not enough to check if we are dealing with the first
subflow and check its sk_state: the subflow might have been reset or
closed before calling mptcp_close_ssk().
Fixes: b911c97c7dc7 ("mptcp: add netlink event support")
Cc: stable@vger.kernel.org
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 6 ++++++
net/mptcp/protocol.h | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 0d536b183a6c..931172382aa0 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2508,6 +2508,12 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
void mptcp_close_ssk(struct sock *sk, struct sock *ssk,
struct mptcp_subflow_context *subflow)
{
+ /* The first subflow can already be closed and still in the list */
+ if (subflow->close_event_done)
+ return;
+
+ subflow->close_event_done = true;
+
if (sk->sk_state == TCP_ESTABLISHED)
mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL);
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index a1c1b0ff1ce1..7e934ce0e4ff 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -524,7 +524,8 @@ struct mptcp_subflow_context {
stale : 1, /* unable to snd/rcv data, do not use for xmit */
valid_csum_seen : 1, /* at least one csum validated */
is_mptfo : 1, /* subflow is doing TFO */
- __unused : 10;
+ close_event_done : 1, /* has done the post-closed part */
+ __unused : 9;
bool data_avail;
bool scheduled;
u32 remote_nonce;
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 13/15] selftests: mptcp: join: validate event numbers
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (11 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 12/15] mptcp: avoid duplicated SUB_CLOSED events Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 14/15] mptcp: pm: ADD_ADDR 0 is not a new address Matthieu Baerts (NGI0)
` (2 subsequent siblings)
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
This test extends "delete and re-add" and "delete re-add signal" to
validate the previous commit: the number of MPTCP events are checked to
make sure there are no duplicated or unexpected ones.
A new helper has been introduced to easily check these events. The
missing events have been added to the lib.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: b911c97c7dc7 ("mptcp: add netlink event support")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 74 ++++++++++++++++++++++++-
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 ++
2 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 7708ac99ccb6..597bf928e8f9 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -420,12 +420,17 @@ reset_with_fail()
fi
}
+start_events()
+{
+ mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid
+ mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid
+}
+
reset_with_events()
{
reset "${1}" || return 1
- mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid
- mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid
+ start_events
}
reset_with_tcp_filter()
@@ -3333,6 +3338,36 @@ userspace_pm_chk_get_addr()
fi
}
+# $1: ns ; $2: event type ; $3: count
+chk_evt_nr()
+{
+ local ns=${1}
+ local evt_name="${2}"
+ local exp="${3}"
+
+ local evts="${evts_ns1}"
+ local evt="${!evt_name}"
+ local count
+
+ evt_name="${evt_name:16}" # without MPTCP_LIB_EVENT_
+ [ "${ns}" == "ns2" ] && evts="${evts_ns2}"
+
+ print_check "event ${ns} ${evt_name} (${exp})"
+
+ if [[ "${evt_name}" = "LISTENER_"* ]] &&
+ ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then
+ print_skip "event not supported"
+ return
+ fi
+
+ count=$(grep -cw "type:${evt}" "${evts}")
+ if [ "${count}" != "${exp}" ]; then
+ fail_test "got ${count} events, expected ${exp}"
+ else
+ print_ok
+ fi
+}
+
userspace_tests()
{
# userspace pm type prevents add_addr
@@ -3575,6 +3610,7 @@ endpoint_tests()
if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+ start_events
pm_nl_set_limits $ns1 0 3
pm_nl_set_limits $ns2 0 3
pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
@@ -3626,12 +3662,28 @@ endpoint_tests()
mptcp_lib_kill_wait $tests_pid
+ kill_events_pids
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 4
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 4
+
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 0
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 0
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 5 # one has been closed before estab
+
chk_join_nr 6 6 6
chk_rm_nr 4 4
fi
# remove and re-add
- if reset "delete re-add signal" &&
+ if reset_with_events "delete re-add signal" &&
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
pm_nl_set_limits $ns1 0 3
pm_nl_set_limits $ns2 3 3
@@ -3672,6 +3724,22 @@ endpoint_tests()
chk_mptcp_info subflows 3 subflows 3
mptcp_lib_kill_wait $tests_pid
+ kill_events_pids
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2
+
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2
+
chk_join_nr 4 4 4
chk_add_nr 5 5
chk_rm_nr 3 2 invert
diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 438280e68434..4578a331041e 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -12,10 +12,14 @@ readonly KSFT_SKIP=4
readonly KSFT_TEST="${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}"
# These variables are used in some selftests, read-only
+declare -rx MPTCP_LIB_EVENT_CREATED=1 # MPTCP_EVENT_CREATED
+declare -rx MPTCP_LIB_EVENT_ESTABLISHED=2 # MPTCP_EVENT_ESTABLISHED
+declare -rx MPTCP_LIB_EVENT_CLOSED=3 # MPTCP_EVENT_CLOSED
declare -rx MPTCP_LIB_EVENT_ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED
declare -rx MPTCP_LIB_EVENT_REMOVED=7 # MPTCP_EVENT_REMOVED
declare -rx MPTCP_LIB_EVENT_SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED
declare -rx MPTCP_LIB_EVENT_SUB_CLOSED=11 # MPTCP_EVENT_SUB_CLOSED
+declare -rx MPTCP_LIB_EVENT_SUB_PRIORITY=13 # MPTCP_EVENT_SUB_PRIORITY
declare -rx MPTCP_LIB_EVENT_LISTENER_CREATED=15 # MPTCP_EVENT_LISTENER_CREATED
declare -rx MPTCP_LIB_EVENT_LISTENER_CLOSED=16 # MPTCP_EVENT_LISTENER_CLOSED
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 14/15] mptcp: pm: ADD_ADDR 0 is not a new address
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (12 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 13/15] selftests: mptcp: join: validate event numbers Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 15/15] selftests: mptcp: join: check re-re-adding ID 0 signal Matthieu Baerts (NGI0)
2024-08-27 2:29 ` [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Jakub Kicinski
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
The ADD_ADDR 0 with the address from the initial subflow should not be
considered as a new address: this is not something new. If the host
receives it, it simply means that the address is available again.
When receiving an ADD_ADDR for the ID 0, the PM already doesn't consider
it as new by not incrementing the 'add_addr_accepted' counter. But the
'accept_addr' might not be set if the limit has already been reached:
this can be bypassed in this case. But before, it is important to check
that this ADD_ADDR for the ID 0 is for the same address as the initial
subflow. If not, it is not something that should happen, and the
ADD_ADDR can be ignored.
Note that if an ADD_ADDR is received while there is already a subflow
opened using the same address, this ADD_ADDR is ignored as well. It
means that if multiple ADD_ADDR for ID 0 are received, there will not be
any duplicated subflows created by the client.
Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm.c | 4 +++-
net/mptcp/pm_netlink.c | 9 +++++++++
net/mptcp/protocol.h | 2 ++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 3e6e0f5510bb..445a9b445971 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -226,7 +226,9 @@ void mptcp_pm_add_addr_received(const struct sock *ssk,
} else {
__MPTCP_INC_STATS(sock_net((struct sock *)msk), MPTCP_MIB_ADDADDRDROP);
}
- } else if (!READ_ONCE(pm->accept_addr)) {
+ /* id0 should not have a different address */
+ } else if ((addr->id == 0 && !mptcp_pm_nl_is_init_remote_addr(msk, addr)) ||
+ (addr->id > 0 && !READ_ONCE(pm->accept_addr))) {
mptcp_pm_announce_addr(msk, addr, true);
mptcp_pm_add_addr_send_ack(msk);
} else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED)) {
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 591ae2ffb4dd..b5ff78464950 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -760,6 +760,15 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
}
}
+bool mptcp_pm_nl_is_init_remote_addr(struct mptcp_sock *msk,
+ const struct mptcp_addr_info *remote)
+{
+ struct mptcp_addr_info mpc_remote;
+
+ remote_address((struct sock_common *)msk, &mpc_remote);
+ return mptcp_addresses_equal(&mpc_remote, remote, remote->port);
+}
+
void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 7e934ce0e4ff..b6100cc23cf4 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -993,6 +993,8 @@ void mptcp_pm_add_addr_received(const struct sock *ssk,
void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk,
const struct mptcp_addr_info *addr);
void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk);
+bool mptcp_pm_nl_is_init_remote_addr(struct mptcp_sock *msk,
+ const struct mptcp_addr_info *remote);
void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk);
void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,
const struct mptcp_rm_list *rm_list);
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH net 15/15] selftests: mptcp: join: check re-re-adding ID 0 signal
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (13 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 14/15] mptcp: pm: ADD_ADDR 0 is not a new address Matthieu Baerts (NGI0)
@ 2024-08-26 15:59 ` Matthieu Baerts (NGI0)
2024-08-27 2:29 ` [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Jakub Kicinski
15 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-26 15:59 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Shuah Khan, Florian Westphal
Cc: netdev, linux-kernel, linux-kselftest, Matthieu Baerts (NGI0),
stable
This test extends "delete re-add signal" to validate the previous
commit: when the 'signal' endpoint linked to the initial subflow (ID 0)
is re-added multiple times, it will re-send the ADD_ADDR with id 0. The
client should still be able to re-create this subflow, even if the
add_addr_accepted limit has been reached as this special address is not
considered as a new address.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++++++---------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 597bf928e8f9..47c89a16b6e1 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3720,7 +3720,17 @@ endpoint_tests()
pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
wait_mpj $ns2
- chk_subflow_nr "after re-add" 3
+ chk_subflow_nr "after re-add ID 0" 3
+ chk_mptcp_info subflows 3 subflows 3
+
+ pm_nl_del_endpoint $ns1 99 10.0.1.1
+ sleep 0.5
+ chk_subflow_nr "after re-delete ID 0" 2
+ chk_mptcp_info subflows 2 subflows 2
+
+ pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal
+ wait_mpj $ns2
+ chk_subflow_nr "after re-re-add ID 0" 3
chk_mptcp_info subflows 3 subflows 3
mptcp_lib_kill_wait $tests_pid
@@ -3730,19 +3740,19 @@ endpoint_tests()
chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0
chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0
- chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4
- chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5
+ chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 3
chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1
chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
- chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5
- chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3
- chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4
- chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 6
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 4
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5
+ chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3
- chk_join_nr 4 4 4
- chk_add_nr 5 5
- chk_rm_nr 3 2 invert
+ chk_join_nr 5 5 5
+ chk_add_nr 6 6
+ chk_rm_nr 4 3 invert
fi
# flush and re-add
--
2.45.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH net 00/15] mptcp: more fixes for the in-kernel PM
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
` (14 preceding siblings ...)
2024-08-26 15:59 ` [PATCH net 15/15] selftests: mptcp: join: check re-re-adding ID 0 signal Matthieu Baerts (NGI0)
@ 2024-08-27 2:29 ` Jakub Kicinski
2024-08-27 8:22 ` Matthieu Baerts
15 siblings, 1 reply; 18+ messages in thread
From: Jakub Kicinski @ 2024-08-27 2:29 UTC (permalink / raw)
To: Matthieu Baerts (NGI0)
Cc: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Paolo Abeni, Shuah Khan, Florian Westphal, netdev, linux-kernel,
linux-kselftest, stable, Arınç ÜNAL,
syzbot+455d38ecd5f655fc45cf
On Mon, 26 Aug 2024 17:58:59 +0200 Matthieu Baerts (NGI0) wrote:
> Matthieu Baerts (NGI0) (15):
> mptcp: pm: reuse ID 0 after delete and re-add
> mptcp: pm: fix RM_ADDR ID for the initial subflow
> selftests: mptcp: join: check removing ID 0 endpoint
> mptcp: pm: send ACK on an active subflow
> mptcp: pm: skip connecting to already established sf
> mptcp: pm: reset MPC endp ID when re-added
> selftests: mptcp: join: check re-adding init endp with != id
> selftests: mptcp: join: no extra msg if no counter
> mptcp: pm: do not remove already closed subflows
> mptcp: pm: fix ID 0 endp usage after multiple re-creations
> selftests: mptcp: join: check re-re-adding ID 0 endp
> mptcp: avoid duplicated SUB_CLOSED events
> selftests: mptcp: join: validate event numbers
> mptcp: pm: ADD_ADDR 0 is not a new address
> selftests: mptcp: join: check re-re-adding ID 0 signal
The debug runner is failing mptcp-join-sh fairly consistently with
these applied :(
--
pw-bot: cr
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net 00/15] mptcp: more fixes for the in-kernel PM
2024-08-27 2:29 ` [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Jakub Kicinski
@ 2024-08-27 8:22 ` Matthieu Baerts
0 siblings, 0 replies; 18+ messages in thread
From: Matthieu Baerts @ 2024-08-27 8:22 UTC (permalink / raw)
To: Jakub Kicinski
Cc: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Paolo Abeni, Shuah Khan, Florian Westphal, netdev, linux-kernel,
linux-kselftest, stable, Arınç ÜNAL,
syzbot+455d38ecd5f655fc45cf
Hi Jakub,
On 27/08/2024 04:29, Jakub Kicinski wrote:
> On Mon, 26 Aug 2024 17:58:59 +0200 Matthieu Baerts (NGI0) wrote:
>> Matthieu Baerts (NGI0) (15):
>> mptcp: pm: reuse ID 0 after delete and re-add
>> mptcp: pm: fix RM_ADDR ID for the initial subflow
>> selftests: mptcp: join: check removing ID 0 endpoint
>> mptcp: pm: send ACK on an active subflow
>> mptcp: pm: skip connecting to already established sf
>> mptcp: pm: reset MPC endp ID when re-added
>> selftests: mptcp: join: check re-adding init endp with != id
>> selftests: mptcp: join: no extra msg if no counter
>> mptcp: pm: do not remove already closed subflows
>> mptcp: pm: fix ID 0 endp usage after multiple re-creations
>> selftests: mptcp: join: check re-re-adding ID 0 endp
>> mptcp: avoid duplicated SUB_CLOSED events
>> selftests: mptcp: join: validate event numbers
>> mptcp: pm: ADD_ADDR 0 is not a new address
>> selftests: mptcp: join: check re-re-adding ID 0 signal
>
> The debug runner is failing mptcp-join-sh fairly consistently with
> these applied :(
Thank you for this notification!
It looks like the patch "selftests: mptcp: join: check re-re-adding ID 0
endp" is making the "delete and re-add" subtest longer: the connection
finishes while the validation is still ongoing. I guess I didn't see
this issue on my side, nor on MPTCP CI, because the Netdev CI is slower
(SLUB_DEBUG_ON?).
It is easy to fix, but I will wait for the other MPTCP series to be
applied, before sending a v2.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2024-08-27 8:22 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 15:58 [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 01/15] mptcp: pm: reuse ID 0 after delete and re-add Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 02/15] mptcp: pm: fix RM_ADDR ID for the initial subflow Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 03/15] selftests: mptcp: join: check removing ID 0 endpoint Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 04/15] mptcp: pm: send ACK on an active subflow Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 05/15] mptcp: pm: skip connecting to already established sf Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 06/15] mptcp: pm: reset MPC endp ID when re-added Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 07/15] selftests: mptcp: join: check re-adding init endp with != id Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 08/15] selftests: mptcp: join: no extra msg if no counter Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 09/15] mptcp: pm: do not remove already closed subflows Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 10/15] mptcp: pm: fix ID 0 endp usage after multiple re-creations Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 11/15] selftests: mptcp: join: check re-re-adding ID 0 endp Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 12/15] mptcp: avoid duplicated SUB_CLOSED events Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 13/15] selftests: mptcp: join: validate event numbers Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 14/15] mptcp: pm: ADD_ADDR 0 is not a new address Matthieu Baerts (NGI0)
2024-08-26 15:59 ` [PATCH net 15/15] selftests: mptcp: join: check re-re-adding ID 0 signal Matthieu Baerts (NGI0)
2024-08-27 2:29 ` [PATCH net 00/15] mptcp: more fixes for the in-kernel PM Jakub Kicinski
2024-08-27 8:22 ` Matthieu Baerts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).