projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'pinctrl-v5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6-microblaze.git]
/
samples
/
pktgen
/
pktgen_sample01_simple.sh
diff --git
a/samples/pktgen/pktgen_sample01_simple.sh
b/samples/pktgen/pktgen_sample01_simple.sh
index
a4e250b
..
a09f342
100755
(executable)
--- a/
samples/pktgen/pktgen_sample01_simple.sh
+++ b/
samples/pktgen/pktgen_sample01_simple.sh
@@
-31,20
+31,17
@@
if [ -n "$DST_PORT" ]; then
validate_ports $UDP_DST_MIN $UDP_DST_MAX
fi
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
# General cleanup everything since last run
# (especially important if other threads were configured by other scripts)
# Flow variation random source port between min and max
UDP_SRC_MIN=9
UDP_SRC_MAX=109
# General cleanup everything since last run
# (especially important if other threads were configured by other scripts)
-pg_ctrl "reset"
+
[ -z "$APPEND" ] &&
pg_ctrl "reset"
# Add remove all other devices and add_device $DEV to thread 0
thread=0
# Add remove all other devices and add_device $DEV to thread 0
thread=0
-pg_thread $thread "rem_device_all"
+
[ -z "$APPEND" ] &&
pg_thread $thread "rem_device_all"
pg_thread $thread "add_device" $DEV
# How many packets to send (zero means indefinitely)
pg_thread $thread "add_device" $DEV
# How many packets to send (zero means indefinitely)
@@
-80,11
+77,15
@@
pg_set $DEV "flag UDPSRC_RND"
pg_set $DEV "udp_src_min $UDP_SRC_MIN"
pg_set $DEV "udp_src_max $UDP_SRC_MAX"
pg_set $DEV "udp_src_min $UDP_SRC_MIN"
pg_set $DEV "udp_src_max $UDP_SRC_MAX"
-# 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
-echo "Result device: $DEV"
-cat /proc/net/pktgen/$DEV
+ # Print results
+ echo "Result device: $DEV"
+ cat /proc/net/pktgen/$DEV
+else
+ echo "Append mode: config done. Do more or use 'pg_ctrl start' to run"
+fi
\ No newline at end of file