mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
6f16290933
commit
ef700f2ea2
10 changed files with 10 additions and 21 deletions
|
@ -28,6 +28,7 @@ across the sample scripts. Usage example is printed on errors::
|
||||||
-b : ($BURST) HW level bursting of SKBs
|
-b : ($BURST) HW level bursting of SKBs
|
||||||
-v : ($VERBOSE) verbose
|
-v : ($VERBOSE) verbose
|
||||||
-x : ($DEBUG) debug
|
-x : ($DEBUG) debug
|
||||||
|
-w : ($DELAY) Tx Delay value (ns)
|
||||||
|
|
||||||
The global variable being set is also listed. E.g. the required
|
The global variable being set is also listed. E.g. the required
|
||||||
interface/device parameter "-i" sets variable $DEV.
|
interface/device parameter "-i" sets variable $DEV.
|
||||||
|
|
|
@ -19,12 +19,13 @@ function usage() {
|
||||||
echo " -v : (\$VERBOSE) verbose"
|
echo " -v : (\$VERBOSE) verbose"
|
||||||
echo " -x : (\$DEBUG) debug"
|
echo " -x : (\$DEBUG) debug"
|
||||||
echo " -6 : (\$IP6) IPv6"
|
echo " -6 : (\$IP6) IPv6"
|
||||||
|
echo " -w : (\$DELAY) Tx Delay value (ns)"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
## --- Parse command line arguments / parameters ---
|
## --- Parse command line arguments / parameters ---
|
||||||
## echo "Commandline options:"
|
## 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
|
case $option in
|
||||||
i) # interface
|
i) # interface
|
||||||
export DEV=$OPTARG
|
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
|
export BURST=$OPTARG
|
||||||
info "SKB bursting: BURST=$BURST"
|
info "SKB bursting: BURST=$BURST"
|
||||||
;;
|
;;
|
||||||
|
w)
|
||||||
|
export DELAY=$OPTARG
|
||||||
|
info "DELAY=$DELAY"
|
||||||
|
;;
|
||||||
v)
|
v)
|
||||||
export VERBOSE=yes
|
export VERBOSE=yes
|
||||||
info "Verbose mode: VERBOSE=$VERBOSE"
|
info "Verbose mode: VERBOSE=$VERBOSE"
|
||||||
|
@ -100,6 +105,9 @@ if [ -z "$THREADS" ]; then
|
||||||
export THREADS=1
|
export THREADS=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# default DELAY
|
||||||
|
[ -z "$DELAY" ] && export DELAY=0 # Zero means max speed
|
||||||
|
|
||||||
export L_THREAD=$(( THREADS + F_THREAD - 1 ))
|
export L_THREAD=$(( THREADS + F_THREAD - 1 ))
|
||||||
|
|
||||||
if [ -z "$DEV" ]; then
|
if [ -z "$DEV" ]; then
|
||||||
|
|
|
@ -50,9 +50,6 @@ if [ -n "$DST_PORT" ]; then
|
||||||
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
# General cleanup everything since last run
|
# General cleanup everything since last run
|
||||||
pg_ctrl "reset"
|
pg_ctrl "reset"
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,6 @@ if [ -n "$DST_PORT" ]; then
|
||||||
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
# General cleanup everything since last run
|
# General cleanup everything since last run
|
||||||
pg_ctrl "reset"
|
pg_ctrl "reset"
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,6 @@ if [ -n "$DST_PORT" ]; then
|
||||||
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
# Flow variation random source port between min and max
|
# Flow variation random source port between min and max
|
||||||
UDP_SRC_MIN=9
|
UDP_SRC_MIN=9
|
||||||
UDP_SRC_MAX=109
|
UDP_SRC_MAX=109
|
||||||
|
|
|
@ -17,7 +17,6 @@ source ${basedir}/parameters.sh
|
||||||
[ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely
|
[ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely
|
||||||
|
|
||||||
# Base Config
|
# Base Config
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
|
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
|
||||||
|
|
||||||
# Flow variation random source port between min and max
|
# Flow variation random source port between min and max
|
||||||
|
|
|
@ -42,9 +42,6 @@ if [ -n "$DST_PORT" ]; then
|
||||||
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
# General cleanup everything since last run
|
# General cleanup everything since last run
|
||||||
pg_ctrl "reset"
|
pg_ctrl "reset"
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,6 @@ fi
|
||||||
[ -z "$FLOWS" ] && FLOWS="8000"
|
[ -z "$FLOWS" ] && FLOWS="8000"
|
||||||
[ -z "$FLOWLEN" ] && FLOWLEN="10"
|
[ -z "$FLOWLEN" ] && FLOWLEN="10"
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
if [[ -n "$BURST" ]]; then
|
if [[ -n "$BURST" ]]; then
|
||||||
err 1 "Bursting not supported for this mode"
|
err 1 "Bursting not supported for this mode"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,9 +31,6 @@ if [ -n "$DST_PORT" ]; then
|
||||||
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
validate_ports $UDP_DST_MIN $UDP_DST_MAX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base Config
|
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
|
|
||||||
# General cleanup everything since last run
|
# General cleanup everything since last run
|
||||||
pg_ctrl "reset"
|
pg_ctrl "reset"
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ root_check_run_with_sudo "$@"
|
||||||
source ${basedir}/parameters.sh
|
source ${basedir}/parameters.sh
|
||||||
|
|
||||||
# Base Config
|
# Base Config
|
||||||
DELAY="0" # Zero means max speed
|
|
||||||
[ -z "$COUNT" ] && COUNT="20000000" # Zero means indefinitely
|
[ -z "$COUNT" ] && COUNT="20000000" # Zero means indefinitely
|
||||||
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
|
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue