Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Igor Russkikh and committed by
David S. Miller
ef700f2e 6f162909

+10 -21
+1
samples/pktgen/README.rst
··· 28 28 -b : ($BURST) HW level bursting of SKBs 29 29 -v : ($VERBOSE) verbose 30 30 -x : ($DEBUG) debug 31 + -w : ($DELAY) Tx Delay value (ns) 31 32 32 33 The global variable being set is also listed. E.g. the required 33 34 interface/device parameter "-i" sets variable $DEV.
+9 -1
samples/pktgen/parameters.sh
··· 19 19 echo " -v : (\$VERBOSE) verbose" 20 20 echo " -x : (\$DEBUG) debug" 21 21 echo " -6 : (\$IP6) IPv6" 22 + echo " -w : (\$DELAY) Tx Delay value (ns)" 22 23 echo "" 23 24 } 24 25 25 26 ## --- Parse command line arguments / parameters --- 26 27 ## echo "Commandline options:" 27 - while getopts "s:i:d:m:p:f:t:c:n:b:vxh6" option; do 28 + while getopts "s:i:d:m:p:f:t:c:n:b:w:vxh6" option; do 28 29 case $option in 29 30 i) # interface 30 31 export DEV=$OPTARG ··· 67 66 export BURST=$OPTARG 68 67 info "SKB bursting: BURST=$BURST" 69 68 ;; 69 + w) 70 + export DELAY=$OPTARG 71 + info "DELAY=$DELAY" 72 + ;; 70 73 v) 71 74 export VERBOSE=yes 72 75 info "Verbose mode: VERBOSE=$VERBOSE" ··· 104 99 if [ -z "$THREADS" ]; then 105 100 export THREADS=1 106 101 fi 102 + 103 + # default DELAY 104 + [ -z "$DELAY" ] && export DELAY=0 # Zero means max speed 107 105 108 106 export L_THREAD=$(( THREADS + F_THREAD - 1 )) 109 107
-3
samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh
··· 50 50 validate_ports $UDP_DST_MIN $UDP_DST_MAX 51 51 fi 52 52 53 - # Base Config 54 - DELAY="0" # Zero means max speed 55 - 56 53 # General cleanup everything since last run 57 54 pg_ctrl "reset" 58 55
-3
samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh
··· 33 33 validate_ports $UDP_DST_MIN $UDP_DST_MAX 34 34 fi 35 35 36 - # Base Config 37 - DELAY="0" # Zero means max speed 38 - 39 36 # General cleanup everything since last run 40 37 pg_ctrl "reset" 41 38
-3
samples/pktgen/pktgen_sample01_simple.sh
··· 31 31 validate_ports $UDP_DST_MIN $UDP_DST_MAX 32 32 fi 33 33 34 - # Base Config 35 - DELAY="0" # Zero means max speed 36 - 37 34 # Flow variation random source port between min and max 38 35 UDP_SRC_MIN=9 39 36 UDP_SRC_MAX=109
-1
samples/pktgen/pktgen_sample02_multiqueue.sh
··· 17 17 [ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely 18 18 19 19 # Base Config 20 - DELAY="0" # Zero means max speed 21 20 [ -z "$CLONE_SKB" ] && CLONE_SKB="0" 22 21 23 22 # Flow variation random source port between min and max
-3
samples/pktgen/pktgen_sample03_burst_single_flow.sh
··· 42 42 validate_ports $UDP_DST_MIN $UDP_DST_MAX 43 43 fi 44 44 45 - # Base Config 46 - DELAY="0" # Zero means max speed 47 - 48 45 # General cleanup everything since last run 49 46 pg_ctrl "reset" 50 47
-3
samples/pktgen/pktgen_sample04_many_flows.sh
··· 34 34 [ -z "$FLOWS" ] && FLOWS="8000" 35 35 [ -z "$FLOWLEN" ] && FLOWLEN="10" 36 36 37 - # Base Config 38 - DELAY="0" # Zero means max speed 39 - 40 37 if [[ -n "$BURST" ]]; then 41 38 err 1 "Bursting not supported for this mode" 42 39 fi
-3
samples/pktgen/pktgen_sample05_flow_per_thread.sh
··· 31 31 validate_ports $UDP_DST_MIN $UDP_DST_MAX 32 32 fi 33 33 34 - # Base Config 35 - DELAY="0" # Zero means max speed 36 - 37 34 # General cleanup everything since last run 38 35 pg_ctrl "reset" 39 36
-1
samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh
··· 15 15 source ${basedir}/parameters.sh 16 16 17 17 # Base Config 18 - DELAY="0" # Zero means max speed 19 18 [ -z "$COUNT" ] && COUNT="20000000" # Zero means indefinitely 20 19 [ -z "$CLONE_SKB" ] && CLONE_SKB="0" 21 20