All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare()
@ 2020-10-15 12:20 Alexey Kodanev
  2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-15 12:20 UTC (permalink / raw)
  To: ltp

* Remove duplicate code for comparing time-based results in
  network tests (bbr, busy_poll, sctp, tcp fastopen, virt tests)

* Expand thresholds for sctp, bbr test-cases, in order to avoid
  false-positive failures.

* In virt_lib.sh, keep sign for VIRT_PERF_THRESHOLD.

* TWARN when the base result is too bad (threshold_hi arg is set)

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/lib/tst_net.sh                      | 31 +++++++++++++++++++
 testcases/network/busy_poll/busy_poll01.sh    | 10 ++----
 testcases/network/busy_poll/busy_poll02.sh    |  8 +----
 testcases/network/busy_poll/busy_poll03.sh    |  8 +----
 testcases/network/dccp/dccp01.sh              | 15 ++-------
 testcases/network/sctp/sctp01.sh              |  8 +----
 testcases/network/tcp_cc/bbr01.sh             |  2 +-
 testcases/network/tcp_cc/bbr02.sh             |  2 +-
 testcases/network/tcp_cc/dctcp01.sh           |  2 +-
 testcases/network/tcp_cc/tcp_cc_lib.sh        |  8 +----
 .../network/tcp_fastopen/tcp_fastopen_run.sh  | 15 ++-------
 testcases/network/virt/virt_lib.sh            | 21 ++-----------
 12 files changed, 46 insertions(+), 84 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index d939a5780..b29e076c3 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -741,6 +741,37 @@ tst_netload()
 	return $ret
 }
 
+# Compares results for netload runs.
+# tst_netload_compare TIME_BASE TIME THRESHOLD_LOW [THRESHOLD_HI]
+# TIME_BASE: time taken to run netstress load test - 100%
+# TIME: time that is compared to the base one
+# THRESHOD_LOW: lower limit for TFAIL
+# THRESHOD_HIGH: upper limit for TWARN
+tst_netload_compare()
+{
+	local base_time=$1
+	local new_time=$2
+	local threshold_low=$3
+	local threshold_hi=$4
+
+	if [ -z "$base_time" -o -z "$new_time" -o -z "$threshold_low" ]; then
+		tst_brk_ TBROK "tst_netload_compare: invalid argument(s)"
+	fi
+
+	local res=$(((base_time - new_time) * 100 / base_time))
+	local msg="performance result is ${res}%"
+
+	if [ "$res" -lt "$threshold_low" ]; then
+		tst_res_ TFAIL "$msg < threshold ${threshold_low}%"
+		return
+	fi
+
+	[ "$threshold_hi" ] && [ "$res" -gt "$threshold_hi" ] && \
+		tst_res_ TWARN "$msg > threshold ${threshold_hi}%"
+
+	tst_res_ TPASS "$msg, in range [${threshold_low}:${threshold_hi:-}]%"
+}
+
 # tst_ping [IFACE] [DST ADDR] [MESSAGE SIZE ARRAY]
 # Check icmp connectivity
 # IFACE: source interface name or IP address
diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 0023f6cef..d306d1be8 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2015-2020 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
@@ -47,13 +47,7 @@ test()
 		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
 	done
 
-	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
-
-	if [ "$poll_cmp" -lt 1 ]; then
-		tst_res TFAIL "busy poll result is '$poll_cmp' %"
-	else
-		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
-	fi
+	tst_netload_compare $(cat res_0) $(cat res_50) 1
 }
 
 tst_run
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index 1f25b7373..abb5160f9 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -37,13 +37,7 @@ test()
 		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
 	done
 
-	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
-
-	if [ "$poll_cmp" -lt 1 ]; then
-		tst_res TFAIL "busy poll result is '$poll_cmp' %"
-	else
-		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
-	fi
+	tst_netload_compare $(cat res_0) $(cat res_50) 1
 }
 
 tst_run
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index 3c7029927..55ffefb07 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -40,13 +40,7 @@ test()
 			    -b $x -T $2
 	done
 
-	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
-
-	if [ "$poll_cmp" -lt 1 ]; then
-		tst_res TFAIL "busy poll result is '$poll_cmp' %"
-	else
-		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
-	fi
+	tst_netload_compare $(cat res_0) $(cat res_50) 1
 }
 
 tst_run
diff --git a/testcases/network/dccp/dccp01.sh b/testcases/network/dccp/dccp01.sh
index d18ac6f18..52f232591 100755
--- a/testcases/network/dccp/dccp01.sh
+++ b/testcases/network/dccp/dccp01.sh
@@ -9,17 +9,6 @@ TST_NEEDS_ROOT=1
 
 . tst_net.sh
 
-compare()
-{
-	local per=$(( $res0 * 100 / $res1 - 100 ))
-
-	if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
-		tst_res TFAIL "$1 performance $per %"
-	else
-		tst_res TPASS "$1 performance $per % in range -100 ... 100 %"
-	fi
-}
-
 test1()
 {
 	tst_res TINFO "run UDP"
@@ -31,14 +20,14 @@ test2()
 	tst_res TINFO "compare UDP/DCCP performance"
 	tst_netload -H $(tst_ipaddr rhost) -T dccp
 	res1="$(cat tst_netload.res)"
-	compare DCCP
+	tst_netload_compare $res0 $res1 -100 100
 }
 test3()
 {
 	tst_res TINFO "compare UDP/UDP-Lite performance"
 	tst_netload -H $(tst_ipaddr rhost) -T udp_lite
 	res1="$(cat tst_netload.res)"
-	compare UDP-Lite
+	tst_netload_compare $res0 $res1 -100 100
 }
 
 tst_run
diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh
index a66020061..a42bd4975 100755
--- a/testcases/network/sctp/sctp01.sh
+++ b/testcases/network/sctp/sctp01.sh
@@ -23,13 +23,7 @@ test()
 	tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts
 	local res1="$(cat tst_netload.res)"
 
-	local per=$(( $res0 * 100 / $res1 - 100 ))
-
-	if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
-		tst_res TFAIL "sctp performance $per %"
-	else
-		tst_res TPASS "sctp performance $per % in range -100 ... 100 %"
-	fi
+	tst_netload_compare $res0 $res1 -200 200
 }
 
 tst_run
diff --git a/testcases/network/tcp_cc/bbr01.sh b/testcases/network/tcp_cc/bbr01.sh
index a6592b32d..3b80d50e4 100755
--- a/testcases/network/tcp_cc/bbr01.sh
+++ b/testcases/network/tcp_cc/bbr01.sh
@@ -27,7 +27,7 @@ setup()
 
 do_test()
 {
-	tcp_cc_test01 bbr -50
+	tcp_cc_test01 bbr -100
 }
 
 tst_run
diff --git a/testcases/network/tcp_cc/bbr02.sh b/testcases/network/tcp_cc/bbr02.sh
index b04c0c173..3a61e8726 100755
--- a/testcases/network/tcp_cc/bbr02.sh
+++ b/testcases/network/tcp_cc/bbr02.sh
@@ -34,7 +34,7 @@ setup()
 do_test()
 {
 	tcp_cc_set_qdisc $2 || return
-	tcp_cc_test01 bbr -50
+	tcp_cc_test01 bbr -100
 }
 
 tst_run
diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh
index 14ee96dbf..45311c5a2 100755
--- a/testcases/network/tcp_cc/dctcp01.sh
+++ b/testcases/network/tcp_cc/dctcp01.sh
@@ -33,7 +33,7 @@ setup()
 
 do_test()
 {
-	tcp_cc_test01 dctcp 10
+	tcp_cc_test01 dctcp -100
 }
 
 tst_run
