Commit 69137ea6 authored by Tariq Toukan's avatar Tariq Toukan Committed by David S. Miller

pktgen: Specify num packets per thread

Use -n <num>, to specify the number of packets every
thread sends.
Zero means indefinitely.
Signed-off-by: default avatarTariq Toukan <[email protected]>
Cc: Jesper Dangaard Brouer <[email protected]>
Acked-by: default avatarJesper Dangaard Brouer <[email protected]>
Signed-off-by: default avatarDavid S. Miller <[email protected]>
parent cb7fbb64
......@@ -22,6 +22,7 @@ across the sample scripts. Usage example is printed on errors::
-m : ($DST_MAC) destination MAC-addr
-t : ($THREADS) threads to start
-c : ($SKB_CLONE) SKB clones send before alloc new SKB
-n : ($COUNT) num messages to send per thread, 0 means indefinitely
-b : ($BURST) HW level bursting of SKBs
-v : ($VERBOSE) verbose
-x : ($DEBUG) debug
......
......@@ -11,6 +11,7 @@ function usage() {
echo " -m : (\$DST_MAC) destination MAC-addr"
echo " -t : (\$THREADS) threads to start"
echo " -c : (\$SKB_CLONE) SKB clones send before alloc new SKB"
echo " -n : (\$COUNT) num messages to send per thread, 0 means indefinitely"
echo " -b : (\$BURST) HW level bursting of SKBs"
echo " -v : (\$VERBOSE) verbose"
echo " -x : (\$DEBUG) debug"
......@@ -20,7 +21,7 @@ function usage() {
## --- Parse command line arguments / parameters ---
## echo "Commandline options:"
while getopts "s:i:d:m:t:c:b:vxh6" option; do
while getopts "s:i:d:m:t:c:n:b:vxh6" option; do
case $option in
i) # interface
export DEV=$OPTARG
......@@ -48,6 +49,10 @@ while getopts "s:i:d:m:t:c:b:vxh6" option; do
export CLONE_SKB=$OPTARG
info "CLONE_SKB=$CLONE_SKB"
;;
n)
export COUNT=$OPTARG
info "COUNT=$COUNT"
;;
b)
export BURST=$OPTARG
info "SKB bursting: BURST=$BURST"
......
......@@ -39,10 +39,10 @@ if [ -z "$DEST_IP" ]; then
fi
[ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff"
[ -z "$BURST" ] && BURST=1024
[ -z "$COUNT" ] && COUNT="10000000" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="10000000" # Zero means indefinitely
# General cleanup everything since last run
pg_ctrl "reset"
......
......@@ -22,10 +22,10 @@ fi
if [[ -n "$BURST" ]]; then
err 1 "Bursting not supported for this mode"
fi
[ -z "$COUNT" ] && COUNT="10000000" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="10000000" # Zero means indefinitely
# General cleanup everything since last run
pg_ctrl "reset"
......
......@@ -20,10 +20,10 @@ fi
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
# Example enforce param "-m" for dst_mac
[ -z "$DST_MAC" ] && usage && err 2 "Must specify -m dst_mac"
[ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="100000" # Zero means indefinitely
# Flow variation random source port between min and max
UDP_MIN=9
......
......@@ -13,9 +13,10 @@ root_check_run_with_sudo "[email protected]"
# Required param: -i dev in $DEV
source ${basedir}/parameters.sh
[ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="100000" # Zero means indefinitely
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
# Flow variation random source port between min and max
......
......@@ -31,10 +31,10 @@ fi
[ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff"
[ -z "$BURST" ] && BURST=32
[ -z "$CLONE_SKB" ] && CLONE_SKB="100000"
[ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="0" # Zero means indefinitely
# General cleanup everything since last run
pg_ctrl "reset"
......
......@@ -15,6 +15,7 @@ source ${basedir}/parameters.sh
[ -z "$DEST_IP" ] && DEST_IP="198.18.0.42"
[ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff"
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
[ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely
# NOTICE: Script specific settings
# =======
......@@ -26,7 +27,6 @@ source ${basedir}/parameters.sh
# Base Config
DELAY="0" # Zero means max speed
COUNT="0" # Zero means indefinitely
if [[ -n "$BURST" ]]; then
err 1 "Bursting not supported for this mode"
......
......@@ -20,11 +20,11 @@ source ${basedir}/parameters.sh
[ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff"
[ -z "$CLONE_SKB" ] && CLONE_SKB="0"
[ -z "$BURST" ] && BURST=32
[ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely
# Base Config
DELAY="0" # Zero means max speed
COUNT="0" # Zero means indefinitely
# General cleanup everything since last run
pg_ctrl "reset"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment