File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,12 +14,13 @@ function usage() {
1414 echo " -b : (\$ BURST) HW level bursting of SKBs"
1515 echo " -v : (\$ VERBOSE) verbose"
1616 echo " -x : (\$ DEBUG) debug"
17+ echo " -6 : (\$ IP6) IPv6"
1718 echo " "
1819}
1920
2021# # --- Parse command line arguments / parameters ---
2122# # echo "Commandline options:"
22- while getopts " s:i:d:m:t:c:b:vxh " option; do
23+ while getopts " s:i:d:m:t:c:b:vxh6 " option; do
2324 case $option in
2425 i) # interface
2526 export DEV=$OPTARG
@@ -59,6 +60,10 @@ while getopts "s:i:d:m:t:c:b:vxh" option; do
5960 export DEBUG=yes
6061 info " Debug mode: DEBUG=$DEBUG "
6162 ;;
63+ 6)
64+ export IP6=6
65+ info " IP6: IP6=$IP6 "
66+ ;;
6267 h|? |* )
6368 usage;
6469 err 2 " [ERROR] Unknown parameters!!!"
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ root_check_run_with_sudo "$@"
3434source ${basedir} /parameters.sh
3535# Using invalid DST_MAC will cause the packets to get dropped in
3636# ip_rcv() which is part of the test
37- [ -z " $DEST_IP " ] && DEST_IP=" 198.18.0.42"
37+ if [ -z " $DEST_IP " ]; then
38+ [ -z " $IP6 " ] && DEST_IP=" 198.18.0.42" || DEST_IP=" FD00::1"
39+ fi
3840[ -z " $DST_MAC " ] && DST_MAC=" 90:e2:ba:ff:ff:ff"
3941[ -z " $BURST " ] && BURST=1024
4042
@@ -64,7 +66,7 @@ for ((thread = 0; thread < $THREADS; thread++)); do
6466
6567 # Destination
6668 pg_set $dev " dst_mac $DST_MAC "
67- pg_set $dev " dst $DEST_IP "
69+ pg_set $dev " dst$IP6 $DEST_IP "
6870
6971 # Inject packet into RX path of stack
7072 pg_set $dev " xmit_mode netif_receive"
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ root_check_run_with_sudo "$@"
1313
1414# Parameter parsing via include
1515source ${basedir} /parameters.sh
16- [ -z " $DEST_IP " ] && DEST_IP=" 198.18.0.42"
16+ if [ -z " $DEST_IP " ]; then
17+ [ -z " $IP6 " ] && DEST_IP=" 198.18.0.42" || DEST_IP=" FD00::1"
18+ fi
1719[ -z " $DST_MAC " ] && DST_MAC=" 90:e2:ba:ff:ff:ff"
1820
1921# Burst greater than 1 are invalid for queue_xmit mode
@@ -47,7 +49,7 @@ for ((thread = 0; thread < $THREADS; thread++)); do
4749
4850 # Destination
4951 pg_set $dev " dst_mac $DST_MAC "
50- pg_set $dev " dst $DEST_IP "
52+ pg_set $dev " dst$IP6 $DEST_IP "
5153
5254 # Inject packet into TX qdisc egress path of stack
5355 pg_set $dev " xmit_mode queue_xmit"
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ root_check_run_with_sudo "$@"
1414source ${basedir} /parameters.sh
1515#
1616# Set some default params, if they didn't get set
17- [ -z " $DEST_IP " ] && DEST_IP=" 198.18.0.42"
17+ if [ -z " $DEST_IP " ]; then
18+ [ -z " $IP6 " ] && DEST_IP=" 198.18.0.42" || DEST_IP=" FD00::1"
19+ fi
1820[ -z " $CLONE_SKB " ] && CLONE_SKB=" 0"
1921# Example enforce param "-m" for dst_mac
2022[ -z " $DST_MAC " ] && usage && err 2 " Must specify -m dst_mac"
@@ -54,7 +56,7 @@ pg_set $DEV "flag NO_TIMESTAMP"
5456
5557# Destination
5658pg_set $DEV " dst_mac $DST_MAC "
57- pg_set $DEV " dst $DEST_IP "
59+ pg_set $DEV " dst$IP6 $DEST_IP "
5860
5961# Setup random UDP port src range
6062pg_set $DEV " flag UDPSRC_RND"
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ UDP_MIN=9
2323UDP_MAX=109
2424
2525# (example of setting default params in your script)
26- [ -z " $DEST_IP " ] && DEST_IP=" 198.18.0.42"
26+ if [ -z " $DEST_IP " ]; then
27+ [ -z " $IP6 " ] && DEST_IP=" 198.18.0.42" || DEST_IP=" FD00::1"
28+ fi
2729[ -z " $DST_MAC " ] && DST_MAC=" 90:e2:ba:ff:ff:ff"
2830
2931# General cleanup everything since last run
@@ -54,7 +56,7 @@ for ((thread = 0; thread < $THREADS; thread++)); do
5456
5557 # Destination
5658 pg_set $dev " dst_mac $DST_MAC "
57- pg_set $dev " dst $DEST_IP "
59+ pg_set $dev " dst$IP6 $DEST_IP "
5860
5961 # Setup random UDP port src range
6062 pg_set $dev " flag UDPSRC_RND"
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ root_check_run_with_sudo "$@"
2525# Parameter parsing via include
2626source ${basedir} /parameters.sh
2727# Set some default params, if they didn't get set
28- [ -z " $DEST_IP " ] && DEST_IP=" 198.18.0.42"
28+ if [ -z " $DEST_IP " ]; then
29+ [ -z " $IP6 " ] && DEST_IP=" 198.18.0.42" || DEST_IP=" FD00::1"
30+ fi
2931[ -z " $DST_MAC " ] && DST_MAC=" 90:e2:ba:ff:ff:ff"
3032[ -z " $BURST " ] && BURST=32
3133[ -z " $CLONE_SKB " ] && CLONE_SKB=" 100000"
@@ -55,7 +57,7 @@ for ((thread = 0; thread < $THREADS; thread++)); do
5557
5658 # Destination
5759 pg_set $dev " dst_mac $DST_MAC "
58- pg_set $dev " dst $DEST_IP "
60+ pg_set $dev " dst$IP6 $DEST_IP "
5961
6062 # Setup burst, for easy testing -b 0 disable bursting
6163 # (internally in pktgen default and minimum burst=1)
You can’t perform that action at this time.
0 commit comments