diff --git a/testcases/network/tcp_cc/tcp_cc_lib.sh b/testcases/network/tcp_cc/tcp_cc_lib.sh
index 815cc9c0e..dff8cef19 100755
--- a/testcases/network/tcp_cc/tcp_cc_lib.sh
+++ b/testcases/network/tcp_cc/tcp_cc_lib.sh
@@ -101,11 +101,5 @@ tcp_cc_test01()
 	tst_netload -H $(tst_ipaddr rhost) -A $TST_NET_MAX_PKT
 	local res1="$(cat tst_netload.res)"
 
-	local per=$(( $res0 * 100 / $res1 - 100 ))
-
-	if [ "$per" -lt "$threshold" ]; then
-		tst_res TFAIL "$alg performance $per %"
-	else
-		tst_res TPASS "$alg performance $per %"
-	fi
+	tst_netload_compare $res0 $res1 $threshold
 }
diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
index a4b542220..fb2cb8fc2 100755
--- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
+++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
@@ -36,17 +36,6 @@ cleanup()
 	tc qdisc del dev $(tst_iface) root netem delay 100 >/dev/null
 }
 
-compare()
-{
-	tfo_cmp=$(( 100 - ($time_tfo_on * 100) / $time_tfo_off ))
-
-	if [ "$tfo_cmp" -lt 3 ]; then
-		tst_res TFAIL "$1 perf result is '$tfo_cmp' percent"
-	else
-		tst_res TPASS "$1 perf result is '$tfo_cmp' percent"
-	fi
-}
-
 setup()
 {
 	if tst_kvcmp -lt "3.16" && [ "$TST_IPV6" ]; then
@@ -66,7 +55,7 @@ test1()
 	tst_netload -H $(tst_ipaddr rhost) -f -t 3 -R $srv_replies
 	time_tfo_on=$(cat tst_netload.res)
 
-	compare
+	tst_netload_compare $time_tfo_off $time_tfo_on 3
 }
 
 test2()
@@ -78,7 +67,7 @@ test2()
 	tst_netload -H $(tst_ipaddr rhost) -F -t 3 -R $srv_replies
 	time_tfo_on=$(cat tst_netload.res)
 
-	compare
+	tst_netload_compare $time_tfo_off $time_tfo_on 3
 }
 
 tst_run
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index cb2b2ba97..80b9bcc90 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -295,25 +295,8 @@ virt_compare_netperf()
 	local lt="$(cat res_lan)"
 	tst_res TINFO "time lan IPv${TST_IPVER}($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
 
-	per=$(( $vt * 100 / $lt - 100 ))
-	per6=$(( $vt6 * 100 / $lt - 100 ))
-
-	case "$virt_type" in
-	vxlan|geneve)
-		tst_res TINFO "IP4 $virt_type over IP$TST_IPVER slower by $per %"
-		tst_res TINFO "IP6 $virt_type over IP$TST_IPVER slower by $per6 %"
-	;;
-	*)
-		tst_res TINFO "IP4 $virt_type slower by $per %"
-		tst_res TINFO "IP6 $virt_type slower by $per6 %"
-	esac
-
-	if [ "$per" -ge "$VIRT_PERF_THRESHOLD" -o \
-	     "$per6" -ge "$VIRT_PERF_THRESHOLD" ]; then
-		tst_res TFAIL "Test failed, threshold: $VIRT_PERF_THRESHOLD %"
-	else
-		tst_res TPASS "Test passed, threshold: $VIRT_PERF_THRESHOLD %"
-	fi
+	tst_netload_compare $lt $vt "-$VIRT_PERF_THRESHOLD"
+	tst_netload_compare $lt $vt6 "-$VIRT_PERF_THRESHOLD"
 }
 
 virt_check_cmd()
-- 
2.20.1


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

* [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload()
  2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
@ 2020-10-15 12:20 ` Alexey Kodanev
  2020-10-20 14:39   ` Petr Vorel
  2020-10-15 12:20 ` [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr Alexey Kodanev
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-15 12:20 UTC (permalink / raw)
  To: ltp

Add TST_NETLOAD_RUN_COUNT to control how many times netstress
test will be run to calculate the mean time value. Default is 5.

This value will divide the total number of requests in order
not to significantly increase the time for the test after this
patch.

Moreover, one of the runs can fail once, it will produce only a
warning. The test will broke after the second failure. It can
be useful to make sure we have reproducible results.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/lib/tst_net.sh | 95 ++++++++++++++++++++++++++--------------
 1 file changed, 62 insertions(+), 33 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index b29e076c3..1912b984d 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -623,9 +623,11 @@ tst_wait_ipv6_dad()
 	done
 }
 
-tst_dump_rhost_cmd()
+tst_netload_brk()
 {
 	tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
+	cat tst_netload.log
+	tst_brk_ $1 $2
 }
 
 # Run network load test, see 'netstress -h' for option description
@@ -640,6 +642,7 @@ tst_netload()
 	# common options for client and server
 	local cs_opts=
 
+	local run_cnt="$TST_NETLOAD_RUN_COUNT"
 	local c_num="$TST_NETLOAD_CLN_NUMBER"
 	local c_requests="$TST_NETLOAD_CLN_REQUESTS"
 	local c_opts=
@@ -692,51 +695,76 @@ tst_netload()
 	local expect_ret=0
 	[ "$expect_res" != "pass" ] && expect_ret=3
 
-	tst_rhost_run -c "pkill -9 netstress\$"
-	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
-	tst_res_ TINFO "run server 'netstress $s_opts'"
-	tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
-	if [ $? -ne 0 ]; then
-		cat tst_netload.log
-		local ttype="TFAIL"
-		grep -e 'CONF:' tst_netload.log && ttype="TCONF"
-		tst_brk_ $ttype "server failed"
+	local was_failure=0
+	if [ "$run_cnt" -lt 2 ]; then
+		run_cnt=1
+		was_failure=1
 	fi
 
-	local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
-	c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port"
+	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
+	c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -d $rfile"
+
+	tst_res_ TINFO "run server 'netstress $s_opts'"
+	tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times"
 
-	tst_res_ TINFO "run client 'netstress -l $c_opts'"
-	netstress -l $c_opts > tst_netload.log 2>&1 || ret=$?
 	tst_rhost_run -c "pkill -9 netstress\$"
+	rm -f tst_netload.log
+
+	local res=0
+	local passed=0
+
+	for i in $(seq 1 $run_cnt); do
+		tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
+		if [ $? -ne 0 ]; then
+			cat tst_netload.log
+			local ttype="TFAIL"
+			grep -e 'CONF:' tst_netload.log && ttype="TCONF"
+			tst_brk_ $ttype "server failed"
+		fi
 
-	if [ "$expect_ret" -ne 0 ]; then
-		if [ $((ret & expect_ret)) -ne 0 ]; then
-			tst_res_ TPASS "netstress failed as expected"
-		else
-			tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
+		local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
+		netstress -l ${c_opts} -g $port > tst_netload.log 2>&1
+		ret=$?
+		tst_rhost_run -c "pkill -9 netstress\$"
+
+		if [ "$expect_ret" -ne 0 ]; then
+			if [ $((ret & expect_ret)) -ne 0 ]; then
+				tst_res_ TPASS "netstress failed as expected"
+			else
+				tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
+			fi
+			return $ret
+		fi
+
+		if [ "$ret" -ne 0 ]; then
+			[ $((ret & 32)) -ne 0 ] && \
+				tst_netload_brk TCONF "not supported configuration"
+
+			[ $((ret & 3)) -ne 0 -a $was_failure -gt 0 ] && \
+				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
+
+			tst_res_ TWARN "netstress failed, ret: $ret"
+			was_failure=1
+			continue
 		fi
-		return $ret
-	fi
+
+		[ ! -f $rfile ] && \
+			tst_netload_brk TFAIL "can't read $rfile"
+
+		res="$((res + $(cat $rfile)))"
+		passed=$((passed + 1))
+	done
 
 	if [ "$ret" -ne 0 ]; then
-		tst_dump_rhost_cmd
-		cat tst_netload.log
-		[ $((ret & 3)) -ne 0 ] && \
-			tst_brk_ TFAIL "expected '$expect_res' but ret: '$ret'"
-		[ $((ret & 32)) -ne 0 ] && \
-			tst_brk_ TCONF "not supported configuration"
 		[ $((ret & 4)) -ne 0 ] && \
 			tst_res_ TWARN "netstress has warnings"
+		tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
 	fi
 
-	if [ ! -f $rfile ]; then
-		tst_dump_rhost_cmd
-		cat tst_netload.log
-		tst_brk_ TFAIL "can't read $rfile"
-	fi
+	res=$((res / $passed))
+	echo "$res" > $rfile
 
-	tst_res_ TPASS "netstress passed, time spent '$(cat $rfile)' ms"
+	tst_res_ TPASS "netstress passed, mean time '$res' ms"
 
 	return $ret
 }
@@ -938,6 +966,7 @@ export TST_NET_DATAROOT="$LTPROOT/testcases/bin/datafiles"
 export TST_NETLOAD_CLN_REQUESTS="${TST_NETLOAD_CLN_REQUESTS:-10000}"
 export TST_NETLOAD_CLN_NUMBER="${TST_NETLOAD_CLN_NUMBER:-2}"
 export TST_NETLOAD_BINDTODEVICE="${TST_NETLOAD_BINDTODEVICE-1}"
+export TST_NETLOAD_RUN_COUNT="${TST_NETLOAD_RUN_COUNT:-5}"
 export HTTP_DOWNLOAD_DIR="${HTTP_DOWNLOAD_DIR:-/var/www/html}"
 export FTP_DOWNLOAD_DIR="${FTP_DOWNLOAD_DIR:-/var/ftp}"
 export FTP_UPLOAD_DIR="${FTP_UPLOAD_DIR:-/var/ftp/pub}"
-- 
2.20.1


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

* [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr
  2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
  2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
@ 2020-10-15 12:20 ` Alexey Kodanev
  2020-10-26  7:06   ` Petr Vorel
  2020-10-15 12:20 ` [LTP] [PATCH 4/5] network/virt: add wireguard01 Alexey Kodanev
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-15 12:20 UTC (permalink / raw)
  To: ltp

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/virt/virt_lib.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index 80b9bcc90..f62120347 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -229,10 +229,13 @@ virt_minimize_timeout()
 	local mac_loc="$(cat /sys/class/net/ltp_v0/address)"
 	local mac_rmt="$(tst_rhost_run -c 'cat /sys/class/net/ltp_v0/address')"
 
-	ROD_SILENT "ip ne replace $ip_virt_remote lladdr \
-		    $mac_rmt nud permanent dev ltp_v0"
-	tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \
-			     $mac_loc nud permanent dev ltp_v0"
+	if [ "$mac_loc" ]; then
+		ROD_SILENT "ip ne replace $ip_virt_remote lladdr \
+			    $mac_rmt nud permanent dev ltp_v0"
+		tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \
+				     $mac_loc nud permanent dev ltp_v0"
+	fi
+
 	virt_tcp_syn=$(sysctl -n net.ipv4.tcp_syn_retries)
 	ROD sysctl -q net.ipv4.tcp_syn_retries=1
 }
