diff options
author | Tariq Toukan <tariqt@mellanox.com> | 2017-06-15 12:07:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-16 12:32:34 -0400 |
commit | 69137ea60c9dad58773a1918de6c1b00b088520c (patch) | |
tree | 6300bfe517a2d5cb0c0e8edb71fd6119988d2ec4 | |
parent | cb7fbb6470aaadf6786d00af1664703f794788ac (diff) |
pktgen: Specify num packets per thread
Use -n <num>, to specify the number of packets every
thread sends.
Zero means indefinitely.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | samples/pktgen/README.rst | 1 | ||||
-rw-r--r-- | samples/pktgen/parameters.sh | 7 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh | 2 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | 2 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_sample01_simple.sh | 2 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_sample02_multiqueue.sh | 3 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_sample03_burst_single_flow.sh | 2 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_sample04_many_flows.sh | 2 | ||||
-rwxr-xr-x | samples/pktgen/pktgen_sample05_flow_per_thread.sh | 2 |
9 files changed, 15 insertions, 8 deletions
diff --git a/samples/pktgen/README.rst b/samples/pktgen/README.rst index 8365c4e5c513..c018d67da1a1 100644 --- a/samples/pktgen/README.rst +++ b/samples/pktgen/README.rst | |||
@@ -22,6 +22,7 @@ across the sample scripts. Usage example is printed on errors:: | |||
22 | -m : ($DST_MAC) destination MAC-addr | 22 | -m : ($DST_MAC) destination MAC-addr |
23 | -t : ($THREADS) threads to start | 23 | -t : ($THREADS) threads to start |
24 | -c : ($SKB_CLONE) SKB clones send before alloc new SKB | 24 | -c : ($SKB_CLONE) SKB clones send before alloc new SKB |
25 | -n : ($COUNT) num messages to send per thread, 0 means indefinitely | ||
25 | -b : ($BURST) HW level bursting of SKBs | 26 | -b : ($BURST) HW level bursting of SKBs |
26 | -v : ($VERBOSE) verbose | 27 | -v : ($VERBOSE) verbose |
27 | -x : ($DEBUG) debug | 28 | -x : ($DEBUG) debug |
diff --git a/samples/pktgen/parameters.sh b/samples/pktgen/parameters.sh index f70ea7dd5660..036147594a20 100644 --- a/samples/pktgen/parameters.sh +++ b/samples/pktgen/parameters.sh | |||
@@ -11,6 +11,7 @@ function usage() { | |||
11 | echo " -m : (\$DST_MAC) destination MAC-addr" | 11 | echo " -m : (\$DST_MAC) destination MAC-addr" |
12 | echo " -t : (\$THREADS) threads to start" | 12 | echo " -t : (\$THREADS) threads to start" |
13 | echo " -c : (\$SKB_CLONE) SKB clones send before alloc new SKB" | 13 | echo " -c : (\$SKB_CLONE) SKB clones send before alloc new SKB" |
14 | echo " -n : (\$COUNT) num messages to send per thread, 0 means indefinitely" | ||
14 | echo " -b : (\$BURST) HW level bursting of SKBs" | 15 | echo " -b : (\$BURST) HW level bursting of SKBs" |
15 | echo " -v : (\$VERBOSE) verbose" | 16 | echo " -v : (\$VERBOSE) verbose" |
16 | echo " -x : (\$DEBUG) debug" | 17 | echo " -x : (\$DEBUG) debug" |
@@ -20,7 +21,7 @@ function usage() { | |||
20 | 21 | ||
21 | ## --- Parse command line arguments / parameters --- | 22 | ## --- Parse command line arguments / parameters --- |
22 | ## echo "Commandline options:" | 23 | ## echo "Commandline options:" |
23 | while getopts "s:i:d:m:t:c:b:vxh6" option; do | 24 | while getopts "s:i:d:m:t:c:n:b:vxh6" option; do |
24 | case $option in | 25 | case $option in |
25 | i) # interface | 26 | i) # interface |
26 | export DEV=$OPTARG | 27 | export DEV=$OPTARG |
@@ -48,6 +49,10 @@ while getopts "s:i:d:m:t:c:b:vxh6" option; do | |||
48 | export CLONE_SKB=$OPTARG | 49 | export CLONE_SKB=$OPTARG |
49 | info "CLONE_SKB=$CLONE_SKB" | 50 | info "CLONE_SKB=$CLONE_SKB" |
50 | ;; | 51 | ;; |
52 | n) | ||
53 | export COUNT=$OPTARG | ||
54 | info "COUNT=$COUNT" | ||
55 | ;; | ||
51 | b) | 56 | b) |
52 | export BURST=$OPTARG | 57 | export BURST=$OPTARG |
53 | info "SKB bursting: BURST=$BURST" | 58 | info "SKB bursting: BURST=$BURST" |
diff --git a/samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh b/samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh index f3e1bedfd77f..d2694a12de61 100755 --- a/samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh +++ b/samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh | |||
@@ -39,10 +39,10 @@ if [ -z "$DEST_IP" ]; then | |||
39 | fi | 39 | fi |
40 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" | 40 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" |
41 | [ -z "$BURST" ] && BURST=1024 | 41 | [ -z "$BURST" ] && BURST=1024 |
42 | [ -z "$COUNT" ] && COUNT="10000000" # Zero means indefinitely | ||
42 | 43 | ||
43 | # Base Config | 44 | # Base Config |
44 | DELAY="0" # Zero means max speed | 45 | DELAY="0" # Zero means max speed |
45 | COUNT="10000000" # Zero means indefinitely | ||
46 | 46 | ||
47 | # General cleanup everything since last run | 47 | # General cleanup everything since last run |
48 | pg_ctrl "reset" | 48 | pg_ctrl "reset" |
diff --git a/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh b/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh index cc102e923241..43604c2db726 100755 --- a/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh +++ b/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | |||
@@ -22,10 +22,10 @@ fi | |||
22 | if [[ -n "$BURST" ]]; then | 22 | if [[ -n "$BURST" ]]; then |
23 | err 1 "Bursting not supported for this mode" | 23 | err 1 "Bursting not supported for this mode" |
24 | fi | 24 | fi |
25 | [ -z "$COUNT" ] && COUNT="10000000" # Zero means indefinitely | ||
25 | 26 | ||
26 | # Base Config | 27 | # Base Config |
27 | DELAY="0" # Zero means max speed | 28 | DELAY="0" # Zero means max speed |
28 | COUNT="10000000" # Zero means indefinitely | ||
29 | 29 | ||
30 | # General cleanup everything since last run | 30 | # General cleanup everything since last run |
31 | pg_ctrl "reset" | 31 | pg_ctrl "reset" |
diff --git a/samples/pktgen/pktgen_sample01_simple.sh b/samples/pktgen/pktgen_sample01_simple.sh index 29ef4ba50796..35b7fe34bda2 100755 --- a/samples/pktgen/pktgen_sample01_simple.sh +++ b/samples/pktgen/pktgen_sample01_simple.sh | |||
@@ -20,10 +20,10 @@ fi | |||
20 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" | 20 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" |
21 | # Example enforce param "-m" for dst_mac | 21 | # Example enforce param "-m" for dst_mac |
22 | [ -z "$DST_MAC" ] && usage && err 2 "Must specify -m dst_mac" | 22 | [ -z "$DST_MAC" ] && usage && err 2 "Must specify -m dst_mac" |
23 | [ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely | ||
23 | 24 | ||
24 | # Base Config | 25 | # Base Config |
25 | DELAY="0" # Zero means max speed | 26 | DELAY="0" # Zero means max speed |
26 | COUNT="100000" # Zero means indefinitely | ||
27 | 27 | ||
28 | # Flow variation random source port between min and max | 28 | # Flow variation random source port between min and max |
29 | UDP_MIN=9 | 29 | UDP_MIN=9 |
diff --git a/samples/pktgen/pktgen_sample02_multiqueue.sh b/samples/pktgen/pktgen_sample02_multiqueue.sh index c88a161d3e6f..164194d1c79b 100755 --- a/samples/pktgen/pktgen_sample02_multiqueue.sh +++ b/samples/pktgen/pktgen_sample02_multiqueue.sh | |||
@@ -13,9 +13,10 @@ root_check_run_with_sudo "$@" | |||
13 | # Required param: -i dev in $DEV | 13 | # Required param: -i dev in $DEV |
14 | source ${basedir}/parameters.sh | 14 | source ${basedir}/parameters.sh |
15 | 15 | ||
16 | [ -z "$COUNT" ] && COUNT="100000" # Zero means indefinitely | ||
17 | |||
16 | # Base Config | 18 | # Base Config |
17 | DELAY="0" # Zero means max speed | 19 | DELAY="0" # Zero means max speed |
18 | COUNT="100000" # Zero means indefinitely | ||
19 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" | 20 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" |
20 | 21 | ||
21 | # Flow variation random source port between min and max | 22 | # Flow variation random source port between min and max |
diff --git a/samples/pktgen/pktgen_sample03_burst_single_flow.sh b/samples/pktgen/pktgen_sample03_burst_single_flow.sh index 80cf8f5ba6b2..e03dd4cd05ce 100755 --- a/samples/pktgen/pktgen_sample03_burst_single_flow.sh +++ b/samples/pktgen/pktgen_sample03_burst_single_flow.sh | |||
@@ -31,10 +31,10 @@ fi | |||
31 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" | 31 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" |
32 | [ -z "$BURST" ] && BURST=32 | 32 | [ -z "$BURST" ] && BURST=32 |
33 | [ -z "$CLONE_SKB" ] && CLONE_SKB="100000" | 33 | [ -z "$CLONE_SKB" ] && CLONE_SKB="100000" |
34 | [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely | ||
34 | 35 | ||
35 | # Base Config | 36 | # Base Config |
36 | DELAY="0" # Zero means max speed | 37 | DELAY="0" # Zero means max speed |
37 | COUNT="0" # Zero means indefinitely | ||
38 | 38 | ||
39 | # General cleanup everything since last run | 39 | # General cleanup everything since last run |
40 | pg_ctrl "reset" | 40 | pg_ctrl "reset" |
diff --git a/samples/pktgen/pktgen_sample04_many_flows.sh b/samples/pktgen/pktgen_sample04_many_flows.sh index f60412e445bb..0fc72d2bcd31 100755 --- a/samples/pktgen/pktgen_sample04_many_flows.sh +++ b/samples/pktgen/pktgen_sample04_many_flows.sh | |||
@@ -15,6 +15,7 @@ source ${basedir}/parameters.sh | |||
15 | [ -z "$DEST_IP" ] && DEST_IP="198.18.0.42" | 15 | [ -z "$DEST_IP" ] && DEST_IP="198.18.0.42" |
16 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" | 16 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" |
17 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" | 17 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" |
18 | [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely | ||
18 | 19 | ||
19 | # NOTICE: Script specific settings | 20 | # NOTICE: Script specific settings |
20 | # ======= | 21 | # ======= |
@@ -26,7 +27,6 @@ source ${basedir}/parameters.sh | |||
26 | 27 | ||
27 | # Base Config | 28 | # Base Config |
28 | DELAY="0" # Zero means max speed | 29 | DELAY="0" # Zero means max speed |
29 | COUNT="0" # Zero means indefinitely | ||
30 | 30 | ||
31 | if [[ -n "$BURST" ]]; then | 31 | if [[ -n "$BURST" ]]; then |
32 | err 1 "Bursting not supported for this mode" | 32 | err 1 "Bursting not supported for this mode" |
diff --git a/samples/pktgen/pktgen_sample05_flow_per_thread.sh b/samples/pktgen/pktgen_sample05_flow_per_thread.sh index 32ad818e2829..f4fb79409fd0 100755 --- a/samples/pktgen/pktgen_sample05_flow_per_thread.sh +++ b/samples/pktgen/pktgen_sample05_flow_per_thread.sh | |||
@@ -20,11 +20,11 @@ source ${basedir}/parameters.sh | |||
20 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" | 20 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" |
21 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" | 21 | [ -z "$CLONE_SKB" ] && CLONE_SKB="0" |
22 | [ -z "$BURST" ] && BURST=32 | 22 | [ -z "$BURST" ] && BURST=32 |
23 | [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely | ||
23 | 24 | ||
24 | 25 | ||
25 | # Base Config | 26 | # Base Config |
26 | DELAY="0" # Zero means max speed | 27 | DELAY="0" # Zero means max speed |
27 | COUNT="0" # Zero means indefinitely | ||
28 | 28 | ||
29 | # General cleanup everything since last run | 29 | # General cleanup everything since last run |
30 | pg_ctrl "reset" | 30 | pg_ctrl "reset" |