From: Li Xiasong <[email protected]>

Extend add_addr_ports_tests with IPv6 signaling cases that exercise
ADD_ADDR tx-space shortage when tcp_timestamps are enabled.

Add one case to verify PM still progresses to later signal endpoints
after the first one is dropped.

This covers both failure accounting and the non-blocking behavior of
the announce list after a tx-space drop on pure ACK.

Signed-off-by: Li Xiasong <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
---
To: Shuah Khan <[email protected]>
Cc: [email protected]
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 31 +++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh 
b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index beec41f6662a..5acd12021e6e 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1828,6 +1828,22 @@ chk_add_tx_nr()
        fi
 }
 
+chk_add_drop_tx_nr()
+{
+       local drop_tx_nr=$1
+       local count
+
+       print_check "add addr tx drop"
+       count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtAddAddrTxDrop")
+       if [ -z "$count" ]; then
+               print_skip
+       elif [ "$count" != "$drop_tx_nr" ]; then
+               fail_test "got $count ADD_ADDR drop[s] TX, expected $drop_tx_nr"
+       else
+               print_ok
+       fi
+}
+
 chk_rm_nr()
 {
        local rm_addr_nr=$1
@@ -3278,6 +3294,21 @@ add_addr_ports_tests()
 
                chk_mpc_endp_attempt ${retl} 1
        fi
+
+       # first signal address drops, second one still progresses
+       if reset "signal addr list progresses after tx drop"; then
+               pm_nl_set_limits $ns1 0 2
+               pm_nl_set_limits $ns2 1 0
+               ip netns exec $ns1 sysctl -q net.ipv4.tcp_timestamps=1
+               ip netns exec $ns2 sysctl -q net.ipv4.tcp_timestamps=1
+
+               pm_nl_add_endpoint $ns1 dead:beef:2::1 flags signal port 10100
+               pm_nl_add_endpoint $ns1 dead:beef:3::1 flags signal
+               run_tests $ns1 $ns2 dead:beef:1::1
+               chk_add_drop_tx_nr 1
+               chk_add_tx_nr 1 1
+               chk_add_nr 1 1 0
+       fi
 }
 
 bind_tests()

-- 
2.53.0


Reply via email to