aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-02-28 05:25:12 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-28 12:25:47 -0500
commit4fb20ae13711ee05fba6e5dd2b81a83d9e5b5249 (patch)
treee81f4195e789b46b595006c1ed9ea6279c734ba8 /tools
parent3d578d879517a97f4af867e6a8a021baf15e5101 (diff)
selftests: forwarding: Test IPv6 weighted nexthops
Have one host generate 16K IPv6 echo requests with a random flow label and check that they are distributed between both multipath links according to the provided weights. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/router_multipath.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/router_multipath.sh b/tools/testing/selftests/net/forwarding/router_multipath.sh
index 5b425dffb5d0..d31888e3133e 100755
--- a/tools/testing/selftests/net/forwarding/router_multipath.sh
+++ b/tools/testing/selftests/net/forwarding/router_multipath.sh
@@ -226,12 +226,48 @@ multipath4_test()
226 sysctl -q -w net.ipv4.fib_multipath_hash_policy=$hash_policy 226 sysctl -q -w net.ipv4.fib_multipath_hash_policy=$hash_policy
227} 227}
228 228
229multipath6_test()
230{
231 local weight_rp12=$1
232 local weight_rp13=$2
233 local t0_rp12 t0_rp13 t1_rp12 t1_rp13
234 local packets_rp12 packets_rp13
235
236 ip route replace 2001:db8:2::/64 vrf vrf-r1 \
237 nexthop via fe80:2::22 dev $rp12 weight $weight_rp12 \
238 nexthop via fe80:3::23 dev $rp13 weight $weight_rp13
239
240 t0_rp12=$(link_stats_tx_packets_get $rp12)
241 t0_rp13=$(link_stats_tx_packets_get $rp13)
242
243 # Generate 16384 echo requests, each with a random flow label.
244 for _ in $(seq 1 16384); do
245 ip vrf exec vrf-h1 ping 2001:db8:2::2 -F 0 -c 1 -q &> /dev/null
246 done
247
248 t1_rp12=$(link_stats_tx_packets_get $rp12)
249 t1_rp13=$(link_stats_tx_packets_get $rp13)
250
251 let "packets_rp12 = $t1_rp12 - $t0_rp12"
252 let "packets_rp13 = $t1_rp13 - $t0_rp13"
253 multipath_eval $weight_rp12 $weight_rp13 $packets_rp12 $packets_rp13
254
255 ip route replace 2001:db8:2::/64 vrf vrf-r1 \
256 nexthop via fe80:2::22 dev $rp12 \
257 nexthop via fe80:3::23 dev $rp13
258}
259
229multipath_test() 260multipath_test()
230{ 261{
231 log_info "Running IPv4 multipath tests" 262 log_info "Running IPv4 multipath tests"
232 multipath4_test 1 1 263 multipath4_test 1 1
233 multipath4_test 2 1 264 multipath4_test 2 1
234 multipath4_test 11 45 265 multipath4_test 11 45
266
267 log_info "Running IPv6 multipath tests"
268 multipath6_test 1 1
269 multipath6_test 2 1
270 multipath6_test 11 45
235} 271}
236 272
237setup_prepare() 273setup_prepare()