Unverified Commit cdd09604 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12771 MPTCP Upstream part 15

Merge Pull Request from: @geliangtang 
 
mptcp: various small improvements

This series brings various small improvements to MPTCP and its
selftests:

Patches 1 to 3 are some cleanup for the MPTCP selftests. These patches
are not supposed to change the behaviour.

Patch 4 sets the poll timeout in diag selftest to the same value as the
one used in the other selftests.

https://lore.kernel.org/all/20240223-upstream-net-next-20240223-misc-improvements-v1-0-b6c8a10396bd@kernel.org/ 
 
Link:https://gitee.com/openeuler/kernel/pulls/12771

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 7ff42f62 6dff6dc0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
ns="ns1-$rndh"
ksft_skip=4
test_cnt=1
timeout_poll=100
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
ret=0

+11 −11
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@ iptables="iptables"
ip6tables="ip6tables"
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
capture=0
checksum=0
capture=false
checksum=false
ip_mptcp=0
check_invert=0
validate_checksum=0
validate_checksum=false
init=0
evts_ns1=""
evts_ns2=""
@@ -101,7 +101,7 @@ init_partial()
		ip netns exec $netns sysctl -q net.mptcp.pm_type=0 2>/dev/null || true
		ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0
		ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=0
		if [ $checksum -eq 1 ]; then
		if $checksum; then
			ip netns exec $netns sysctl -q net.mptcp.checksum_enabled=1
		fi
	done
@@ -388,7 +388,7 @@ reset_with_checksum()
	ip netns exec $ns1 sysctl -q net.mptcp.checksum_enabled=$ns1_enable
	ip netns exec $ns2 sysctl -q net.mptcp.checksum_enabled=$ns2_enable

	validate_checksum=1
	validate_checksum=true
}

reset_with_allow_join_id0()
@@ -421,7 +421,7 @@ reset_with_allow_join_id0()
setup_fail_rules()
{
	check_invert=1
	validate_checksum=1
	validate_checksum=true
	local i="$1"
	local ip="${2:-4}"
	local tables
@@ -1026,7 +1026,7 @@ do_transfer()
	:> "$sout"
	:> "$capout"

	if [ $capture -eq 1 ]; then
	if $capture; then
		local capuser
		if [ -z $SUDO_USER ] ; then
			capuser=""
@@ -1128,7 +1128,7 @@ do_transfer()
	wait $spid
	local rets=$?

	if [ $capture -eq 1 ]; then
	if $capture; then
	    sleep 1
	    kill $cappid
	fi
@@ -1516,7 +1516,7 @@ chk_join_nr()
	else
		print_ok
	fi
	if [ $validate_checksum -eq 1 ]; then
	if $validate_checksum; then
		chk_csum_nr $csum_ns1 $csum_ns2
		chk_fail_nr $fail_nr $fail_nr
		chk_rst_nr $rst_nr $rst_nr
@@ -3944,10 +3944,10 @@ while getopts "${all_tests_args}cCih" opt; do
			tests+=("${all_tests[${opt}]}")
			;;
		c)
			capture=1
			capture=true
			;;
		C)
			checksum=1
			checksum=true
			;;
		i)
			ip_mptcp=1
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ sec=$(date +%s)
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
ns1="ns1-$rndh"
err=$(mktemp)
ret=0

cleanup()
{
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,12 @@ test_cnt=1
ret=0
bail=0
slack=50
large=""
small=""
sout=""
cout=""
capout=""
size=0

usage() {
	echo "Usage: $0 [ -b ] [ -c ] [ -d ]"