* [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd
@ 2024-07-05 20:33 Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 1/4] mptcp: fix user-space PM announced address accounting Paolo Abeni
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-05 20:33 UTC (permalink / raw)
To: mptcp
Issues/501 showed that the NL PM currently don't add corectly removal
and re-add of signal endpoint.
Patches 1 and 2 addresses the issue, patch 3/4 introduce a related
self-test, and the last patch address a pre-existing buglet in the
self-test infra.
v1 -> v2:
- splitted the first 2 patches
- fixed accounting in mptcp_pm_remove_anno_addr
- self-tests depends on subflow_rebuild_header
Paolo Abeni (4):
mptcp: fix user-space PM announced address accounting
mptcp: fix NL PM announced address accounting
selftests: mptcp: add explicit test case for remove/readd
selftests: mptcp: fix error path
net/mptcp/pm_netlink.c | 27 +++++++++++-----
.../testing/selftests/net/mptcp/mptcp_join.sh | 31 ++++++++++++++++++-
2 files changed, 49 insertions(+), 9 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH mptcp-net v2 1/4] mptcp: fix user-space PM announced address accounting
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
@ 2024-07-05 20:33 ` Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 2/4] mptcp: fix NL " Paolo Abeni
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-05 20:33 UTC (permalink / raw)
To: mptcp
Currently the per-connection announced address counter is never
decreased. When the user-space PM is in use, this just affect
the information exposed via diag/sockopt, but it could still foul
the PM to wrong decision.
Add the missing accounting for the user-space PM's sake.
Fixes: 8b1c94da1e48 ("mptcp: only send RM_ADDR in nl_cmd_remove")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/mptcp/pm_netlink.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index ea9e5817b9e9..b399f2b7a369 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1534,16 +1534,25 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
{
struct mptcp_rm_list alist = { .nr = 0 };
struct mptcp_pm_addr_entry *entry;
+ int anno_nr = 0;
list_for_each_entry(entry, rm_list, list) {
- if ((remove_anno_list_by_saddr(msk, &entry->addr) ||
- lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) &&
- alist.nr < MPTCP_RM_IDS_MAX)
- alist.ids[alist.nr++] = entry->addr.id;
+ if (alist.nr >= MPTCP_RM_IDS_MAX)
+ break;
+
+ /* only delete if either announced or matching a subflow */
+ if (remove_anno_list_by_saddr(msk, &entry->addr))
+ anno_nr++;
+ else if (!lookup_subflow_by_saddr(&msk->conn_list,
+ &entry->addr))
+ continue;
+
+ alist.ids[alist.nr++] = entry->addr.id;
}
if (alist.nr) {
spin_lock_bh(&msk->pm.lock);
+ msk->pm.add_addr_signaled -= anno_nr;
mptcp_pm_remove_addr(msk, &alist);
spin_unlock_bh(&msk->pm.lock);
}
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH mptcp-net v2 2/4] mptcp: fix NL PM announced address accounting
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 1/4] mptcp: fix user-space PM announced address accounting Paolo Abeni
@ 2024-07-05 20:33 ` Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 3/4] selftests: mptcp: add explicit test case for remove/readd Paolo Abeni
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-05 20:33 UTC (permalink / raw)
To: mptcp
Currently the per connection announced address counter is never
decreased. As a consequence, after connection establishment, if
the NL PM deletes an endpoint and adds a new/different one, no
additional subflow is created for the new endpoint even if the
current limits allow that.
Address the issue properly updating the signaled address counter
every time the NL PM removes such addresses.
Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
v1 -> v2:
- fix accounting in mptcp_pm_remove_anno_addr()
- split NL PM bits
---
net/mptcp/pm_netlink.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index b399f2b7a369..f65831de5c1a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1401,6 +1401,7 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
ret = remove_anno_list_by_saddr(msk, addr);
if (ret || force) {
spin_lock_bh(&msk->pm.lock);
+ msk->pm.add_addr_signaled -= ret;
mptcp_pm_remove_addr(msk, &list);
spin_unlock_bh(&msk->pm.lock);
}
@@ -1565,17 +1566,18 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
struct mptcp_pm_addr_entry *entry;
list_for_each_entry(entry, rm_list, list) {
- if (lookup_subflow_by_saddr(&msk->conn_list, &entry->addr) &&
- slist.nr < MPTCP_RM_IDS_MAX)
+ if (slist.nr < MPTCP_RM_IDS_MAX &&
+ lookup_subflow_by_saddr(&msk->conn_list, &entry->addr))
slist.ids[slist.nr++] = entry->addr.id;
- if (remove_anno_list_by_saddr(msk, &entry->addr) &&
- alist.nr < MPTCP_RM_IDS_MAX)
+ if (alist.nr < MPTCP_RM_IDS_MAX &&
+ remove_anno_list_by_saddr(msk, &entry->addr))
alist.ids[alist.nr++] = entry->addr.id;
}
if (alist.nr) {
spin_lock_bh(&msk->pm.lock);
+ msk->pm.add_addr_signaled -= alist.nr;
mptcp_pm_remove_addr(msk, &alist);
spin_unlock_bh(&msk->pm.lock);
}
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH mptcp-net v2 3/4] selftests: mptcp: add explicit test case for remove/readd
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 1/4] mptcp: fix user-space PM announced address accounting Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 2/4] mptcp: fix NL " Paolo Abeni
@ 2024-07-05 20:33 ` Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 4/4] selftests: mptcp: fix error path Paolo Abeni
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-05 20:33 UTC (permalink / raw)
To: mptcp
Delete and re-create a signal endpoint and ensure that the PM
actually deletes and re-create the subflow.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
v1 -> v2:
- depends on subflow_rebuild_header
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 108aeeb84ef1..9c091fc267c4 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3526,6 +3526,35 @@ endpoint_tests()
chk_mptcp_info subflows 1 subflows 1
mptcp_lib_kill_wait $tests_pid
fi
+
+ # remove and re-add
+ if reset "delete re-add signal" &&
+ mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+ pm_nl_set_limits $ns1 1 1
+ pm_nl_set_limits $ns2 1 1
+ pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
+ test_linkfail=4 speed=20 \
+ run_tests $ns1 $ns2 10.0.1.1 &
+ local tests_pid=$!
+
+ wait_mpj $ns2
+ pm_nl_check_endpoint "creation" \
+ $ns1 10.0.2.1 id 1 flags signal
+ chk_subflow_nr "before delete" 2
+ chk_mptcp_info subflows 1 subflows 1
+
+ pm_nl_del_endpoint $ns1 1 10.0.2.1
+ sleep 0.5
+ chk_subflow_nr "after delete" 1
+ chk_mptcp_info subflows 0 subflows 0
+
+ pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
+ wait_mpj $ns2
+ chk_subflow_nr "after re-add" 2
+ chk_mptcp_info subflows 1 subflows 1
+ mptcp_lib_kill_wait $tests_pid
+ fi
+
}
# [$1: error message]
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH mptcp-net v2 4/4] selftests: mptcp: fix error path
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
` (2 preceding siblings ...)
2024-07-05 20:33 ` [PATCH mptcp-net v2 3/4] selftests: mptcp: add explicit test case for remove/readd Paolo Abeni
@ 2024-07-05 20:33 ` Paolo Abeni
2024-07-05 21:25 ` [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd MPTCP CI
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-05 20:33 UTC (permalink / raw)
To: mptcp
pm_nl_check_endpoint() currently calls an not existing helper
to mark the test as failed. Fix the wrong call.
Fixes: 03668c65d153 ("selftests: mptcp: join: rework detailed report")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 9c091fc267c4..55d84a1bde15 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -661,7 +661,7 @@ pm_nl_check_endpoint()
done
if [ -z "${id}" ]; then
- test_fail "bad test - missing endpoint id"
+ fail_test "bad test - missing endpoint id"
return
fi
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
` (3 preceding siblings ...)
2024-07-05 20:33 ` [PATCH mptcp-net v2 4/4] selftests: mptcp: fix error path Paolo Abeni
@ 2024-07-05 21:25 ` MPTCP CI
2024-07-09 9:03 ` Matthieu Baerts
2024-07-09 9:14 ` Matthieu Baerts
6 siblings, 0 replies; 8+ messages in thread
From: MPTCP CI @ 2024-07-05 21:25 UTC (permalink / raw)
To: Paolo Abeni; +Cc: mptcp
Hi Paolo,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Unstable: 1 failed test(s): packetdrill_mp_capable 🔴
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9813475267
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/3675d1072e39
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=868916
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
` (4 preceding siblings ...)
2024-07-05 21:25 ` [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd MPTCP CI
@ 2024-07-09 9:03 ` Matthieu Baerts
2024-07-09 9:14 ` Matthieu Baerts
6 siblings, 0 replies; 8+ messages in thread
From: Matthieu Baerts @ 2024-07-09 9:03 UTC (permalink / raw)
To: Paolo Abeni, mptcp
Hi Paolo,
On 05/07/2024 22:33, Paolo Abeni wrote:
> Issues/501 showed that the NL PM currently don't add corectly removal
> and re-add of signal endpoint.
>
> Patches 1 and 2 addresses the issue, patch 3/4 introduce a related
> self-test, and the last patch address a pre-existing buglet in the
> self-test infra.
>
> v1 -> v2:
> - splitted the first 2 patches
> - fixed accounting in mptcp_pm_remove_anno_addr
> - self-tests depends on subflow_rebuild_header
Thank you for the v2, it looks good to me:
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
I will do a follow-up regarding the re-use of the same ID (if needed --
but I guess yes, because we never mark the ID as available again when we
remove a signal endpoint).
For the issue with Packetdrill, reported by the CI, I think it should be
fixed by this PR:
https://github.com/multipath-tcp/packetdrill/pull/151
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
` (5 preceding siblings ...)
2024-07-09 9:03 ` Matthieu Baerts
@ 2024-07-09 9:14 ` Matthieu Baerts
6 siblings, 0 replies; 8+ messages in thread
From: Matthieu Baerts @ 2024-07-09 9:14 UTC (permalink / raw)
To: Paolo Abeni, mptcp
Hi Paolo,
On 05/07/2024 22:33, Paolo Abeni wrote:
> Issues/501 showed that the NL PM currently don't add corectly removal
> and re-add of signal endpoint.
(I didn't close it, I didn't check if it is fully fixed yet)
> Patches 1 and 2 addresses the issue, patch 3/4 introduce a related
> self-test, and the last patch address a pre-existing buglet in the
> self-test infra.
Now in our tree:
New patches for t/upstream-net and t/upstream:
- a973aebd56ba: mptcp: fix user-space PM announced address accounting
- ed70cf97ff31: mptcp: fix NL PM announced address accounting
- dc47c6d60de4: selftests: mptcp: add explicit test case for remove/readd
- 538cf9db944b: selftests: mptcp: fix error path
- Results: 8db44fbab258..e21a2574f711 (export-net)
- Results: 91e30f779125..a1f720d3a383 (export)
Tests are now in progress:
- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/93dd443c35874ff0a74cb51f747c08a9e0d1a5aa/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/52d4e14b827f1d4694bbb23dc513351ef0ac00fb/checks
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-07-09 9:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 20:33 [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 1/4] mptcp: fix user-space PM announced address accounting Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 2/4] mptcp: fix NL " Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 3/4] selftests: mptcp: add explicit test case for remove/readd Paolo Abeni
2024-07-05 20:33 ` [PATCH mptcp-net v2 4/4] selftests: mptcp: fix error path Paolo Abeni
2024-07-05 21:25 ` [PATCH mptcp-net v2 0/4] mptcp: fix signal endpoint readd MPTCP CI
2024-07-09 9:03 ` Matthieu Baerts
2024-07-09 9:14 ` Matthieu Baerts
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.