summaryrefslogtreecommitdiff
path: root/samples/pktgen/pktgen_sample02_multiqueue.sh
diff options
context:
space:
mode:
authorIgor Russkikh <irusskikh@marvell.com>2021-03-11 11:32:53 +0100
committerDavid S. Miller <davem@davemloft.net>2021-03-14 14:22:38 -0700
commitc8fd4852022ca8ae85ac4d30d05950eaf506b828 (patch)
treec4d1df8db17eb0e871e1f0f45aba5abdab793a39 /samples/pktgen/pktgen_sample02_multiqueue.sh
parentef700f2ea27e54f640c3957374469132e8bf46f5 (diff)
samples: pktgen: new append mode
To configure various complex flows we for sure can create custom pktgen init scripts, but sometimes thats not that easy. New "-a" (append) option in all the existing sample scripts allows to append more "devices" into pktgen threads. The most straightforward usecases for that are: - using multiple devices. We have to generate full linerate on all physical functions (ports) of our multiport device. - pushing multiple flows (with different packet options) Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/pktgen/pktgen_sample02_multiqueue.sh')
-rwxr-xr-xsamples/pktgen/pktgen_sample02_multiqueue.sh28
1 files changed, 16 insertions, 12 deletions
diff --git a/samples/pktgen/pktgen_sample02_multiqueue.sh b/samples/pktgen/pktgen_sample02_multiqueue.sh
index 49e1e81a2945..acae8ede0d6c 100755
--- a/samples/pktgen/pktgen_sample02_multiqueue.sh
+++ b/samples/pktgen/pktgen_sample02_multiqueue.sh
@@ -38,7 +38,7 @@ if [ -n "$DST_PORT" ]; then
fi
# General cleanup everything since last run
-pg_ctrl "reset"
+[ -z "$APPEND" ] && pg_ctrl "reset"
# Threads are specified with parameter -t value in $THREADS
for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do
@@ -47,7 +47,7 @@ for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do
dev=${DEV}@${thread}
# Add remove all other devices and add_device $dev to thread
- pg_thread $thread "rem_device_all"
+ [ -z "$APPEND" ] && pg_thread $thread "rem_device_all"
pg_thread $thread "add_device" $dev
# Notice config queue to map to cpu (mirrors smp_processor_id())
@@ -81,14 +81,18 @@ for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do
pg_set $dev "udp_src_max $UDP_SRC_MAX"
done
-# start_run
-echo "Running... ctrl^C to stop" >&2
-pg_ctrl "start"
-echo "Done" >&2
+if [ -z "$APPEND" ]; then
+ # start_run
+ echo "Running... ctrl^C to stop" >&2
+ pg_ctrl "start"
+ echo "Done" >&2
-# Print results
-for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do
- dev=${DEV}@${thread}
- echo "Device: $dev"
- cat /proc/net/pktgen/$dev | grep -A2 "Result:"
-done
+ # Print results
+ for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do
+ dev=${DEV}@${thread}
+ echo "Device: $dev"
+ cat /proc/net/pktgen/$dev | grep -A2 "Result:"
+ done
+else
+ echo "Append mode: config done. Do more or use 'pg_ctrl start' to run"
+fi