summaryrefslogtreecommitdiffstats
path: root/samples/pktgen/pktgen_sample02_multiqueue.sh
diff options
context:
space:
mode:
authorJ.J. Martzki <mars14850@gmail.com>2023-07-01 16:37:37 +0200
committerDavid S. Miller <davem@davemloft.net>2023-07-03 10:15:26 +0200
commita27ac5390922059867f645eefd978e533d7af902 (patch)
treecc707a1806e2f0e82b1bc8cd9d088dd9e0838ae2 /samples/pktgen/pktgen_sample02_multiqueue.sh
parentselftests/net: Add xt_policy config for xfrm_policy test (diff)
downloadlinux-a27ac5390922059867f645eefd978e533d7af902.tar.xz
linux-a27ac5390922059867f645eefd978e533d7af902.zip
samples: pktgen: fix append mode failed issue
Each sample script sources functions.sh before parameters.sh which makes $APPEND undefined when trapping EXIT no matter in append mode or not. Due to this when sample scripts finished they always do "pgctrl reset" which resets pktgen config. So move trap to each script after sourcing parameters.sh and trap EXIT explicitly. Signed-off-by: J.J. Martzki <mars14850@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/pktgen/pktgen_sample02_multiqueue.sh')
-rwxr-xr-xsamples/pktgen/pktgen_sample02_multiqueue.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/pktgen/pktgen_sample02_multiqueue.sh b/samples/pktgen/pktgen_sample02_multiqueue.sh
index 7fa41c84c32f..93f33d7d0a81 100755
--- a/samples/pktgen/pktgen_sample02_multiqueue.sh
+++ b/samples/pktgen/pktgen_sample02_multiqueue.sh
@@ -14,6 +14,9 @@ root_check_run_with_sudo "$@"
# Required param: -i dev in $DEV
source ${basedir}/parameters.sh
+# Trap EXIT first
+trap_exit
+
[ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely
# Base Config