* [PATCH mptcp-next v3 0/2] fixes for CURRESTAB
@ 2023-12-20 2:08 Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 1/2] Squash to "mptcp: use mptcp_set_state" Geliang Tang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2023-12-20 2:08 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
v3:
- update the comment in mptcp_pm_nl_create_listen_socket.
- update selftests
v2:
- Address Paolo & Matt's comments for v1.
Geliang Tang (2):
Squash to "mptcp: use mptcp_set_state"
selftests: mptcp: diag: check CURRESTAB counters
net/mptcp/pm_netlink.c | 6 ++++--
tools/testing/selftests/net/mptcp/diag.sh | 17 ++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
--
2.35.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH mptcp-next v3 1/2] Squash to "mptcp: use mptcp_set_state"
2023-12-20 2:08 [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Geliang Tang
@ 2023-12-20 2:08 ` Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 2/2] selftests: mptcp: diag: check CURRESTAB counters Geliang Tang
2023-12-21 17:02 ` [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Geliang Tang @ 2023-12-20 2:08 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
Update the comment.
Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
---
net/mptcp/pm_netlink.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index b93683b5e618..661c226dad18 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1048,8 +1048,10 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
if (err)
return err;
- /* avoid replacing inet_sk_state_store with mptcp_set_state here, as the
- * old status is known to be TCP_CLOSE, hence will not affect the count.
+ /* We don't use mptcp_set_state() here because it needs to be called
+ * under the msk socket lock. For the moment, that will not bring
+ * anything more than only calling inet_sk_state_store(), because the
+ * old status is known (TCP_CLOSE).
*/
inet_sk_state_store(newsk, TCP_LISTEN);
lock_sock(ssk);
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH mptcp-next v3 2/2] selftests: mptcp: diag: check CURRESTAB counters
2023-12-20 2:08 [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 1/2] Squash to "mptcp: use mptcp_set_state" Geliang Tang
@ 2023-12-20 2:08 ` Geliang Tang
2023-12-21 17:02 ` [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Geliang Tang @ 2023-12-20 2:08 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
This patch adds a new helper chk_msk_cestab() to check the current
established connections counter MIB_CURRESTAB in diag.sh. Invoke it
to check the counter during the connection after every chk_msk_inuse().
Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
---
tools/testing/selftests/net/mptcp/diag.sh | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh
index 95b498efacd1..04fcb8a077c9 100755
--- a/tools/testing/selftests/net/mptcp/diag.sh
+++ b/tools/testing/selftests/net/mptcp/diag.sh
@@ -56,7 +56,7 @@ __chk_nr()
local command="$1"
local expected=$2
local msg="$3"
- local skip="${4:-SKIP}"
+ local skip="${4-SKIP}"
local nr
nr=$(eval $command)
@@ -182,6 +182,15 @@ chk_msk_inuse()
__chk_nr get_msk_inuse $expected "$msg" 0
}
+# $1: cestab nr
+chk_msk_cestab()
+{
+ local cestab=$1
+
+ __chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \
+ "${cestab}" "....chk ${cestab} cestab" ""
+}
+
wait_connected()
{
local listener_ns="${1}"
@@ -219,9 +228,11 @@ chk_msk_nr 2 "after MPC handshake "
chk_msk_remote_key_nr 2 "....chk remote_key"
chk_msk_fallback_nr 0 "....chk no fallback"
chk_msk_inuse 2 "....chk 2 msk in use"
+chk_msk_cestab 2
flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_cestab 0
echo "a" | \
timeout ${timeout_test} \
@@ -237,9 +248,11 @@ echo "b" | \
wait_connected $ns 10001
chk_msk_fallback_nr 1 "check fallback"
chk_msk_inuse 1 "....chk 1 msk in use"
+chk_msk_cestab 1
flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_cestab 0
NR_CLIENTS=100
for I in `seq 1 $NR_CLIENTS`; do
@@ -261,9 +274,11 @@ done
wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present"
chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use"
+chk_msk_cestab $((NR_CLIENTS*2))
flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush"
+chk_msk_cestab 0
mptcp_lib_result_print_all_tap
exit $ret
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-next v3 0/2] fixes for CURRESTAB
2023-12-20 2:08 [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 1/2] Squash to "mptcp: use mptcp_set_state" Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 2/2] selftests: mptcp: diag: check CURRESTAB counters Geliang Tang
@ 2023-12-21 17:02 ` Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2023-12-21 17:02 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
On 20/12/2023 03:08, Geliang Tang wrote:
> v3:
> - update the comment in mptcp_pm_nl_create_listen_socket.
> - update selftests
Thank you for this v3!
New patches for t/upstream:
- c8b5e71d4184: "squashed" patch 1/2 in "mptcp: use mptcp_set_state"
- b524e1893751: tg:msg: counter in the title (instead of "mptcp: add
mptcp_set_state") + reason
- d6b5afed204c: selftests: mptcp: diag: check CURRESTAB counters
- Results: 9adfb88a4930..36dd8ffc4e09 (export)
Tests are not in progress on the public CI (the monthly limit has been
reached)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-21 17:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 2:08 [PATCH mptcp-next v3 0/2] fixes for CURRESTAB Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 1/2] Squash to "mptcp: use mptcp_set_state" Geliang Tang
2023-12-20 2:08 ` [PATCH mptcp-next v3 2/2] selftests: mptcp: diag: check CURRESTAB counters Geliang Tang
2023-12-21 17:02 ` [PATCH mptcp-next v3 0/2] fixes for CURRESTAB 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.