Lines Matching +full:group +full:- +full:index +full:- +full:shift

2 # SPDX-License-Identifier: GPL-2.0
58 local nharg="$1"; shift
59 local expected="$1"; shift
61 out=$($IP nexthop show ${nharg} | sed -e 's/ *$//')
71 local group_id=$1; shift
78 nhid=$1; shift
79 expected=$1; shift
82 grep "trap" | wc -l)
93 local expected_occ=$1; shift
95 occ=$($DEVLINK -jp resource show $DEVLINK_DEV \
98 if [ $expected_occ -ne $occ ]; then
107 local size=$1; shift
158 $IP nexthop add id 10 group 1/2
159 nexthop_check "id 10" "id 10 group 1/2 trap"
160 check_err $? "Unexpected nexthop group entry"
169 $IP nexthop add id 10 group 1,20/2,39
170 nexthop_check "id 10" "id 10 group 1,20/2,39 trap"
171 check_err $? "Unexpected weighted nexthop group entry"
180 log_test "Nexthop group add and delete"
194 $IP nexthop add id 10 group 1/2 &> /dev/null
195 check_fail $? "Nexthop group addition succeeded when should fail"
200 log_test "Nexthop group add failure"
213 $IP nexthop add id 10 group 1/2 type resilient buckets 4
214 …nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 …
215 check_err $? "Unexpected nexthop group entry"
229 $IP nexthop add id 10 group 1,3/2,2 type resilient buckets 5
230 …nexthop_check "id 10" "id 10 group 1,3/2,2 type resilient buckets 5 idle_timer 120 unbalanced_time…
231 check_err $? "Unexpected weighted nexthop group entry"
245 log_test "Resilient nexthop group add and delete"
259 $IP nexthop add id 10 group 1/2 type resilient buckets 4 &> /dev/null
260 check_fail $? "Nexthop group addition succeeded when should fail"
265 log_test "Resilient nexthop group add failure"
278 $IP nexthop add id 10 group 1/2
280 $IP nexthop replace id 10 group 1/2/3
281 nexthop_check "id 10" "id 10 group 1/2/3 trap"
282 check_err $? "Unexpected nexthop group entry"
287 log_test "Nexthop group replace"
301 $IP nexthop add id 10 group 1/2
303 $IP nexthop replace id 10 group 1/2/3 &> /dev/null
304 check_fail $? "Nexthop group replacement succeeded when should fail"
306 nexthop_check "id 10" "id 10 group 1/2 trap"
307 check_err $? "Unexpected nexthop group entry after failure"
312 log_test "Nexthop group replace failure"
325 $IP nexthop add id 10 group 1/2 type resilient buckets 6
327 $IP nexthop replace id 10 group 1/2/3 type resilient
328 …nexthop_check "id 10" "id 10 group 1/2/3 type resilient buckets 6 idle_timer 120 unbalanced_timer …
329 check_err $? "Unexpected nexthop group entry"
341 log_test "Resilient nexthop group replace"
353 $IP nexthop add id 10 group 1/2 type resilient buckets 6
357 $IP nexthop replace id 10 group 1/2/3 type resilient &> /dev/null
358 check_fail $? "Nexthop group replacement succeeded when should fail"
360 …nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 6 idle_timer 120 unbalanced_timer 0 …
361 check_err $? "Unexpected nexthop group entry after failure"
371 log_test "Resilient nexthop group replace failure"
380 local group_id=$1; shift
381 local nhid=$1; shift
382 local count=$1; shift
383 local index
385 for index in $($IP -j nexthop bucket show id $group_id nhid $nhid |
386 jq '.[].bucket.index' | head -n ${count:--0})
388 echo $group_id $index \
395 local group_id=$1; shift
396 local nhid=$1; shift
398 $IP -j nexthop bucket show id $group_id nhid $nhid | jq length
408 $IP nexthop add id 10 group 1/2 type resilient buckets 8 idle_timer 4
410 $IP nexthop replace id 10 group 1/2,3 type resilient
413 check_err $? "Group expected to be unbalanced"
418 check_err $? "Group expected to be balanced"
433 $IP nexthop add id 10 group 1,50/2,50/3,1 \
436 $IP nexthop replace id 10 group 1,50/2,150/3,1 type resilient
439 check_err $? "Group expected to be unbalanced"
443 # Deletion prompts group replacement. Check that the bucket timers
448 check_err $? "Group expected to still be unbalanced"
453 check_err $? "Group expected to be balanced"
462 local timer=$1; shift
469 $IP nexthop add id 10 group 1/2 type resilient buckets 8 $timer 4
471 $IP nexthop replace id 10 group 1/2,3 type resilient
474 check_fail $? "Group expected to be unbalanced"
477 $IP nexthop replace id 10 group 1/2,3 type resilient $timer 8
482 check_fail $? "Group still expected to be unbalanced"
488 check_err $? "Group expected to be balanced"
497 local timer=$1; shift
504 $IP nexthop add id 10 group 1/2 type resilient buckets 8 $timer 8
506 $IP nexthop replace id 10 group 1/2,3 type resilient
509 check_fail $? "Group expected to be unbalanced"
512 $IP nexthop replace id 10 group 1/2,3 type resilient $timer 4
517 check_err $? "Group expected to be balanced"
526 local timer=$1; shift
534 $IP nexthop add id 10 group 1,100/2,100/3,1 \
537 $IP nexthop replace id 10 group 1,100/2,300/3,1 type resilient
540 check_fail $? "Group expected to be unbalanced"
543 $IP nexthop replace id 10 group 1/2,3 type resilient $timer 8
548 check_fail $? "Group still expected to be unbalanced"
554 check_err $? "Group expected to be balanced"
580 $IP nexthop add id 10 group 1/2 type resilient \
583 $IP nexthop replace id 10 group 1/2,3 type resilient
588 check_err $? "$i: Group expected to be unbalanced"
595 check_err $? "Group expected to be balanced"
612 $IP nexthop add id 10 group 1,50/2,50/3,1 type resilient \
615 $IP nexthop replace id 10 group 1,50/2,150/3,1 type resilient
621 check_err $? "1: Group expected to be unbalanced"
626 check_err $? "2: Group expected to be unbalanced"
632 check_err $? "Group expected to be balanced"
648 $IP nexthop add id 10 group 1/2 type resilient buckets 8
650 $IP nexthop replace id 10 group 1/2,3 type resilient
655 check_fail $? "$i: Group expected to be unbalanced"
659 log_test "Buckets never force-migrated without unbalanced timer"
671 $IP nexthop add id 10 group 1/2 type resilient \
674 $IP nexthop replace id 10 group 1/2,3 type resilient
677 check_fail $? "Group expected to be unbalanced"
682 check_err $? "Group expected to be balanced"
706 $IP nexthop add id 10 group 1/2 type resilient \
709 $IP nexthop replace id 10 group 1/2,3 type resilient
712 check_fail $? "Group expected to be unbalanced"
714 $IP nexthop replace id 10 group 2 type resilient
718 log_test "Busy buckets force-migrated when NH removed"
772 $IP nexthop add id 10 group 1/2
777 nexthop_check "id 10" "id 10 group 1/2 trap"
778 check_err $? "Unexpected nexthop group entry"
783 log_test "Single nexthop replace while in group"
796 $IP nexthop add id 10 group 1/2
804 nexthop_check "id 10" "id 10 group 1/2 trap"
805 check_err $? "Unexpected nexthop group entry after failure"
810 log_test "Single nexthop replace while in group failure"
822 $IP nexthop add id 10 group 1/2 type resilient buckets 4
827 …nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 …
828 check_err $? "Unexpected nexthop group entry"
836 log_test "Single nexthop replace while in resilient group"
847 $IP nexthop add id 10 group 1/2 type resilient buckets 4
857 …nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 …
858 check_err $? "Unexpected nexthop group entry after failure"
866 log_test "Single nexthop replace while in resilient group failure"
879 $IP nexthop add id 10 group 1/2
882 nexthop_check "id 10" "id 10 group 2 trap"
883 check_err $? "Unexpected nexthop group entry"
888 log_test "Single nexthop delete while in group"
898 # 5. Afterwards, a replace notification will be sent for nexthop group
899 # 10 with only two nexthops. Since the new group is allocated before
907 $IP nexthop add id 10 group 1/2/3
914 log_test "Single nexthop delete while in group failure"
926 $IP nexthop add id 10 group 1/2 type resilient buckets 4
929 …nexthop_check "id 10" "id 10 group 2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 un…
930 check_err $? "Unexpected nexthop group entry"
938 log_test "Single nexthop delete while in resilient group"
950 $IP nexthop add id 10 group 1/2/3 type resilient buckets 6
964 log_test "Single nexthop delete while in resilient group failure"
977 $IP nexthop add id 10 group 1/2
988 nexthop_check "id 10" "id 10 group 1/2 trap"
989 check_err $? "Unexpected nexthop group entry after reload"
1005 $IP nexthop add id 10 group 1/2
1028 while [ ! -d $SYSFS_NET_DIR ] ; do :; done
1030 set -e
1035 IP="ip -netns testns1"
1036 DEVLINK="devlink -N testns1"
1049 modprobe -r netdevsim &> /dev/null