Commit 004125c2 authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Jakub Kicinski

selftests: mptcp: join: validate MPJ SYN TX MIB counters

A few new MPJoinSynTx MIB counters have been added in a previous commit.
They are being validated here in mptcp_join.sh selftest, each time the
number of received MPJ are checked.

Most of the time, the number of sent SYN+MPJ is the same as the received
ones. But sometimes, there are more, because there are dropped, or there
are errors.

While at it, the "no MPC reuse with single endpoint" subtest has been
modified to force a bind() error.
Reviewed-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-6-d3e0f3773b90@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ba8a6640
...@@ -67,6 +67,10 @@ unset join_fail_nr ...@@ -67,6 +67,10 @@ unset join_fail_nr
unset join_rst_nr unset join_rst_nr
unset join_infi_nr unset join_infi_nr
unset join_corrupted_pkts unset join_corrupted_pkts
unset join_syn_tx
unset join_create_err
unset join_bind_err
unset join_connect_err
# generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) || # generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) ||
# (ip6 && (ip6[74] & 0xf0) == 0x30)'" # (ip6 && (ip6[74] & 0xf0) == 0x30)'"
...@@ -1336,6 +1340,54 @@ chk_infi_nr() ...@@ -1336,6 +1340,54 @@ chk_infi_nr()
fi fi
} }
chk_join_tx_nr()
{
local syn_tx=${join_syn_tx:-0}
local create=${join_create_err:-0}
local bind=${join_bind_err:-0}
local connect=${join_connect_err:-0}
local rc=${KSFT_PASS}
local count
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTx")
if [ -z "$count" ]; then
rc=${KSFT_SKIP}
elif [ "$count" != "$syn_tx" ]; then
rc=${KSFT_FAIL}
print_check "syn tx"
fail_test "got $count JOIN[s] syn tx expected $syn_tx"
fi
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxCreatSkErr")
if [ -z "$count" ]; then
rc=${KSFT_SKIP}
elif [ "$count" != "$create" ]; then
rc=${KSFT_FAIL}
print_check "syn tx create socket error"
fail_test "got $count JOIN[s] syn tx create socket error expected $create"
fi
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxBindErr")
if [ -z "$count" ]; then
rc=${KSFT_SKIP}
elif [ "$count" != "$bind" ]; then
rc=${KSFT_FAIL}
print_check "syn tx bind error"
fail_test "got $count JOIN[s] syn tx bind error expected $bind"
fi
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxConnectErr")
if [ -z "$count" ]; then
rc=${KSFT_SKIP}
elif [ "$count" != "$connect" ]; then
rc=${KSFT_FAIL}
print_check "syn tx connect error"
fail_test "got $count JOIN[s] syn tx connect error expected $connect"
fi
print_results "join Tx" ${rc}
}
chk_join_nr() chk_join_nr()
{ {
local syn_nr=$1 local syn_nr=$1
...@@ -1390,6 +1442,9 @@ chk_join_nr() ...@@ -1390,6 +1442,9 @@ chk_join_nr()
print_results "join Rx" ${rc} print_results "join Rx" ${rc}
join_syn_tx="${join_syn_tx:-${syn_nr}}" \
chk_join_tx_nr
if $validate_checksum; then if $validate_checksum; then
chk_csum_nr $csum_ns1 $csum_ns2 chk_csum_nr $csum_ns1 $csum_ns2
chk_fail_nr $fail_nr $fail_nr chk_fail_nr $fail_nr $fail_nr
...@@ -1930,8 +1985,10 @@ subflows_error_tests() ...@@ -1930,8 +1985,10 @@ subflows_error_tests()
pm_nl_set_limits $ns1 0 1 pm_nl_set_limits $ns1 0 1
pm_nl_set_limits $ns2 0 1 pm_nl_set_limits $ns2 0 1
pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow
pm_nl_add_endpoint $ns2 10.0.12.2 flags subflow
speed=slow \ speed=slow \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_bind_err=1 \
chk_join_nr 0 0 0 chk_join_nr 0 0 0
fi fi
...@@ -1944,6 +2001,7 @@ subflows_error_tests() ...@@ -1944,6 +2001,7 @@ subflows_error_tests()
pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow
speed=slow \ speed=slow \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=2 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
fi fi
...@@ -1956,6 +2014,7 @@ subflows_error_tests() ...@@ -1956,6 +2014,7 @@ subflows_error_tests()
pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow
speed=slow \ speed=slow \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=2 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
fi fi
...@@ -1977,6 +2036,7 @@ subflows_error_tests() ...@@ -1977,6 +2036,7 @@ subflows_error_tests()
# additional subflow could be created only if the PM select # additional subflow could be created only if the PM select
# the later endpoint, skipping the already used one # the later endpoint, skipping the already used one
join_syn_tx=2 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
fi fi
} }
...@@ -2063,6 +2123,7 @@ signal_address_tests() ...@@ -2063,6 +2123,7 @@ signal_address_tests()
pm_nl_add_endpoint $ns1 10.0.14.1 flags signal pm_nl_add_endpoint $ns1 10.0.14.1 flags signal
pm_nl_set_limits $ns2 3 3 pm_nl_set_limits $ns2 3 3
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=3 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
chk_add_nr 3 3 chk_add_nr 3 3
fi fi
...@@ -2231,6 +2292,7 @@ add_addr_timeout_tests() ...@@ -2231,6 +2292,7 @@ add_addr_timeout_tests()
pm_nl_set_limits $ns2 2 2 pm_nl_set_limits $ns2 2 2
speed=10 \ speed=10 \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=2 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
chk_add_nr 8 0 chk_add_nr 8 0
fi fi
...@@ -2331,6 +2393,7 @@ remove_tests() ...@@ -2331,6 +2393,7 @@ remove_tests()
pm_nl_set_limits $ns2 2 2 pm_nl_set_limits $ns2 2 2
addr_nr_ns1=-3 speed=10 \ addr_nr_ns1=-3 speed=10 \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=2 join_connect_err=1 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
chk_add_nr 3 3 chk_add_nr 3 3
chk_rm_nr 3 1 invert chk_rm_nr 3 1 invert
...@@ -2396,6 +2459,7 @@ remove_tests() ...@@ -2396,6 +2459,7 @@ remove_tests()
pm_nl_set_limits $ns2 3 3 pm_nl_set_limits $ns2 3 3
addr_nr_ns1=-8 speed=slow \ addr_nr_ns1=-8 speed=slow \
run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 10.0.1.1
join_syn_tx=3 \
chk_join_nr 1 1 1 chk_join_nr 1 1 1
chk_add_nr 3 3 chk_add_nr 3 3
chk_rm_nr 3 1 invert chk_rm_nr 3 1 invert
...@@ -3703,6 +3767,7 @@ endpoint_tests() ...@@ -3703,6 +3767,7 @@ endpoint_tests()
chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6 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_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 5 # one has been closed before estab
join_syn_tx=7 \
chk_join_nr 6 6 6 chk_join_nr 6 6 6
chk_rm_nr 4 4 chk_rm_nr 4 4
fi fi
...@@ -3775,6 +3840,7 @@ endpoint_tests() ...@@ -3775,6 +3840,7 @@ endpoint_tests()
chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5
chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3 chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3
join_connect_err=1 \
chk_join_nr 5 5 5 chk_join_nr 5 5 5
chk_add_nr 6 6 chk_add_nr 6 6
chk_rm_nr 4 3 invert chk_rm_nr 4 3 invert
...@@ -3806,6 +3872,7 @@ endpoint_tests() ...@@ -3806,6 +3872,7 @@ endpoint_tests()
wait_mpj $ns2 wait_mpj $ns2
mptcp_lib_kill_wait $tests_pid mptcp_lib_kill_wait $tests_pid
join_syn_tx=3 join_connect_err=1 \
chk_join_nr 2 2 2 chk_join_nr 2 2 2
chk_add_nr 2 2 chk_add_nr 2 2
chk_rm_nr 1 0 invert chk_rm_nr 1 0 invert
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment