mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH mptcp-next] selftests: net: mptcp: add a check for dss fallback
@ 2025-08-05  9:23 Gang Yan
  2025-08-05  9:34 ` Matthieu Baerts
  0 siblings, 1 reply; 2+ messages in thread
From: Gang Yan @ 2025-08-05  9:23 UTC (permalink / raw)
  To: mptcp; +Cc: Gang Yan

The 'Infinite Map' test triggers increments of the counter named
'MPTcpExtDssFallback'. This patch adds a verification step to
check the expected behavior of this MIB counter during the test
execution.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/571
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---

Notes:
    Also, 'dss_drop_after_data_fallback.pkt' can check it too, so I
    create a PR to the packetdrill repo:
    https://github.com/multipath-tcp/packetdrill/pull/164

 .../testing/selftests/net/mptcp/mptcp_join.sh  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index b8af65373b3a..1872d646215f 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -889,6 +889,23 @@ check_cestab()
 	fi
 }
 
+chk_dssfb_nr()
+{
+	local ns=$1
+	local expected=$2
+	local count
+
+	print_check "check dss fallback:"
+	count=$(mptcp_lib_get_counter ${ns} "MPTcpExtDssFallback")
+	if [ -z "$count" ]; then
+		print_skip
+	elif [ "$count" != "$expected" ]; then
+		fail_test "got $count dss fallback expected $expected"
+	else
+		print_ok
+	fi
+}
+
 cond_start_capture()
 {
 	local ns="$1"
@@ -3338,6 +3355,7 @@ fail_tests()
 			join_fail_nr=1 join_rst_nr=0 join_infi_nr=1 \
 			join_corrupted_pkts="$(pedit_action_pkts)" \
 			chk_join_nr 0 0 0
+		chk_dssfb_nr $ns1 1
 		chk_fail_nr 1 -1 invert
 	fi
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH mptcp-next] selftests: net: mptcp: add a check for dss fallback
  2025-08-05  9:23 [PATCH mptcp-next] selftests: net: mptcp: add a check for dss fallback Gang Yan
@ 2025-08-05  9:34 ` Matthieu Baerts
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Baerts @ 2025-08-05  9:34 UTC (permalink / raw)
  To: Gang Yan, mptcp

Hi Gang,

On 05/08/2025 11:23, Gang Yan wrote:
> The 'Infinite Map' test triggers increments of the counter named
> 'MPTcpExtDssFallback'. This patch adds a verification step to
> check the expected behavior of this MIB counter during the test
> execution.

Thank you for looking at that!

I think it would be better to always check all the new fallback
counters: they should always be set to 0, except in tests like Infinite Map.

I don't know if you saw the updated version on #571 with this suggestion:

> It would be good to track these counters (e.g. in mptcp_join.sh) and
> check if they don't have unexpected values in our tests with
> fallbacks (or reset, or none of them).
> 
> This could be done similarly to what is done in chk_join_tx_nr():
> only print something in case of unexpected errors, and each test can
> override some values if needed.

Instead of only checking when it is supposed to be incremented.

WDYT?

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-05  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-05  9:23 [PATCH mptcp-next] selftests: net: mptcp: add a check for dss fallback Gang Yan
2025-08-05  9:34 ` 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).