summaryrefslogtreecommitdiff
path: root/samples/pktgen/parameters.sh
diff options
context:
space:
mode:
authorIgor Russkikh <irusskikh@marvell.com>2021-03-11 13:32:52 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-15 00:22:37 +0300
commitef700f2ea27e54f640c3957374469132e8bf46f5 (patch)
tree59f7e86cbf903da94841c1366cdcf64039970717 /samples/pktgen/parameters.sh
parent6f1629093399303bf19d6fcd5144061d1e25ec23 (diff)
downloadlinux-ef700f2ea27e54f640c3957374469132e8bf46f5.tar.xz
samples: pktgen: allow to specify delay parameter via new opt
DELAY may now be explicitly specified via common parameter -w Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/pktgen/parameters.sh')
-rw-r--r--samples/pktgen/parameters.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/samples/pktgen/parameters.sh b/samples/pktgen/parameters.sh
index ff0ed474fee9..dd6ef1d2e498 100644
--- a/samples/pktgen/parameters.sh
+++ b/samples/pktgen/parameters.sh
@@ -19,12 +19,13 @@ function usage() {
echo " -v : (\$VERBOSE) verbose"
echo " -x : (\$DEBUG) debug"
echo " -6 : (\$IP6) IPv6"
+ echo " -w : (\$DELAY) Tx Delay value (ns)"
echo ""
}
## --- Parse command line arguments / parameters ---
## echo "Commandline options:"
-while getopts "s:i:d:m:p:f:t:c:n:b:vxh6" option; do
+while getopts "s:i:d:m:p:f:t:c:n:b:w:vxh6" option; do
case $option in
i) # interface
export DEV=$OPTARG
@@ -66,6 +67,10 @@ while getopts "s:i:d:m:p:f:t:c:n:b:vxh6" option; do
export BURST=$OPTARG
info "SKB bursting: BURST=$BURST"
;;
+ w)
+ export DELAY=$OPTARG
+ info "DELAY=$DELAY"
+ ;;
v)
export VERBOSE=yes
info "Verbose mode: VERBOSE=$VERBOSE"
@@ -100,6 +105,9 @@ if [ -z "$THREADS" ]; then
export THREADS=1
fi
+# default DELAY
+[ -z "$DELAY" ] && export DELAY=0 # Zero means max speed
+
export L_THREAD=$(( THREADS + F_THREAD - 1 ))
if [ -z "$DEV" ]; then