|
19 | 19 | ksft_skip=4
|
20 | 20 |
|
21 | 21 | # all tests in this script. Can be overridden with -t option
|
22 |
| -IPV4_TESTS="ipv4_fcnal ipv4_grp_fcnal ipv4_withv6_fcnal ipv4_fcnal_runtime ipv4_compat_mode ipv4_fdb_grp_fcnal" |
23 |
| -IPV6_TESTS="ipv6_fcnal ipv6_grp_fcnal ipv6_fcnal_runtime ipv6_compat_mode ipv6_fdb_grp_fcnal" |
| 22 | +IPV4_TESTS="ipv4_fcnal ipv4_grp_fcnal ipv4_withv6_fcnal ipv4_fcnal_runtime ipv4_large_grp ipv4_compat_mode ipv4_fdb_grp_fcnal" |
| 23 | +IPV6_TESTS="ipv6_fcnal ipv6_grp_fcnal ipv6_fcnal_runtime ipv6_large_grp ipv6_compat_mode ipv6_fdb_grp_fcnal" |
24 | 24 |
|
25 | 25 | ALL_TESTS="basic ${IPV4_TESTS} ${IPV6_TESTS}"
|
26 | 26 | TESTS="${ALL_TESTS}"
|
@@ -254,6 +254,60 @@ check_route6()
|
254 | 254 | check_output "${out}" "${expected}"
|
255 | 255 | }
|
256 | 256 |
|
| 257 | +check_large_grp() |
| 258 | +{ |
| 259 | + local ipv=$1 |
| 260 | + local ecmp=$2 |
| 261 | + local grpnum=100 |
| 262 | + local nhidstart=100 |
| 263 | + local grpidstart=1000 |
| 264 | + local iter=0 |
| 265 | + local nhidstr="" |
| 266 | + local grpidstr="" |
| 267 | + local grpstr="" |
| 268 | + local ipstr="" |
| 269 | + |
| 270 | + if [ $ipv -eq 4 ]; then |
| 271 | + ipstr="172.16.1." |
| 272 | + else |
| 273 | + ipstr="2001:db8:91::" |
| 274 | + fi |
| 275 | + |
| 276 | + # |
| 277 | + # Create $grpnum groups with specified $ecmp and dump them |
| 278 | + # |
| 279 | + |
| 280 | + # create nexthops with different gateways |
| 281 | + iter=2 |
| 282 | + while [ $iter -le $(($ecmp + 1)) ] |
| 283 | + do |
| 284 | + nhidstr="$(($nhidstart + $iter))" |
| 285 | + run_cmd "$IP nexthop add id $nhidstr via $ipstr$iter dev veth1" |
| 286 | + check_nexthop "id $nhidstr" "id $nhidstr via $ipstr$iter dev veth1 scope link" |
| 287 | + |
| 288 | + if [ $iter -le $ecmp ]; then |
| 289 | + grpstr+="$nhidstr/" |
| 290 | + else |
| 291 | + grpstr+="$nhidstr" |
| 292 | + fi |
| 293 | + ((iter++)) |
| 294 | + done |
| 295 | + |
| 296 | + # create duplicate large ecmp groups |
| 297 | + iter=0 |
| 298 | + while [ $iter -le $grpnum ] |
| 299 | + do |
| 300 | + grpidstr="$(($grpidstart + $iter))" |
| 301 | + run_cmd "$IP nexthop add id $grpidstr group $grpstr" |
| 302 | + check_nexthop "id $grpidstr" "id $grpidstr group $grpstr" |
| 303 | + ((iter++)) |
| 304 | + done |
| 305 | + |
| 306 | + # dump large groups |
| 307 | + run_cmd "$IP nexthop list" |
| 308 | + log_test $? 0 "Dump large (x$ecmp) ecmp groups" |
| 309 | +} |
| 310 | + |
257 | 311 | start_ip_monitor()
|
258 | 312 | {
|
259 | 313 | local mtype=$1
|
@@ -700,6 +754,19 @@ ipv6_fcnal_runtime()
|
700 | 754 | # route with src address and using nexthop - not allowed
|
701 | 755 | }
|
702 | 756 |
|
| 757 | +ipv6_large_grp() |
| 758 | +{ |
| 759 | + local ecmp=32 |
| 760 | + |
| 761 | + echo |
| 762 | + echo "IPv6 large groups (x$ecmp)" |
| 763 | + echo "---------------------" |
| 764 | + |
| 765 | + check_large_grp 6 $ecmp |
| 766 | + |
| 767 | + $IP nexthop flush >/dev/null 2>&1 |
| 768 | +} |
| 769 | + |
703 | 770 | ipv4_fcnal()
|
704 | 771 | {
|
705 | 772 | local rc
|
@@ -1066,6 +1133,19 @@ ipv4_fcnal_runtime()
|
1066 | 1133 | log_test $? 0 "IPv4 route with MPLS encap, v6 gw - check"
|
1067 | 1134 | }
|
1068 | 1135 |
|
| 1136 | +ipv4_large_grp() |
| 1137 | +{ |
| 1138 | + local ecmp=32 |
| 1139 | + |
| 1140 | + echo |
| 1141 | + echo "IPv4 large groups (x$ecmp)" |
| 1142 | + echo "---------------------" |
| 1143 | + |
| 1144 | + check_large_grp 4 $ecmp |
| 1145 | + |
| 1146 | + $IP nexthop flush >/dev/null 2>&1 |
| 1147 | +} |
| 1148 | + |
1069 | 1149 | sysctl_nexthop_compat_mode_check()
|
1070 | 1150 | {
|
1071 | 1151 | local sysctlname="net.ipv4.nexthop_compat_mode"
|
|
0 commit comments