From c8fd4852022ca8ae85ac4d30d05950eaf506b828 Mon Sep 17 00:00:00 2001 From: Igor Russkikh Date: Thu, 11 Mar 2021 11:32:53 +0100 Subject: 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 Signed-off-by: David S. Miller --- ...tgen_sample06_numa_awared_queue_irq_affinity.sh | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh') diff --git a/samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh b/samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh index 7c73ab8fbe3c..10f1da571f40 100755 --- a/samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh +++ b/samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh @@ -44,7 +44,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 ((i = 0; i < $THREADS; i++)); do @@ -58,7 +58,7 @@ for ((i = 0; i < $THREADS; i++)); do info "irq ${irq_array[$i]} is set affinity to `cat /proc/irq/${irq_array[$i]}/smp_affinity_list`" # 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 # select queue and bind the queue and $dev in 1:1 relationship @@ -99,14 +99,18 @@ for ((i = 0; i < $THREADS; i++)); do done # start_run -echo "Running... ctrl^C to stop" >&2 -pg_ctrl "start" -echo "Done" >&2 - -# Print results -for ((i = 0; i < $THREADS; i++)); do - thread=${cpu_array[$((i+F_THREAD))]} - dev=${DEV}@${thread} - echo "Device: $dev" - cat /proc/net/pktgen/$dev | grep -A2 "Result:" -done +if [ -z "$APPEND" ]; then + echo "Running... ctrl^C to stop" >&2 + pg_ctrl "start" + echo "Done" >&2 + + # Print results + for ((i = 0; i < $THREADS; i++)); do + thread=${cpu_array[$((i+F_THREAD))]} + 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 -- cgit v1.2.3-59-g8ed1b