-- 
2.20.1


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

* [LTP] [PATCH 4/5] network/virt: add wireguard01
  2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
  2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
  2020-10-15 12:20 ` [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr Alexey Kodanev
@ 2020-10-15 12:20 ` Alexey Kodanev
  2020-10-26  8:49   ` Petr Vorel
  2020-10-15 12:20 ` [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard Alexey Kodanev
  2020-10-20 13:52 ` [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Petr Vorel
  4 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-15 12:20 UTC (permalink / raw)
  To: ltp

* performance tests with TCP traffic

* invalid configuration with allowed IPs, public key

* emulation of the lossy link for the underlying interface.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 runtest/net.features                    |  3 ++
 testcases/network/virt/virt_lib.sh      |  4 +-
 testcases/network/virt/wireguard01.sh   | 56 ++++++++++++++++++++
 testcases/network/virt/wireguard_lib.sh | 68 +++++++++++++++++++++++++
 4 files changed, 129 insertions(+), 2 deletions(-)
 create mode 100755 testcases/network/virt/wireguard01.sh
 create mode 100755 testcases/network/virt/wireguard_lib.sh

diff --git a/runtest/net.features b/runtest/net.features
index 44a974563..c5a1ba714 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -78,3 +78,6 @@ mpls03_ipv6 mpls03.sh -6
 mpls04 mpls04.sh
 
 fanout01 fanout01
+
+wireguard01 wireguard01.sh
+wireguard01_ipv6 wireguard01.sh -6
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index f62120347..abf331428 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -124,7 +124,7 @@ virt_add()
 	esac
 
 	case $virt_type in
-	vxlan|geneve|sit)
+	vxlan|geneve|sit|wireguard)
 		ip li add $vname type $virt_type $opt
 	;;
 	gre|ip6gre)
@@ -145,7 +145,7 @@ virt_add_rhost()
 		[ "$vxlan_dstport" -eq 1 ] && opt="$opt dstport 0"
 		tst_rhost_run -s -c "ip li add ltp_v0 type $virt_type $@ $opt"
 	;;
-	sit)
+	sit|wireguard)
 		tst_rhost_run -s -c "ip link add ltp_v0 type $virt_type $@"
 	;;
 	gre|ip6gre)
diff --git a/testcases/network/virt/wireguard01.sh b/testcases/network/virt/wireguard01.sh
new file mode 100755
index 000000000..ff0c7e92b
--- /dev/null
+++ b/testcases/network/virt/wireguard01.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_NEEDS_CMDS="tc"
+TST_SETUP=setup
+TST_CLEANUP=cleanup
+TST_TESTFUNC=test
+TST_CNT=3
+
+. wireguard_lib.sh
+
+setup()
+{
+	if [ -n "$LTP_NETNS" -a "$VIRT_PERF_THRESHOLD" -lt 700 ]; then
+		tst_res TINFO "Adjust threshold for veth (no encap/encrypt)"
+		VIRT_PERF_THRESHOLD=700
+	fi
+
+	local netem_opt="reorder 30% 50% delay 1"
+	tst_res TINFO "Use netem $netem_opt"
+	ROD tc qdisc add dev $(tst_iface) root netem $netem_opt
+	wireguard_lib_setup
+}
+
+cleanup()
+{
+	tc qdisc del dev $(tst_iface) root netem >/dev/null 2>&1
+	wireguard_lib_cleanup
+}
+
+test1()
+{
+	tst_res TINFO "Using correct wireguard configuration"
+	virt_netperf_msg_sizes
+	wireguard_lib_cleanup
+}
+
+test2()
+{
+	tst_res TINFO "Invalid configuration with allowed IPs"
+	wireguard_lib_setup invalid_allowed_ips
+	virt_minimize_timeout
+	virt_compare_netperf "fail"
+	wireguard_lib_cleanup
+}
+
+test3()
+{
+	tst_res TINFO "Invalid configuration with public keys"
+	wireguard_lib_setup invalid_pub_keys
+	virt_minimize_timeout
+	virt_compare_netperf "fail"
+}
+
+tst_run
diff --git a/testcases/network/virt/wireguard_lib.sh b/testcases/network/virt/wireguard_lib.sh
new file mode 100755
index 000000000..c6ea7334e
--- /dev/null
+++ b/testcases/network/virt/wireguard_lib.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_CMDS="$TST_NEEDS_CMDS wg"
+TST_TESTFUNC=${TST_TESTFUNC:-virt_netperf_msg_sizes}
+TST_SETUP=${TST_SETUP:-wireguard_lib_setup}
+TST_CLEANUP=${TST_CLEANUP:-wireguard_lib_cleanup}
+TST_NEEDS_DRIVERS="wireguard"
+VIRT_PERF_THRESHOLD_MIN=${VIRT_PERF_THRESHOLD_MIN:-200}
+
+virt_type="wireguard"
+. virt_lib.sh
+
+# Usage: wireguard_lib_setup [TYPE]
+# TYPE: [ default | invalid_allowed_ips | invalid_pub_keys ]
+wireguard_lib_setup()
+{
+	local type="${1:-default}"
+	local pub_key0="$(wg genkey | tee wg0.key | wg pubkey)"
+	local pub_key1="$(wg genkey | tee wg1.key | wg pubkey)"
+
+	local port_loc="$(tst_get_unused_port ipv${TST_IPVER} dgram)"
+	local port_rmt=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} dgram")
+
+	# copy private key to remote host
+	tst_rhost_run -s -c "echo '$(cat wg1.key)' > wg1.key"
+
+	tst_res TINFO "setup wireguard UDPv${TST_IPVER} tunnel, port $port_loc/$port_rmt"
+	tst_res TINFO "lhost[$(tst_ipaddr)] <-> rhost[$(tst_ipaddr rhost)]"
+
+	virt_setup
+
+	local ka_opt="persistent-keepalive 1"
+	local allow_ip_loc="${ip_virt_local}/32,${ip6_virt_local}/128"
+	local allow_ip_rmt="${ip_virt_remote}/32,${ip6_virt_remote}/128"
+
+	case $type in
+	invalid_allowed_ips)
+		allow_ip_loc="${ip_virt_remote}/32,${ip6_virt_remote}/128"
+		allow_ip_rmt="${ip_virt_local}/32,${ip6_virt_local}/128"
+		tst_res TINFO "Allowed IPs are source IPs only"
+		;;
+	invalid_pub_keys)
+		pub_key0="$(wg genkey | wg pubkey)"
+		tst_res TINFO "Invalid peer public key of lhost"
+		;;
+	esac
+
+	ROD wg set ltp_v0 listen-port $port_loc private-key wg0.key
+	ROD wg set ltp_v0 peer $pub_key1 endpoint \
+		$(tst_ipaddr rhost):$port_rmt $ka_opt \
+		allowed-ips $allow_ip_rmt
+
+	tst_rhost_run -s -c \
+		"wg set ltp_v0 listen-port $port_rmt private-key wg1.key"
+	tst_rhost_run -s -c "wg set ltp_v0 peer $pub_key0 \
+		endpoint $(tst_ipaddr):$port_loc $ka_opt \
+		allowed-ips $allow_ip_loc"
+
+	tst_net_run -s "ip route add 128.0.0.0/1 dev ltp_v0"
+}
+
+wireguard_lib_cleanup()
+{
+	virt_cleanup
+}
-- 
2.20.1


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

* [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard
  2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
                   ` (2 preceding siblings ...)
  2020-10-15 12:20 ` [LTP] [PATCH 4/5] network/virt: add wireguard01 Alexey Kodanev
@ 2020-10-15 12:20 ` Alexey Kodanev
  2020-10-26  8:53   ` Petr Vorel
  2020-10-20 13:52 ` [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Petr Vorel
  4 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-15 12:20 UTC (permalink / raw)
  To: ltp

Compare multi-threading performance with IPSec/vti.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 runtest/net.features                  |  2 ++
 testcases/lib/tst_test.sh             |  2 +-
 testcases/network/virt/wireguard02.sh | 48 +++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100755 testcases/network/virt/wireguard02.sh

diff --git a/runtest/net.features b/runtest/net.features
index c5a1ba714..617a6b91e 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -81,3 +81,5 @@ fanout01 fanout01
 
 wireguard01 wireguard01.sh
 wireguard01_ipv6 wireguard01.sh -6
+wireguard02 wireguard02.sh
+wireguard02_ipv6 wireguard02.sh -6
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index f2bd1e3ef..2417da140 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -506,7 +506,7 @@ tst_run()
 			NEEDS_DRIVERS|FS_TYPE|MNTPOINT|MNT_PARAMS);;
 			IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);;
 			RETRY_FUNC|RETRY_FN_EXP_BACKOFF|TIMEOUT);;
-			NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG);;
+			NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG|NETLOAD_CLN_NUMBER);;
 			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
 			esac
 		done
diff --git a/testcases/network/virt/wireguard02.sh b/testcases/network/virt/wireguard02.sh
new file mode 100755
index 000000000..c16ae68d1
--- /dev/null
+++ b/testcases/network/virt/wireguard02.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_CLEANUP=cleanup
+TST_TESTFUNC=test1
+TST_SETUP=wireguard_lib_setup
+
+. ipsec_lib.sh
+. wireguard_lib.sh
+
+IPSEC_MODE="tunnel"
+IPSEC_PROTO="esp_aead"
+AEALGO="rfc4106_256"
+EALGO="aes"
+AALGO="sha256"
+
+cleanup()
+{
+	wireguard_lib_cleanup
+	tst_ipsec_cleanup
+}
+
+test1()
+{
+	local wgaddr
+	local clients_num="$TST_NETLOAD_CLN_NUMBER"
+
+	# Enforce multi-threading test, at least with 10 TCP clients
+	[ $clients_num -lt 10 ] && clients_num=10
+
+	tst_res TINFO "test wireguard"
+
+	[ -n "$TST_IPV6" ] && wgaddr="$ip6_virt_remote" || wgaddr="$ip_virt_remote"
+	tst_netload -H $wgaddr -a $clients_num -D ltp_v0
+	local time_wg=$(cat tst_netload.res)
+	wireguard_lib_cleanup
+
+	tst_res TINFO "test IPSec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
+	tst_ipsec_setup_vti
+	tst_netload -H $ip_rmt_tun -a $clients_num -D $tst_vti
+	local time_ipsec=$(cat tst_netload.res)
+	tst_ipsec_cleanup
+
+	tst_netload_compare $time_ipsec $time_wg -100
+}
+
+tst_run
-- 
2.20.1


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

* [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare()
  2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
                   ` (3 preceding siblings ...)
  2020-10-15 12:20 ` [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard Alexey Kodanev
@ 2020-10-20 13:52 ` Petr Vorel
  2020-10-21  9:18   ` Alexey Kodanev
  4 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2020-10-20 13:52 UTC (permalink / raw)
  To: ltp

Hi Alexey,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> * Remove duplicate code for comparing time-based results in
>   network tests (bbr, busy_poll, sctp, tcp fastopen, virt tests)

> * Expand thresholds for sctp, bbr test-cases, in order to avoid
>   false-positive failures.
I'm ok to keep more changes in single commit, but this change is affecting the
result, thus maybe put into separate commit?
(easier if somebody wants to bisect).

> * In virt_lib.sh, keep sign for VIRT_PERF_THRESHOLD.

> * TWARN when the base result is too bad (threshold_hi arg is set)

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>  testcases/lib/tst_net.sh                      | 31 +++++++++++++++++++
>  testcases/network/busy_poll/busy_poll01.sh    | 10 ++----
>  testcases/network/busy_poll/busy_poll02.sh    |  8 +----
>  testcases/network/busy_poll/busy_poll03.sh    |  8 +----
>  testcases/network/dccp/dccp01.sh              | 15 ++-------
>  testcases/network/sctp/sctp01.sh              |  8 +----
>  testcases/network/tcp_cc/bbr01.sh             |  2 +-
>  testcases/network/tcp_cc/bbr02.sh             |  2 +-
>  testcases/network/tcp_cc/dctcp01.sh           |  2 +-
>  testcases/network/tcp_cc/tcp_cc_lib.sh        |  8 +----
>  .../network/tcp_fastopen/tcp_fastopen_run.sh  | 15 ++-------
>  testcases/network/virt/virt_lib.sh            | 21 ++-----------
>  12 files changed, 46 insertions(+), 84 deletions(-)

> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index d939a5780..b29e076c3 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -741,6 +741,37 @@ tst_netload()
>  	return $ret
>  }

> +# Compares results for netload runs.
> +# tst_netload_compare TIME_BASE TIME THRESHOLD_LOW [THRESHOLD_HI]
> +# TIME_BASE: time taken to run netstress load test - 100%
> +# TIME: time that is compared to the base one
> +# THRESHOD_LOW: lower limit for TFAIL
> +# THRESHOD_HIGH: upper limit for TWARN
> +tst_netload_compare()
> +{
> +	local base_time=$1
> +	local new_time=$2
> +	local threshold_low=$3
> +	local threshold_hi=$4
> +
> +	if [ -z "$base_time" -o -z "$new_time" -o -z "$threshold_low" ]; then
> +		tst_brk_ TBROK "tst_netload_compare: invalid argument(s)"
> +	fi
> +
> +	local res=$(((base_time - new_time) * 100 / base_time))
> +	local msg="performance result is ${res}%"
> +
> +	if [ "$res" -lt "$threshold_low" ]; then
> +		tst_res_ TFAIL "$msg < threshold ${threshold_low}%"
> +		return
> +	fi
> +
> +	[ "$threshold_hi" ] && [ "$res" -gt "$threshold_hi" ] && \
> +		tst_res_ TWARN "$msg > threshold ${threshold_hi}%"
> +
> +	tst_res_ TPASS "$msg, in range [${threshold_low}:${threshold_hi:-}]%"

Do you mean ${threshold_hi:--} (to print "-" when $threshold_hi not set?)
As ${threshold_hi:-} prints empty string when unset (equivalent of ${threshold_hi}).


> +}

...

Kind regards,
Petr

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

* [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload()
  2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
@ 2020-10-20 14:39   ` Petr Vorel
  2020-10-21  9:56     ` Alexey Kodanev
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2020-10-20 14:39 UTC (permalink / raw)
  To: ltp

> Add TST_NETLOAD_RUN_COUNT to control how many times netstress
> test will be run to calculate the mean time value. Default is 5.

> This value will divide the total number of requests in order
> not to significantly increase the time for the test after this
> patch.

> Moreover, one of the runs can fail once, it will produce only a
> warning. The test will broke after the second failure. It can
> be useful to make sure we have reproducible results.

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>  testcases/lib/tst_net.sh | 95 ++++++++++++++++++++++++++--------------
>  1 file changed, 62 insertions(+), 33 deletions(-)

> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index b29e076c3..1912b984d 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -623,9 +623,11 @@ tst_wait_ipv6_dad()
>  	done
>  }

> -tst_dump_rhost_cmd()
> +tst_netload_brk()
>  {
>  	tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
> +	cat tst_netload.log
> +	tst_brk_ $1 $2
>  }

>  # Run network load test, see 'netstress -h' for option description
> @@ -640,6 +642,7 @@ tst_netload()
>  	# common options for client and server
>  	local cs_opts=

> +	local run_cnt="$TST_NETLOAD_RUN_COUNT"
>  	local c_num="$TST_NETLOAD_CLN_NUMBER"
>  	local c_requests="$TST_NETLOAD_CLN_REQUESTS"
>  	local c_opts=
> @@ -692,51 +695,76 @@ tst_netload()
>  	local expect_ret=0
>  	[ "$expect_res" != "pass" ] && expect_ret=3

> -	tst_rhost_run -c "pkill -9 netstress\$"
> -	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
> -	tst_res_ TINFO "run server 'netstress $s_opts'"
> -	tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
> -	if [ $? -ne 0 ]; then
> -		cat tst_netload.log
> -		local ttype="TFAIL"
> -		grep -e 'CONF:' tst_netload.log && ttype="TCONF"
> -		tst_brk_ $ttype "server failed"
> +	local was_failure=0
nit: I prefer have local variables at the top and boolean like variables as empty vs.
"1" (tested with [ "$foo" = 1 ] (see: if [ "$bind_to_device" = 1 -a "$TST_NETLOAD_BINDTODEVICE" = 1 ]; then
few lines above).

This style is used in tst_test.sh, which is consistent, but style in tst_net.sh
varies on this a lot. It's just a style and it wasn't introduced before this
commit, thus feel free to ignore it, but it'd be nice to be consistent in
library file.

> +	if [ "$run_cnt" -lt 2 ]; then
maybe: if [ "$run_cnt" -lt 1 ]; then

BTW we should also check all numeric variables (TST_NETLOAD_CLN_REQUESTS, ...)
with tst_is_int (but don't bother with it now).

> +		run_cnt=1
> +		was_failure=1
Hm, $was_failure set before loop. Shouldn't it be inside for i in $(seq 1
$run_cnt); do loop? And updated on each failure (be a error counter, not boolean)?
>  	fi

> -	local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
> -	c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port"
> +	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
> +	c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -d $rfile"
> +
> +	tst_res_ TINFO "run server 'netstress $s_opts'"
> +	tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times"

> -	tst_res_ TINFO "run client 'netstress -l $c_opts'"
> -	netstress -l $c_opts > tst_netload.log 2>&1 || ret=$?
>  	tst_rhost_run -c "pkill -9 netstress\$"
> +	rm -f tst_netload.log
> +
> +	local res=0
> +	local passed=0
> +
> +	for i in $(seq 1 $run_cnt); do
> +		tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
> +		if [ $? -ne 0 ]; then
> +			cat tst_netload.log
> +			local ttype="TFAIL"
> +			grep -e 'CONF:' tst_netload.log && ttype="TCONF"
> +			tst_brk_ $ttype "server failed"
> +		fi

> -	if [ "$expect_ret" -ne 0 ]; then
> -		if [ $((ret & expect_ret)) -ne 0 ]; then
> -			tst_res_ TPASS "netstress failed as expected"
> -		else
> -			tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
> +		local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
> +		netstress -l ${c_opts} -g $port > tst_netload.log 2>&1
> +		ret=$?
> +		tst_rhost_run -c "pkill -9 netstress\$"
> +
> +		if [ "$expect_ret" -ne 0 ]; then
> +			if [ $((ret & expect_ret)) -ne 0 ]; then
> +				tst_res_ TPASS "netstress failed as expected"
> +			else
> +				tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
> +			fi
> +			return $ret
> +		fi
> +
> +		if [ "$ret" -ne 0 ]; then
> +			[ $((ret & 32)) -ne 0 ] && \
> +				tst_netload_brk TCONF "not supported configuration"
> +
> +			[ $((ret & 3)) -ne 0 -a $was_failure -gt 0 ] && \
> +				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
Instead the 2 lines above maybe this? Or am I missing something?

			if [ $((ret & 3)) -ne 0 ]; then
				was_failure=$((was_failure+1))
			fi
			[ $was_failure -gt 0 ] && \
				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
> +
> +			tst_res_ TWARN "netstress failed, ret: $ret"
> +			was_failure=1
> +			continue
>  		fi
> -		return $ret
> -	fi
...

Kind regards,
Petr

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

* [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare()
  2020-10-20 13:52 ` [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Petr Vorel
@ 2020-10-21  9:18   ` Alexey Kodanev
  0 siblings, 0 replies; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-21  9:18 UTC (permalink / raw)
  To: ltp

On 20.10.2020 16:52, Petr Vorel wrote:
> Hi Alexey,
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
>> * Remove duplicate code for comparing time-based results in
>>   network tests (bbr, busy_poll, sctp, tcp fastopen, virt tests)
> 
>> * Expand thresholds for sctp, bbr test-cases, in order to avoid
>>   false-positive failures.
> I'm ok to keep more changes in single commit, but this change is affecting the
> result, thus maybe put into separate commit?
> (easier if somebody wants to bisect).
> 
Hi Petr,

Sure, will move it to the new one.


>> * In virt_lib.sh, keep sign for VIRT_PERF_THRESHOLD.
> 
>> * TWARN when the base result is too bad (threshold_hi arg is set)
> 
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>> ---
>>  testcases/lib/tst_net.sh                      | 31 +++++++++++++++++++
>>  testcases/network/busy_poll/busy_poll01.sh    | 10 ++----
>>  testcases/network/busy_poll/busy_poll02.sh    |  8 +----
>>  testcases/network/busy_poll/busy_poll03.sh    |  8 +----
>>  testcases/network/dccp/dccp01.sh              | 15 ++-------
>>  testcases/network/sctp/sctp01.sh              |  8 +----
>>  testcases/network/tcp_cc/bbr01.sh             |  2 +-
>>  testcases/network/tcp_cc/bbr02.sh             |  2 +-
>>  testcases/network/tcp_cc/dctcp01.sh           |  2 +-
>>  testcases/network/tcp_cc/tcp_cc_lib.sh        |  8 +----
>>  .../network/tcp_fastopen/tcp_fastopen_run.sh  | 15 ++-------
>>  testcases/network/virt/virt_lib.sh            | 21 ++-----------
>>  12 files changed, 46 insertions(+), 84 deletions(-)
> 
>> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
>> index d939a5780..b29e076c3 100644
>> --- a/testcases/lib/tst_net.sh
>> +++ b/testcases/lib/tst_net.sh
>> @@ -741,6 +741,37 @@ tst_netload()
>>  	return $ret
>>  }
> 
>> +# Compares results for netload runs.
>> +# tst_netload_compare TIME_BASE TIME THRESHOLD_LOW [THRESHOLD_HI]
>> +# TIME_BASE: time taken to run netstress load test - 100%
>> +# TIME: time that is compared to the base one
>> +# THRESHOD_LOW: lower limit for TFAIL
>> +# THRESHOD_HIGH: upper limit for TWARN
>> +tst_netload_compare()
>> +{
>> +	local base_time=$1
>> +	local new_time=$2
>> +	local threshold_low=$3
>> +	local threshold_hi=$4
>> +
>> +	if [ -z "$base_time" -o -z "$new_time" -o -z "$threshold_low" ]; then
>> +		tst_brk_ TBROK "tst_netload_compare: invalid argument(s)"
>> +	fi
>> +
>> +	local res=$(((base_time - new_time) * 100 / base_time))
>> +	local msg="performance result is ${res}%"
>> +
>> +	if [ "$res" -lt "$threshold_low" ]; then
>> +		tst_res_ TFAIL "$msg < threshold ${threshold_low}%"
>> +		return
>> +	fi
>> +
>> +	[ "$threshold_hi" ] && [ "$res" -gt "$threshold_hi" ] && \
>> +		tst_res_ TWARN "$msg > threshold ${threshold_hi}%"
>> +
>> +	tst_res_ TPASS "$msg, in range [${threshold_low}:${threshold_hi:-}]%"
> 
> Do you mean ${threshold_hi:--} (to print "-" when $threshold_hi not set?)
> As ${threshold_hi:-} prints empty string when unset (equivalent of ${threshold_hi}).
> 
> 

Yes, it's not really needed anymore. At some point I tried
to use different placeholders, a white-space etc... but it
fine as it is now, so will change to a simpler form.


>> +}
> 
> ...
> 
> Kind regards,
> Petr
> 


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

* [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload()
  2020-10-20 14:39   ` Petr Vorel
@ 2020-10-21  9:56     ` Alexey Kodanev
  2020-10-26  6:46       ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-21  9:56 UTC (permalink / raw)
  To: ltp

On 20.10.2020 17:39, Petr Vorel wrote:
>> Add TST_NETLOAD_RUN_COUNT to control how many times netstress
>> test will be run to calculate the mean time value. Default is 5.
> 
>> This value will divide the total number of requests in order
>> not to significantly increase the time for the test after this
>> patch.
> 
>> Moreover, one of the runs can fail once, it will produce only a
>> warning. The test will broke after the second failure. It can
>> be useful to make sure we have reproducible results.
> 
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
>> ---
>>  testcases/lib/tst_net.sh | 95 ++++++++++++++++++++++++++--------------
>>  1 file changed, 62 insertions(+), 33 deletions(-)
> 
>> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
>> index b29e076c3..1912b984d 100644
>> --- a/testcases/lib/tst_net.sh
>> +++ b/testcases/lib/tst_net.sh
>> @@ -623,9 +623,11 @@ tst_wait_ipv6_dad()
>>  	done
>>  }
> 
>> -tst_dump_rhost_cmd()
>> +tst_netload_brk()
>>  {
>>  	tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
>> +	cat tst_netload.log
>> +	tst_brk_ $1 $2
>>  }
> 
>>  # Run network load test, see 'netstress -h' for option description
>> @@ -640,6 +642,7 @@ tst_netload()
>>  	# common options for client and server
>>  	local cs_opts=
> 
>> +	local run_cnt="$TST_NETLOAD_RUN_COUNT"
>>  	local c_num="$TST_NETLOAD_CLN_NUMBER"
>>  	local c_requests="$TST_NETLOAD_CLN_REQUESTS"
>>  	local c_opts=
>> @@ -692,51 +695,76 @@ tst_netload()
>>  	local expect_ret=0
>>  	[ "$expect_res" != "pass" ] && expect_ret=3
> 
>> -	tst_rhost_run -c "pkill -9 netstress\$"
>> -	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
>> -	tst_res_ TINFO "run server 'netstress $s_opts'"
>> -	tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
>> -	if [ $? -ne 0 ]; then
>> -		cat tst_netload.log
>> -		local ttype="TFAIL"
>> -		grep -e 'CONF:' tst_netload.log && ttype="TCONF"
>> -		tst_brk_ $ttype "server failed"
>> +	local was_failure=0
> nit: I prefer have local variables at the top and boolean like variables as empty vs.
> "1" (tested with [ "$foo" = 1 ] (see: if [ "$bind_to_device" = 1 -a "$TST_NETLOAD_BINDTODEVICE" = 1 ]; then
> few lines above).
> 
> This style is used in tst_test.sh, which is consistent, but style in tst_net.sh
> varies on this a lot. It's just a style and it wasn't introduced before this
> commit, thus feel free to ignore it, but it'd be nice to be consistent in
> library file.
> 
>> +	if [ "$run_cnt" -lt 2 ]; then
> maybe: if [ "$run_cnt" -lt 1 ]; then
> 
> BTW we should also check all numeric variables (TST_NETLOAD_CLN_REQUESTS, ...)
> with tst_is_int (but don't bother with it now).
> 
>> +		run_cnt=1
>> +		was_failure=1
> Hm, $was_failure set before loop. Shouldn't it be inside for i in $(seq 1
> $run_cnt); do loop? And updated on each failure (be a error counter, not boolean)?


It is set to 1 for the special case, i.e. when run_cnt is 1, in that case
we should tbrok the test at once. I don't see how the error counter will be
better?

>>  	fi
> 
>> -	local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
>> -	c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port"
>> +	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
>> +	c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -d $rfile"
>> +
>> +	tst_res_ TINFO "run server 'netstress $s_opts'"
>> +	tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times"
> 
>> -	tst_res_ TINFO "run client 'netstress -l $c_opts'"
>> -	netstress -l $c_opts > tst_netload.log 2>&1 || ret=$?
>>  	tst_rhost_run -c "pkill -9 netstress\$"
>> +	rm -f tst_netload.log
>> +
>> +	local res=0
>> +	local passed=0
>> +
>> +	for i in $(seq 1 $run_cnt); do
>> +		tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
>> +		if [ $? -ne 0 ]; then
>> +			cat tst_netload.log
>> +			local ttype="TFAIL"
>> +			grep -e 'CONF:' tst_netload.log && ttype="TCONF"
>> +			tst_brk_ $ttype "server failed"
>> +		fi
> 
>> -	if [ "$expect_ret" -ne 0 ]; then
>> -		if [ $((ret & expect_ret)) -ne 0 ]; then
>> -			tst_res_ TPASS "netstress failed as expected"
>> -		else
>> -			tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
>> +		local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
>> +		netstress -l ${c_opts} -g $port > tst_netload.log 2>&1
>> +		ret=$?
>> +		tst_rhost_run -c "pkill -9 netstress\$"
>> +
>> +		if [ "$expect_ret" -ne 0 ]; then
>> +			if [ $((ret & expect_ret)) -ne 0 ]; then
>> +				tst_res_ TPASS "netstress failed as expected"
>> +			else
>> +				tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'"
>> +			fi
>> +			return $ret
>> +		fi
>> +
>> +		if [ "$ret" -ne 0 ]; then
>> +			[ $((ret & 32)) -ne 0 ] && \
>> +				tst_netload_brk TCONF "not supported configuration"
>> +
>> +			[ $((ret & 3)) -ne 0 -a $was_failure -gt 0 ] && \
>> +				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"
> Instead the 2 lines above maybe this? Or am I missing something?
> 
> 			if [ $((ret & 3)) -ne 0 ]; then
> 				was_failure=$((was_failure+1))
> 			fi
> 			[ $was_failure -gt 0 ] && \
> 				tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'"

With this, it should exit on the first error, as it was before this patch...

And I'm expecting to do this only on the second one, if run_cnt >= 2.


>> +
>> +			tst_res_ TWARN "netstress failed, ret: $ret"
>> +			was_failure=1
>> +			continue
>>  		fi
>> -		return $ret
>> -	fi
> ...
> 
> Kind regards,
> Petr
> 


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

* [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload()
  2020-10-21  9:56     ` Alexey Kodanev
@ 2020-10-26  6:46       ` Petr Vorel
  0 siblings, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2020-10-26  6:46 UTC (permalink / raw)
  To: ltp

Hi Alexey,

...
> >> +	if [ "$run_cnt" -lt 2 ]; then
> > maybe: if [ "$run_cnt" -lt 1 ]; then

> > BTW we should also check all numeric variables (TST_NETLOAD_CLN_REQUESTS, ...)
> > with tst_is_int (but don't bother with it now).

> >> +		run_cnt=1
> >> +		was_failure=1
> > Hm, $was_failure set before loop. Shouldn't it be inside for i in $(seq 1
> > $run_cnt); do loop? And updated on each failure (be a error counter, not boolean)?


> It is set to 1 for the special case, i.e. when run_cnt is 1, in that case
> we should tbrok the test at once. I don't see how the error counter will be
> better?

I'm sorry, I just misinterpret the code, please ignore my comment.


Kind regards,
Petr

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

* [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr
  2020-10-15 12:20 ` [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr Alexey Kodanev
@ 2020-10-26  7:06   ` Petr Vorel
  0 siblings, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2020-10-26  7:06 UTC (permalink / raw)
  To: ltp

Hi Alexey,

good idea.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
> index 80b9bcc90..f62120347 100644
> --- a/testcases/network/virt/virt_lib.sh
> +++ b/testcases/network/virt/virt_lib.sh
> @@ -229,10 +229,13 @@ virt_minimize_timeout()
>  	local mac_loc="$(cat /sys/class/net/ltp_v0/address)"
>  	local mac_rmt="$(tst_rhost_run -c 'cat /sys/class/net/ltp_v0/address')"

> -	ROD_SILENT "ip ne replace $ip_virt_remote lladdr \
> -		    $mac_rmt nud permanent dev ltp_v0"
> -	tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \
> -			     $mac_loc nud permanent dev ltp_v0"
> +	if [ "$mac_loc" ]; then
NOTE: I guess it's safe to check only $mac_rmt (and not $mac_rmt)

> +		ROD_SILENT "ip ne replace $ip_virt_remote lladdr \
> +			    $mac_rmt nud permanent dev ltp_v0"
> +		tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \
> +				     $mac_loc nud permanent dev ltp_v0"
> +	fi
> +
>  	virt_tcp_syn=$(sysctl -n net.ipv4.tcp_syn_retries)
>  	ROD sysctl -q net.ipv4.tcp_syn_retries=1
>  }

Kind regards,
Petr

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

* [LTP] [PATCH 4/5] network/virt: add wireguard01
  2020-10-15 12:20 ` [LTP] [PATCH 4/5] network/virt: add wireguard01 Alexey Kodanev
@ 2020-10-26  8:49   ` Petr Vorel
  2020-10-26 13:40     ` Alexey Kodanev
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2020-10-26  8:49 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> * performance tests with TCP traffic

> * invalid configuration with allowed IPs, public key

> * emulation of the lossy link for the underlying interface.

Thanks a lot for supporting wireguard!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> +TST_NEEDS_TMPDIR=1
> +TST_NEEDS_CMDS="$TST_NEEDS_CMDS wg"
> +TST_TESTFUNC=${TST_TESTFUNC:-virt_netperf_msg_sizes}
> +TST_SETUP=${TST_SETUP:-wireguard_lib_setup}
> +TST_CLEANUP=${TST_CLEANUP:-wireguard_lib_cleanup}
> +TST_NEEDS_DRIVERS="wireguard"
> +VIRT_PERF_THRESHOLD_MIN=${VIRT_PERF_THRESHOLD_MIN:-200}
> +
> +virt_type="wireguard"
> +. virt_lib.sh
> +
> +# Usage: wireguard_lib_setup [TYPE]
> +# TYPE: [ default | invalid_allowed_ips | invalid_pub_keys ]
> +wireguard_lib_setup()
> +{
> +	local type="${1:-default}"
> +	local pub_key0="$(wg genkey | tee wg0.key | wg pubkey)"
> +	local pub_key1="$(wg genkey | tee wg1.key | wg pubkey)"
> +
> +	local port_loc="$(tst_get_unused_port ipv${TST_IPVER} dgram)"
> +	local port_rmt=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} dgram")
> +
> +	# copy private key to remote host
> +	tst_rhost_run -s -c "echo '$(cat wg1.key)' > wg1.key"
> +
> +	tst_res TINFO "setup wireguard UDPv${TST_IPVER} tunnel, port $port_loc/$port_rmt"
> +	tst_res TINFO "lhost[$(tst_ipaddr)] <-> rhost[$(tst_ipaddr rhost)]"
> +
> +	virt_setup
> +
> +	local ka_opt="persistent-keepalive 1"
> +	local allow_ip_loc="${ip_virt_local}/32,${ip6_virt_local}/128"
> +	local allow_ip_rmt="${ip_virt_remote}/32,${ip6_virt_remote}/128"
> +
> +	case $type in
> +	invalid_allowed_ips)
> +		allow_ip_loc="${ip_virt_remote}/32,${ip6_virt_remote}/128"
> +		allow_ip_rmt="${ip_virt_local}/32,${ip6_virt_local}/128"
> +		tst_res TINFO "Allowed IPs are source IPs only"
> +		;;
> +	invalid_pub_keys)
> +		pub_key0="$(wg genkey | wg pubkey)"
> +		tst_res TINFO "Invalid peer public key of lhost"
> +		;;
> +	esac
> +
> +	ROD wg set ltp_v0 listen-port $port_loc private-key wg0.key
> +	ROD wg set ltp_v0 peer $pub_key1 endpoint \
> +		$(tst_ipaddr rhost):$port_rmt $ka_opt \
> +		allowed-ips $allow_ip_rmt
> +
> +	tst_rhost_run -s -c \
> +		"wg set ltp_v0 listen-port $port_rmt private-key wg1.key"
> +	tst_rhost_run -s -c "wg set ltp_v0 peer $pub_key0 \
> +		endpoint $(tst_ipaddr):$port_loc $ka_opt \
> +		allowed-ips $allow_ip_loc"
> +
> +	tst_net_run -s "ip route add 128.0.0.0/1 dev ltp_v0"
Out of curiosity: why is IPv4 enough? (we test also IPv6)

> +}
> +
> +wireguard_lib_cleanup()
> +{
> +	virt_cleanup
> +}

Why not use just virt_cleanup() ?

Kind regards,
Petr

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

* [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard
  2020-10-15 12:20 ` [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard Alexey Kodanev
@ 2020-10-26  8:53   ` Petr Vorel
  2020-10-30 15:20     ` Alexey Kodanev
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2020-10-26  8:53 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> Compare multi-threading performance with IPSec/vti.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

* [LTP] [PATCH 4/5] network/virt: add wireguard01
  2020-10-26  8:49   ` Petr Vorel
@ 2020-10-26 13:40     ` Alexey Kodanev
  2020-10-26 13:45       ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-26 13:40 UTC (permalink / raw)
  To: ltp

On 26.10.2020 11:49, Petr Vorel wrote:
> Hi Alexey,
> 
>> * performance tests with TCP traffic
> 
>> * invalid configuration with allowed IPs, public key
> 
>> * emulation of the lossy link for the underlying interface.
> 
> Thanks a lot for supporting wireguard!
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
> ...
>> +TST_NEEDS_TMPDIR=1
>> +TST_NEEDS_CMDS="$TST_NEEDS_CMDS wg"
>> +TST_TESTFUNC=${TST_TESTFUNC:-virt_netperf_msg_sizes}
>> +TST_SETUP=${TST_SETUP:-wireguard_lib_setup}
>> +TST_CLEANUP=${TST_CLEANUP:-wireguard_lib_cleanup}
>> +TST_NEEDS_DRIVERS="wireguard"
>> +VIRT_PERF_THRESHOLD_MIN=${VIRT_PERF_THRESHOLD_MIN:-200}
>> +
>> +virt_type="wireguard"
>> +. virt_lib.sh
>> +
>> +# Usage: wireguard_lib_setup [TYPE]
>> +# TYPE: [ default | invalid_allowed_ips | invalid_pub_keys ]
>> +wireguard_lib_setup()
>> +{
>> +	local type="${1:-default}"
>> +	local pub_key0="$(wg genkey | tee wg0.key | wg pubkey)"
>> +	local pub_key1="$(wg genkey | tee wg1.key | wg pubkey)"
>> +
>> +	local port_loc="$(tst_get_unused_port ipv${TST_IPVER} dgram)"
>> +	local port_rmt=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} dgram")
>> +
>> +	# copy private key to remote host
>> +	tst_rhost_run -s -c "echo '$(cat wg1.key)' > wg1.key"
>> +
>> +	tst_res TINFO "setup wireguard UDPv${TST_IPVER} tunnel, port $port_loc/$port_rmt"
>> +	tst_res TINFO "lhost[$(tst_ipaddr)] <-> rhost[$(tst_ipaddr rhost)]"
>> +
>> +	virt_setup
>> +
>> +	local ka_opt="persistent-keepalive 1"
>> +	local allow_ip_loc="${ip_virt_local}/32,${ip6_virt_local}/128"
>> +	local allow_ip_rmt="${ip_virt_remote}/32,${ip6_virt_remote}/128"
>> +
>> +	case $type in
>> +	invalid_allowed_ips)
>> +		allow_ip_loc="${ip_virt_remote}/32,${ip6_virt_remote}/128"
>> +		allow_ip_rmt="${ip_virt_local}/32,${ip6_virt_local}/128"
>> +		tst_res TINFO "Allowed IPs are source IPs only"
>> +		;;
>> +	invalid_pub_keys)
>> +		pub_key0="$(wg genkey | wg pubkey)"
>> +		tst_res TINFO "Invalid peer public key of lhost"
>> +		;;
>> +	esac
>> +
>> +	ROD wg set ltp_v0 listen-port $port_loc private-key wg0.key
>> +	ROD wg set ltp_v0 peer $pub_key1 endpoint \
>> +		$(tst_ipaddr rhost):$port_rmt $ka_opt \
>> +		allowed-ips $allow_ip_rmt
>> +
>> +	tst_rhost_run -s -c \
>> +		"wg set ltp_v0 listen-port $port_rmt private-key wg1.key"
>> +	tst_rhost_run -s -c "wg set ltp_v0 peer $pub_key0 \
>> +		endpoint $(tst_ipaddr):$port_loc $ka_opt \
>> +		allowed-ips $allow_ip_loc"
>> +
>> +	tst_net_run -s "ip route add 128.0.0.0/1 dev ltp_v0"
> Out of curiosity: why is IPv4 enough? (we test also IPv6)

Hi Petr,

Looks like no need for additional route table setup, and overriding
default route... tst_netload() uses addresses of wireguard device.
Will remove it.

> 
>> +}
>> +
>> +wireguard_lib_cleanup()
>> +{
>> +	virt_cleanup
>> +}
> 
> Why not use just virt_cleanup() ?

Yes, it's just a wrapper, but it is used in wirguard01/02 tests.
In case we need additional setup/cleanup we would have to change
both tests too.

> 
> Kind regards,
> Petr
> 


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

* [LTP] [PATCH 4/5] network/virt: add wireguard01
  2020-10-26 13:40     ` Alexey Kodanev
@ 2020-10-26 13:45       ` Petr Vorel
  0 siblings, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2020-10-26 13:45 UTC (permalink / raw)
  To: ltp

Hi Alexey,

...
> >> +	tst_net_run -s "ip route add 128.0.0.0/1 dev ltp_v0"
> > Out of curiosity: why is IPv4 enough? (we test also IPv6)

> Hi Petr,

> Looks like no need for additional route table setup, and overriding
> default route... tst_netload() uses addresses of wireguard device.
> Will remove it.
ack.

> >> +}
> >> +
> >> +wireguard_lib_cleanup()
> >> +{
> >> +	virt_cleanup
> >> +}

> > Why not use just virt_cleanup() ?

> Yes, it's just a wrapper, but it is used in wirguard01/02 tests.
> In case we need additional setup/cleanup we would have to change
> both tests too.

Sure, no problem. Looking forward this patchset to be merged :).
Thanks for your work!

Kind regards,
Petr

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

* [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard
  2020-10-26  8:53   ` Petr Vorel
@ 2020-10-30 15:20     ` Alexey Kodanev
  0 siblings, 0 replies; 16+ messages in thread
From: Alexey Kodanev @ 2020-10-30 15:20 UTC (permalink / raw)
  To: ltp

On 26.10.2020 11:53, Petr Vorel wrote:
> Hi Alexey,
> 
>> Compare multi-threading performance with IPSec/vti.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 

Thank you for review Petr!

Applied.

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

end of thread, other threads:[~2020-10-30 15:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
2020-10-20 14:39   ` Petr Vorel
2020-10-21  9:56     ` Alexey Kodanev
2020-10-26  6:46       ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr Alexey Kodanev
2020-10-26  7:06   ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 4/5] network/virt: add wireguard01 Alexey Kodanev
2020-10-26  8:49   ` Petr Vorel
2020-10-26 13:40     ` Alexey Kodanev
2020-10-26 13:45       ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard Alexey Kodanev
2020-10-26  8:53   ` Petr Vorel
2020-10-30 15:20     ` Alexey Kodanev
2020-10-20 13:52 ` [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Petr Vorel
2020-10-21  9:18   ` Alexey Kodanev

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.