diff mbox series

[RFC,for-faizal,2/4] selftests: net: tsn: push --txtime out of isochron_do()

Message ID 20231221132521.2314811-3-vladimir.oltean@nxp.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series tc-taprio selftests | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 8 maintainers not CCed: edumazet@google.com alexandre.belloni@bootlin.com shuah@kernel.org pabeni@redhat.com kuba@kernel.org UNGLinuxDriver@microchip.com linux-kselftest@vger.kernel.org claudiu.manoil@nxp.com
netdev/build_clang fail Errors and warnings before: 12 this patch: 12
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest fail Script tsn_lib.sh not found in tools/testing/selftests/net/forwarding/Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: line length of 83 exceeds 80 columns WARNING: line length of 88 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Vladimir Oltean Dec. 21, 2023, 1:25 p.m. UTC
Not all isochron tests should use the --txtime option. Make the
sender_extra_args and receiver_extra_args be provided by the caller, and
move --txtime to the ocelot psfp.sh test.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 .../selftests/drivers/net/ocelot/psfp.sh      |  1 +
 .../selftests/net/forwarding/tsn_lib.sh       | 21 +++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/ocelot/psfp.sh b/tools/testing/selftests/drivers/net/ocelot/psfp.sh
index bed748dde4b0..e6042b678c09 100755
--- a/tools/testing/selftests/drivers/net/ocelot/psfp.sh
+++ b/tools/testing/selftests/drivers/net/ocelot/psfp.sh
@@ -270,6 +270,7 @@  run_test()
 		"${STREAM_VID}" \
 		"${STREAM_PRIO}" \
 		"" \
+		"--txtime" "" \
 		"${isochron_dat}"
 
 	# Count all received packets by looking at the non-zero RX timestamps
diff --git a/tools/testing/selftests/net/forwarding/tsn_lib.sh b/tools/testing/selftests/net/forwarding/tsn_lib.sh
index b91bcd8008a9..f081cebb1c65 100644
--- a/tools/testing/selftests/net/forwarding/tsn_lib.sh
+++ b/tools/testing/selftests/net/forwarding/tsn_lib.sh
@@ -186,9 +186,9 @@  isochron_do()
 	local vid=$1; shift
 	local priority=$1; shift
 	local dst_ip=$1; shift
+	local sender_extra_args="$1"; shift
+	local receiver_extra_args="$1"; shift
 	local isochron_dat=$1; shift
-	local extra_args=""
-	local receiver_extra_args=""
 	local vrf="$(master_name_get ${sender_if_name})"
 	local use_l2="true"
 
@@ -205,19 +205,19 @@  isochron_do()
 	fi
 
 	if [ -z "${receiver_uds}" ]; then
-		extra_args="${extra_args} --omit-remote-sync"
+		sender_extra_args="${sender_extra_args} --omit-remote-sync"
 	fi
 
 	if ! [ -z "${shift_time}" ]; then
-		extra_args="${extra_args} --shift-time=${shift_time}"
+		sender_extra_args="${sender_extra_args} --shift-time=${shift_time}"
 	fi
 
 	if [ "${use_l2}" = "true" ]; then
-		extra_args="${extra_args} --l2 --etype=0xdead ${vid}"
-		receiver_extra_args="--l2 --etype=0xdead"
+		sender_extra_args="${sender_extra_args} --l2 --etype=0xdead ${vid}"
+		receiver_extra_args="${receiver_extra_args} --l2 --etype=0xdead"
 	else
-		extra_args="${extra_args} --l4 --ip-destination=${dst_ip}"
-		receiver_extra_args="--l4"
+		sender_extra_args="${sender_extra_args} --l4 --ip-destination=${dst_ip}"
+		receiver_extra_args="${receiver_extra_args} --l4"
 	fi
 
 	cpufreq_max ${ISOCHRON_CPU}
@@ -232,7 +232,6 @@  isochron_do()
 		--cycle-time ${cycle_time} \
 		--num-frames ${num_pkts} \
 		--frame-size 64 \
-		--txtime \
 		--utc-tai-offset ${UTC_TAI_OFFSET} \
 		--cpu-mask $((1 << ${ISOCHRON_CPU})) \
 		--sched-fifo \
@@ -240,8 +239,8 @@  isochron_do()
 		--client 127.0.0.1 \
 		--sync-threshold 5000 \
 		--output-file ${isochron_dat} \
-		${extra_args} \
-		--quiet
+		--quiet \
+		${sender_extra_args}
 
 	isochron_recv_stop 5000