Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: netdevsim: Add test for resilient nexthop groups offload API

Test various aspects of the resilient nexthop group offload API on top
of the netdevsim implementation. Both good and bad flows are tested.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Co-developed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ido Schimmel and committed by
David S. Miller
b8a07c4c 902280ca

+620
+620
tools/testing/selftests/drivers/net/netdevsim/nexthop.sh
··· 11 11 nexthop_single_add_err_test 12 12 nexthop_group_add_test 13 13 nexthop_group_add_err_test 14 + nexthop_res_group_add_test 15 + nexthop_res_group_add_err_test 14 16 nexthop_group_replace_test 15 17 nexthop_group_replace_err_test 18 + nexthop_res_group_replace_test 19 + nexthop_res_group_replace_err_test 20 + nexthop_res_group_idle_timer_test 21 + nexthop_res_group_idle_timer_del_test 22 + nexthop_res_group_increase_idle_timer_test 23 + nexthop_res_group_decrease_idle_timer_test 24 + nexthop_res_group_unbalanced_timer_test 25 + nexthop_res_group_unbalanced_timer_del_test 26 + nexthop_res_group_no_unbalanced_timer_test 27 + nexthop_res_group_short_unbalanced_timer_test 28 + nexthop_res_group_increase_unbalanced_timer_test 29 + nexthop_res_group_decrease_unbalanced_timer_test 30 + nexthop_res_group_force_migrate_busy_test 16 31 nexthop_single_replace_test 17 32 nexthop_single_replace_err_test 18 33 nexthop_single_in_group_replace_test 19 34 nexthop_single_in_group_replace_err_test 35 + nexthop_single_in_res_group_replace_test 36 + nexthop_single_in_res_group_replace_err_test 20 37 nexthop_single_in_group_delete_test 21 38 nexthop_single_in_group_delete_err_test 39 + nexthop_single_in_res_group_delete_test 40 + nexthop_single_in_res_group_delete_err_test 22 41 nexthop_replay_test 23 42 nexthop_replay_err_test 24 43 " ··· 46 27 DEV=netdevsim${DEV_ADDR} 47 28 DEVLINK_DEV=netdevsim/${DEV} 48 29 SYSFS_NET_DIR=/sys/bus/netdevsim/devices/$DEV/net/ 30 + DEBUGFS_NET_DIR=/sys/kernel/debug/netdevsim/$DEV/ 49 31 NUM_NETIFS=0 50 32 source $lib_dir/lib.sh 51 33 source $lib_dir/devlink_lib.sh ··· 60 40 if [[ "$out" != "$expected" ]]; then 61 41 return 1 62 42 fi 43 + 44 + return 0 45 + } 46 + 47 + nexthop_bucket_nhid_count_check() 48 + { 49 + local group_id=$1; shift 50 + local expected 51 + local count 52 + local nhid 53 + local ret 54 + 55 + while (($# > 0)); do 56 + nhid=$1; shift 57 + expected=$1; shift 58 + 59 + count=$($IP nexthop bucket show id $group_id nhid $nhid | 60 + grep "trap" | wc -l) 61 + if ((expected != count)); then 62 + return 1 63 + fi 64 + done 63 65 64 66 return 0 65 67 } ··· 201 159 nexthop_resource_set 9999 202 160 } 203 161 162 + nexthop_res_group_add_test() 163 + { 164 + RET=0 165 + 166 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 167 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 168 + 169 + $IP nexthop add id 10 group 1/2 type resilient buckets 4 170 + nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 171 + check_err $? "Unexpected nexthop group entry" 172 + 173 + nexthop_bucket_nhid_count_check 10 1 2 174 + check_err $? "Wrong nexthop buckets count" 175 + nexthop_bucket_nhid_count_check 10 2 2 176 + check_err $? "Wrong nexthop buckets count" 177 + 178 + nexthop_resource_check 6 179 + check_err $? "Wrong nexthop occupancy" 180 + 181 + $IP nexthop del id 10 182 + nexthop_resource_check 2 183 + check_err $? "Wrong nexthop occupancy after delete" 184 + 185 + $IP nexthop add id 10 group 1,3/2,2 type resilient buckets 5 186 + nexthop_check "id 10" "id 10 group 1,3/2,2 type resilient buckets 5 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 187 + check_err $? "Unexpected weighted nexthop group entry" 188 + 189 + nexthop_bucket_nhid_count_check 10 1 3 190 + check_err $? "Wrong nexthop buckets count" 191 + nexthop_bucket_nhid_count_check 10 2 2 192 + check_err $? "Wrong nexthop buckets count" 193 + 194 + nexthop_resource_check 7 195 + check_err $? "Wrong weighted nexthop occupancy" 196 + 197 + $IP nexthop del id 10 198 + nexthop_resource_check 2 199 + check_err $? "Wrong nexthop occupancy after delete" 200 + 201 + log_test "Resilient nexthop group add and delete" 202 + 203 + $IP nexthop flush &> /dev/null 204 + } 205 + 206 + nexthop_res_group_add_err_test() 207 + { 208 + RET=0 209 + 210 + nexthop_resource_set 2 211 + 212 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 213 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 214 + 215 + $IP nexthop add id 10 group 1/2 type resilient buckets 4 &> /dev/null 216 + check_fail $? "Nexthop group addition succeeded when should fail" 217 + 218 + nexthop_resource_check 2 219 + check_err $? "Wrong nexthop occupancy" 220 + 221 + log_test "Resilient nexthop group add failure" 222 + 223 + $IP nexthop flush &> /dev/null 224 + nexthop_resource_set 9999 225 + } 226 + 204 227 nexthop_group_replace_test() 205 228 { 206 229 RET=0 ··· 311 204 312 205 $IP nexthop flush &> /dev/null 313 206 nexthop_resource_set 9999 207 + } 208 + 209 + nexthop_res_group_replace_test() 210 + { 211 + RET=0 212 + 213 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 214 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 215 + $IP nexthop add id 3 via 192.0.2.4 dev dummy1 216 + $IP nexthop add id 10 group 1/2 type resilient buckets 6 217 + 218 + $IP nexthop replace id 10 group 1/2/3 type resilient 219 + nexthop_check "id 10" "id 10 group 1/2/3 type resilient buckets 6 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 220 + check_err $? "Unexpected nexthop group entry" 221 + 222 + nexthop_bucket_nhid_count_check 10 1 2 223 + check_err $? "Wrong nexthop buckets count" 224 + nexthop_bucket_nhid_count_check 10 2 2 225 + check_err $? "Wrong nexthop buckets count" 226 + nexthop_bucket_nhid_count_check 10 3 2 227 + check_err $? "Wrong nexthop buckets count" 228 + 229 + nexthop_resource_check 9 230 + check_err $? "Wrong nexthop occupancy" 231 + 232 + log_test "Resilient nexthop group replace" 233 + 234 + $IP nexthop flush &> /dev/null 235 + } 236 + 237 + nexthop_res_group_replace_err_test() 238 + { 239 + RET=0 240 + 241 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 242 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 243 + $IP nexthop add id 3 via 192.0.2.4 dev dummy1 244 + $IP nexthop add id 10 group 1/2 type resilient buckets 6 245 + 246 + ip netns exec testns1 \ 247 + echo 1 > $DEBUGFS_NET_DIR/fib/fail_res_nexthop_group_replace 248 + $IP nexthop replace id 10 group 1/2/3 type resilient &> /dev/null 249 + check_fail $? "Nexthop group replacement succeeded when should fail" 250 + 251 + nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 6 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 252 + check_err $? "Unexpected nexthop group entry after failure" 253 + 254 + nexthop_bucket_nhid_count_check 10 1 3 255 + check_err $? "Wrong nexthop buckets count" 256 + nexthop_bucket_nhid_count_check 10 2 3 257 + check_err $? "Wrong nexthop buckets count" 258 + 259 + nexthop_resource_check 9 260 + check_err $? "Wrong nexthop occupancy after failure" 261 + 262 + log_test "Resilient nexthop group replace failure" 263 + 264 + $IP nexthop flush &> /dev/null 265 + ip netns exec testns1 \ 266 + echo 0 > $DEBUGFS_NET_DIR/fib/fail_res_nexthop_group_replace 267 + } 268 + 269 + nexthop_res_mark_buckets_busy() 270 + { 271 + local group_id=$1; shift 272 + local nhid=$1; shift 273 + local count=$1; shift 274 + local index 275 + 276 + for index in $($IP -j nexthop bucket show id $group_id nhid $nhid | 277 + jq '.[].bucket.index' | head -n ${count:--0}) 278 + do 279 + echo $group_id $index \ 280 + > $DEBUGFS_NET_DIR/fib/nexthop_bucket_activity 281 + done 282 + } 283 + 284 + nexthop_res_num_nhid_buckets() 285 + { 286 + local group_id=$1; shift 287 + local nhid=$1; shift 288 + 289 + $IP -j nexthop bucket show id $group_id nhid $nhid | jq length 290 + } 291 + 292 + nexthop_res_group_idle_timer_test() 293 + { 294 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 295 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 296 + 297 + RET=0 298 + 299 + $IP nexthop add id 10 group 1/2 type resilient buckets 8 idle_timer 4 300 + nexthop_res_mark_buckets_busy 10 1 301 + $IP nexthop replace id 10 group 1/2,3 type resilient 302 + 303 + nexthop_bucket_nhid_count_check 10 1 4 2 4 304 + check_err $? "Group expected to be unbalanced" 305 + 306 + sleep 6 307 + 308 + nexthop_bucket_nhid_count_check 10 1 2 2 6 309 + check_err $? "Group expected to be balanced" 310 + 311 + log_test "Bucket migration after idle timer" 312 + 313 + $IP nexthop flush &> /dev/null 314 + } 315 + 316 + nexthop_res_group_idle_timer_del_test() 317 + { 318 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 319 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 320 + $IP nexthop add id 3 via 192.0.2.3 dev dummy1 321 + 322 + RET=0 323 + 324 + $IP nexthop add id 10 group 1,50/2,50/3,1 \ 325 + type resilient buckets 8 idle_timer 6 326 + nexthop_res_mark_buckets_busy 10 1 327 + $IP nexthop replace id 10 group 1,50/2,150/3,1 type resilient 328 + 329 + nexthop_bucket_nhid_count_check 10 1 4 2 4 3 0 330 + check_err $? "Group expected to be unbalanced" 331 + 332 + sleep 4 333 + 334 + # Deletion prompts group replacement. Check that the bucket timers 335 + # are kept. 336 + $IP nexthop delete id 3 337 + 338 + nexthop_bucket_nhid_count_check 10 1 4 2 4 339 + check_err $? "Group expected to still be unbalanced" 340 + 341 + sleep 4 342 + 343 + nexthop_bucket_nhid_count_check 10 1 2 2 6 344 + check_err $? "Group expected to be balanced" 345 + 346 + log_test "Bucket migration after idle timer (with delete)" 347 + 348 + $IP nexthop flush &> /dev/null 349 + } 350 + 351 + __nexthop_res_group_increase_timer_test() 352 + { 353 + local timer=$1; shift 354 + 355 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 356 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 357 + 358 + RET=0 359 + 360 + $IP nexthop add id 10 group 1/2 type resilient buckets 8 $timer 4 361 + nexthop_res_mark_buckets_busy 10 1 362 + $IP nexthop replace id 10 group 1/2,3 type resilient 363 + 364 + nexthop_bucket_nhid_count_check 10 2 6 365 + check_fail $? "Group expected to be unbalanced" 366 + 367 + sleep 2 368 + $IP nexthop replace id 10 group 1/2,3 type resilient $timer 8 369 + sleep 4 370 + 371 + # 6 seconds, past the original timer. 372 + nexthop_bucket_nhid_count_check 10 2 6 373 + check_fail $? "Group still expected to be unbalanced" 374 + 375 + sleep 4 376 + 377 + # 10 seconds, past the new timer. 378 + nexthop_bucket_nhid_count_check 10 2 6 379 + check_err $? "Group expected to be balanced" 380 + 381 + log_test "Bucket migration after $timer increase" 382 + 383 + $IP nexthop flush &> /dev/null 384 + } 385 + 386 + __nexthop_res_group_decrease_timer_test() 387 + { 388 + local timer=$1; shift 389 + 390 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 391 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 392 + 393 + RET=0 394 + 395 + $IP nexthop add id 10 group 1/2 type resilient buckets 8 $timer 8 396 + nexthop_res_mark_buckets_busy 10 1 397 + $IP nexthop replace id 10 group 1/2,3 type resilient 398 + 399 + nexthop_bucket_nhid_count_check 10 2 6 400 + check_fail $? "Group expected to be unbalanced" 401 + 402 + sleep 2 403 + $IP nexthop replace id 10 group 1/2,3 type resilient $timer 4 404 + sleep 4 405 + 406 + # 6 seconds, past the new timer, before the old timer. 407 + nexthop_bucket_nhid_count_check 10 2 6 408 + check_err $? "Group expected to be balanced" 409 + 410 + log_test "Bucket migration after $timer decrease" 411 + 412 + $IP nexthop flush &> /dev/null 413 + } 414 + 415 + __nexthop_res_group_increase_timer_del_test() 416 + { 417 + local timer=$1; shift 418 + 419 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 420 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 421 + $IP nexthop add id 3 via 192.0.2.3 dev dummy1 422 + 423 + RET=0 424 + 425 + $IP nexthop add id 10 group 1,100/2,100/3,1 \ 426 + type resilient buckets 8 $timer 4 427 + nexthop_res_mark_buckets_busy 10 1 428 + $IP nexthop replace id 10 group 1,100/2,300/3,1 type resilient 429 + 430 + nexthop_bucket_nhid_count_check 10 2 6 431 + check_fail $? "Group expected to be unbalanced" 432 + 433 + sleep 2 434 + $IP nexthop replace id 10 group 1/2,3 type resilient $timer 8 435 + sleep 4 436 + 437 + # 6 seconds, past the original timer. 438 + nexthop_bucket_nhid_count_check 10 2 6 439 + check_fail $? "Group still expected to be unbalanced" 440 + 441 + sleep 4 442 + 443 + # 10 seconds, past the new timer. 444 + nexthop_bucket_nhid_count_check 10 2 6 445 + check_err $? "Group expected to be balanced" 446 + 447 + log_test "Bucket migration after $timer increase" 448 + 449 + $IP nexthop flush &> /dev/null 450 + } 451 + 452 + nexthop_res_group_increase_idle_timer_test() 453 + { 454 + __nexthop_res_group_increase_timer_test idle_timer 455 + } 456 + 457 + nexthop_res_group_decrease_idle_timer_test() 458 + { 459 + __nexthop_res_group_decrease_timer_test idle_timer 460 + } 461 + 462 + nexthop_res_group_unbalanced_timer_test() 463 + { 464 + local i 465 + 466 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 467 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 468 + 469 + RET=0 470 + 471 + $IP nexthop add id 10 group 1/2 type resilient \ 472 + buckets 8 idle_timer 6 unbalanced_timer 10 473 + nexthop_res_mark_buckets_busy 10 1 474 + $IP nexthop replace id 10 group 1/2,3 type resilient 475 + 476 + for i in 1 2; do 477 + sleep 4 478 + nexthop_bucket_nhid_count_check 10 1 4 2 4 479 + check_err $? "$i: Group expected to be unbalanced" 480 + nexthop_res_mark_buckets_busy 10 1 481 + done 482 + 483 + # 3 x sleep 4 > unbalanced timer 10 484 + sleep 4 485 + nexthop_bucket_nhid_count_check 10 1 2 2 6 486 + check_err $? "Group expected to be balanced" 487 + 488 + log_test "Bucket migration after unbalanced timer" 489 + 490 + $IP nexthop flush &> /dev/null 491 + } 492 + 493 + nexthop_res_group_unbalanced_timer_del_test() 494 + { 495 + local i 496 + 497 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 498 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 499 + $IP nexthop add id 3 via 192.0.2.3 dev dummy1 500 + 501 + RET=0 502 + 503 + $IP nexthop add id 10 group 1,50/2,50/3,1 type resilient \ 504 + buckets 8 idle_timer 6 unbalanced_timer 10 505 + nexthop_res_mark_buckets_busy 10 1 506 + $IP nexthop replace id 10 group 1,50/2,150/3,1 type resilient 507 + 508 + # Check that NH delete does not reset unbalanced time. 509 + sleep 4 510 + $IP nexthop delete id 3 511 + nexthop_bucket_nhid_count_check 10 1 4 2 4 512 + check_err $? "1: Group expected to be unbalanced" 513 + nexthop_res_mark_buckets_busy 10 1 514 + 515 + sleep 4 516 + nexthop_bucket_nhid_count_check 10 1 4 2 4 517 + check_err $? "2: Group expected to be unbalanced" 518 + nexthop_res_mark_buckets_busy 10 1 519 + 520 + # 3 x sleep 4 > unbalanced timer 10 521 + sleep 4 522 + nexthop_bucket_nhid_count_check 10 1 2 2 6 523 + check_err $? "Group expected to be balanced" 524 + 525 + log_test "Bucket migration after unbalanced timer (with delete)" 526 + 527 + $IP nexthop flush &> /dev/null 528 + } 529 + 530 + nexthop_res_group_no_unbalanced_timer_test() 531 + { 532 + local i 533 + 534 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 535 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 536 + 537 + RET=0 538 + 539 + $IP nexthop add id 10 group 1/2 type resilient buckets 8 540 + nexthop_res_mark_buckets_busy 10 1 541 + $IP nexthop replace id 10 group 1/2,3 type resilient 542 + 543 + for i in $(seq 3); do 544 + sleep 60 545 + nexthop_bucket_nhid_count_check 10 2 6 546 + check_fail $? "$i: Group expected to be unbalanced" 547 + nexthop_res_mark_buckets_busy 10 1 548 + done 549 + 550 + log_test "Buckets never force-migrated without unbalanced timer" 551 + 552 + $IP nexthop flush &> /dev/null 553 + } 554 + 555 + nexthop_res_group_short_unbalanced_timer_test() 556 + { 557 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 558 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 559 + 560 + RET=0 561 + 562 + $IP nexthop add id 10 group 1/2 type resilient \ 563 + buckets 8 idle_timer 120 unbalanced_timer 4 564 + nexthop_res_mark_buckets_busy 10 1 565 + $IP nexthop replace id 10 group 1/2,3 type resilient 566 + 567 + nexthop_bucket_nhid_count_check 10 2 6 568 + check_fail $? "Group expected to be unbalanced" 569 + 570 + sleep 5 571 + 572 + nexthop_bucket_nhid_count_check 10 2 6 573 + check_err $? "Group expected to be balanced" 574 + 575 + log_test "Bucket migration after unbalanced < idle timer" 576 + 577 + $IP nexthop flush &> /dev/null 578 + } 579 + 580 + nexthop_res_group_increase_unbalanced_timer_test() 581 + { 582 + __nexthop_res_group_increase_timer_test unbalanced_timer 583 + } 584 + 585 + nexthop_res_group_decrease_unbalanced_timer_test() 586 + { 587 + __nexthop_res_group_decrease_timer_test unbalanced_timer 588 + } 589 + 590 + nexthop_res_group_force_migrate_busy_test() 591 + { 592 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 593 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 594 + 595 + RET=0 596 + 597 + $IP nexthop add id 10 group 1/2 type resilient \ 598 + buckets 8 idle_timer 120 599 + nexthop_res_mark_buckets_busy 10 1 600 + $IP nexthop replace id 10 group 1/2,3 type resilient 601 + 602 + nexthop_bucket_nhid_count_check 10 2 6 603 + check_fail $? "Group expected to be unbalanced" 604 + 605 + $IP nexthop replace id 10 group 2 type resilient 606 + nexthop_bucket_nhid_count_check 10 2 8 607 + check_err $? "All buckets expected to have migrated" 608 + 609 + log_test "Busy buckets force-migrated when NH removed" 610 + 611 + $IP nexthop flush &> /dev/null 314 612 } 315 613 316 614 nexthop_single_replace_test() ··· 811 299 nexthop_resource_set 9999 812 300 } 813 301 302 + nexthop_single_in_res_group_replace_test() 303 + { 304 + RET=0 305 + 306 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 307 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 308 + $IP nexthop add id 10 group 1/2 type resilient buckets 4 309 + 310 + $IP nexthop replace id 1 via 192.0.2.4 dev dummy1 311 + check_err $? "Failed to replace nexthop when should not" 312 + 313 + nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 314 + check_err $? "Unexpected nexthop group entry" 315 + 316 + nexthop_bucket_nhid_count_check 10 1 2 2 2 317 + check_err $? "Wrong nexthop buckets count" 318 + 319 + nexthop_resource_check 6 320 + check_err $? "Wrong nexthop occupancy" 321 + 322 + log_test "Single nexthop replace while in resilient group" 323 + 324 + $IP nexthop flush &> /dev/null 325 + } 326 + 327 + nexthop_single_in_res_group_replace_err_test() 328 + { 329 + RET=0 330 + 331 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 332 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 333 + $IP nexthop add id 10 group 1/2 type resilient buckets 4 334 + 335 + ip netns exec testns1 \ 336 + echo 1 > $DEBUGFS_NET_DIR/fib/fail_nexthop_bucket_replace 337 + $IP nexthop replace id 1 via 192.0.2.4 dev dummy1 &> /dev/null 338 + check_fail $? "Nexthop replacement succeeded when should fail" 339 + 340 + nexthop_check "id 1" "id 1 via 192.0.2.2 dev dummy1 scope link trap" 341 + check_err $? "Unexpected nexthop entry after failure" 342 + 343 + nexthop_check "id 10" "id 10 group 1/2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 344 + check_err $? "Unexpected nexthop group entry after failure" 345 + 346 + nexthop_bucket_nhid_count_check 10 1 2 2 2 347 + check_err $? "Wrong nexthop buckets count" 348 + 349 + nexthop_resource_check 6 350 + check_err $? "Wrong nexthop occupancy" 351 + 352 + log_test "Single nexthop replace while in resilient group failure" 353 + 354 + $IP nexthop flush &> /dev/null 355 + ip netns exec testns1 \ 356 + echo 0 > $DEBUGFS_NET_DIR/fib/fail_nexthop_bucket_replace 357 + } 358 + 814 359 nexthop_single_in_group_delete_test() 815 360 { 816 361 RET=0 ··· 913 344 914 345 $IP nexthop flush &> /dev/null 915 346 nexthop_resource_set 9999 347 + } 348 + 349 + nexthop_single_in_res_group_delete_test() 350 + { 351 + RET=0 352 + 353 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 354 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 355 + $IP nexthop add id 10 group 1/2 type resilient buckets 4 356 + 357 + $IP nexthop del id 1 358 + nexthop_check "id 10" "id 10 group 2 type resilient buckets 4 idle_timer 120 unbalanced_timer 0 unbalanced_time 0 trap" 359 + check_err $? "Unexpected nexthop group entry" 360 + 361 + nexthop_bucket_nhid_count_check 10 2 4 362 + check_err $? "Wrong nexthop buckets count" 363 + 364 + nexthop_resource_check 5 365 + check_err $? "Wrong nexthop occupancy" 366 + 367 + log_test "Single nexthop delete while in resilient group" 368 + 369 + $IP nexthop flush &> /dev/null 370 + } 371 + 372 + nexthop_single_in_res_group_delete_err_test() 373 + { 374 + RET=0 375 + 376 + $IP nexthop add id 1 via 192.0.2.2 dev dummy1 377 + $IP nexthop add id 2 via 192.0.2.3 dev dummy1 378 + $IP nexthop add id 3 via 192.0.2.4 dev dummy1 379 + $IP nexthop add id 10 group 1/2/3 type resilient buckets 6 380 + 381 + ip netns exec testns1 \ 382 + echo 1 > $DEBUGFS_NET_DIR/fib/fail_nexthop_bucket_replace 383 + $IP nexthop del id 1 384 + 385 + # We failed to replace the two nexthop buckets that were originally 386 + # assigned to nhid 1. 387 + nexthop_bucket_nhid_count_check 10 2 2 3 2 388 + check_err $? "Wrong nexthop buckets count" 389 + 390 + nexthop_resource_check 8 391 + check_err $? "Wrong nexthop occupancy" 392 + 393 + log_test "Single nexthop delete while in resilient group failure" 394 + 395 + $IP nexthop flush &> /dev/null 396 + ip netns exec testns1 \ 397 + echo 0 > $DEBUGFS_NET_DIR/fib/fail_nexthop_bucket_replace 916 398 } 917 399 918 400 nexthop_replay_test()