Commit ef700f2e authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller
Browse files

samples: pktgen: allow to specify delay parameter via new opt



DELAY may now be explicitly specified via common parameter -w

Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f162909
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ across the sample scripts. Usage example is printed on errors::
  -b : ($BURST)     HW level bursting of SKBs
  -v : ($VERBOSE)   verbose
  -x : ($DEBUG)     debug
  -w : ($DELAY)     Tx Delay value (ns)

The global variable being set is also listed.  E.g. the required
interface/device parameter "-i" sets variable $DEV.
+9 −1
Original line number Diff line number Diff line
@@ -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
+0 −3
Original line number Diff line number Diff line
@@ -50,9 +50,6 @@ if [ -n "$DST_PORT" ]; then
    validate_ports $UDP_DST_MIN $UDP_DST_MAX
fi

# Base Config
DELAY="0"        # Zero means max speed

# General cleanup everything since last run
pg_ctrl "reset"

+0 −3
Original line number Diff line number Diff line
@@ -33,9 +33,6 @@ if [ -n "$DST_PORT" ]; then
    validate_ports $UDP_DST_MIN $UDP_DST_MAX
fi

# Base Config
DELAY="0"        # Zero means max speed

# General cleanup everything since last run
pg_ctrl "reset"

+0 −3
Original line number Diff line number Diff line
@@ -31,9 +31,6 @@ if [ -n "$DST_PORT" ]; then
    validate_ports $UDP_DST_MIN $UDP_DST_MAX
fi

# Base Config
DELAY="0"        # Zero means max speed

# Flow variation random source port between min and max
UDP_SRC_MIN=9
UDP_SRC_MAX=109
Loading