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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'selftests-forwarding-vxlan_bridge_1q_mc_ul-fix-flakiness'

Petr Machata says:

====================
selftests: forwarding: vxlan_bridge_1q_mc_ul: Fix flakiness

The net/forwarding/vxlan_bridge_1q_mc_ul selftest runs an overlay traffic,
forwarded over a multicast-routed VXLAN underlay. In order to determine
whether packets reach their intended destination, it uses a TC match. For
convenience, it uses a flower match, which however does not allow matching
on the encapsulated packet. So various service traffic ends up being
indistinguishable from the test packets, and ends up confusing the test. To
alleviate the problem, the test uses sleep to allow the necessary service
traffic to run and clear the channel, before running the test traffic. This
worked for a while, but lately we have nevertheless seen flakiness of the
test in the CI.

In this patchset, first generalize tc_rule_stats_get() to support u32 in
patch #1, then in patch #2 convert the test to use u32 to allow parsing
deeper into the packet, and in #3 drop the now-unnecessary sleep.
====================

Link: https://patch.msgid.link/cover.1765289566.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+34 -46
+1
tools/testing/selftests/net/forwarding/config
··· 29 29 CONFIG_NET_CLS_BASIC=m 30 30 CONFIG_NET_CLS_FLOWER=m 31 31 CONFIG_NET_CLS_MATCHALL=m 32 + CONFIG_NET_CLS_U32=m 32 33 CONFIG_NET_EMATCH=y 33 34 CONFIG_NET_EMATCH_META=m 34 35 CONFIG_NETFILTER=y
+31 -45
tools/testing/selftests/net/forwarding/vxlan_bridge_1q_mc_ul.sh
··· 138 138 defer tc qdisc del dev "$dev" clsact 139 139 140 140 tc filter add dev "$dev" ingress proto ip pref 104 \ 141 - flower skip_hw ip_proto udp dst_port "$VXPORT" \ 142 - action pass 141 + u32 match ip protocol 0x11 0xff \ 142 + match u16 "$VXPORT" 0xffff at 0x16 \ 143 + match u16 0x0800 0xffff at 0x30 \ 144 + action pass 143 145 defer tc filter del dev "$dev" ingress proto ip pref 104 144 146 145 147 tc filter add dev "$dev" ingress proto ipv6 pref 106 \ 146 - flower skip_hw ip_proto udp dst_port "$VXPORT" \ 147 - action pass 148 + u32 match ip6 protocol 0x11 0xff \ 149 + match u16 "$VXPORT" 0xffff at 0x2a \ 150 + match u16 0x86dd 0xffff at 0x44 \ 151 + match u8 0x11 0xff at 0x4c \ 152 + action pass 148 153 defer tc filter del dev "$dev" ingress proto ipv6 pref 106 149 154 } 150 155 ··· 253 248 } 254 249 export -f vx_create 255 250 256 - vx_wait() 257 - { 258 - # Wait for all the ARP, IGMP etc. noise to settle down so that the 259 - # tunnel is clear for measurements. 260 - sleep 10 261 - } 262 - 263 251 vx10_create() 264 252 { 265 253 vx_create vx10 10 id 1000 "$@" ··· 264 266 vx_create vx20 20 id 2000 "$@" 265 267 } 266 268 export -f vx20_create 267 - 268 - vx10_create_wait() 269 - { 270 - vx10_create "$@" 271 - vx_wait 272 - } 273 - 274 - vx20_create_wait() 275 - { 276 - vx20_create "$@" 277 - vx_wait 278 - } 279 269 280 270 ns_init_common() 281 271 { ··· 540 554 # Install a misleading (S,G) rule to attempt to trick the system into 541 555 # pushing the packets elsewhere. 542 556 adf_install_broken_sg 543 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$swp2" 557 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$swp2" 544 558 do_test 4 10 0 "IPv4 nomcroute" 545 559 } 546 560 ··· 548 562 { 549 563 # Like for IPv4, install a misleading (S,G). 550 564 adf_install_broken_sg 551 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$swp2" 565 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$swp2" 552 566 do_test 6 10 0 "IPv6 nomcroute" 553 567 } 554 568 ··· 567 581 ipv4_mcroute() 568 582 { 569 583 adf_install_sg 570 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 584 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 571 585 do_test 4 10 10 "IPv4 mcroute" 572 586 } 573 587 574 588 ipv6_mcroute() 575 589 { 576 590 adf_install_sg 577 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 591 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 578 592 do_test 6 10 10 "IPv6 mcroute" 579 593 } 580 594 581 595 ipv4_mcroute_rx() 582 596 { 583 597 adf_install_sg 584 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 598 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 585 599 ipv4_do_test_rx 0 "IPv4 mcroute ping" 586 600 } 587 601 588 602 ipv6_mcroute_rx() 589 603 { 590 604 adf_install_sg 591 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 605 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 592 606 ipv6_do_test_rx 0 "IPv6 mcroute ping" 593 607 } 594 608 595 609 ipv4_mcroute_changelink() 596 610 { 597 611 adf_install_sg 598 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" 612 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" 599 613 ip link set dev vx10 type vxlan mcroute 600 614 sleep 1 601 615 do_test 4 10 10 "IPv4 mcroute changelink" ··· 604 618 ipv6_mcroute_changelink() 605 619 { 606 620 adf_install_sg 607 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 621 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 608 622 ip link set dev vx20 type vxlan mcroute 609 623 sleep 1 610 624 do_test 6 10 10 "IPv6 mcroute changelink" ··· 613 627 ipv4_mcroute_starg() 614 628 { 615 629 adf_install_starg 616 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 630 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 617 631 do_test 4 10 10 "IPv4 mcroute (*,G)" 618 632 } 619 633 620 634 ipv6_mcroute_starg() 621 635 { 622 636 adf_install_starg 623 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 637 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 624 638 do_test 6 10 10 "IPv6 mcroute (*,G)" 625 639 } 626 640 627 641 ipv4_mcroute_starg_rx() 628 642 { 629 643 adf_install_starg 630 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 644 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 631 645 ipv4_do_test_rx 0 "IPv4 mcroute (*,G) ping" 632 646 } 633 647 634 648 ipv6_mcroute_starg_rx() 635 649 { 636 650 adf_install_starg 637 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 651 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 638 652 ipv6_do_test_rx 0 "IPv6 mcroute (*,G) ping" 639 653 } 640 654 641 655 ipv4_mcroute_noroute() 642 656 { 643 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 657 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 644 658 do_test 4 0 0 "IPv4 mcroute, no route" 645 659 } 646 660 647 661 ipv6_mcroute_noroute() 648 662 { 649 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 663 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 650 664 do_test 6 0 0 "IPv6 mcroute, no route" 651 665 } 652 666 653 667 ipv4_mcroute_fdb() 654 668 { 655 669 adf_install_sg 656 - vx10_create_wait local 192.0.2.100 dev "$IPMR" mcroute 670 + vx10_create local 192.0.2.100 dev "$IPMR" mcroute 657 671 bridge fdb add dev vx10 \ 658 672 00:00:00:00:00:00 self static dst "$GROUP4" via "$IPMR" 659 673 do_test 4 10 10 "IPv4 mcroute FDB" ··· 662 676 ipv6_mcroute_fdb() 663 677 { 664 678 adf_install_sg 665 - vx20_create_wait local 2001:db8:4::1 dev "$IPMR" mcroute 679 + vx20_create local 2001:db8:4::1 dev "$IPMR" mcroute 666 680 bridge -6 fdb add dev vx20 \ 667 681 00:00:00:00:00:00 self static dst "$GROUP6" via "$IPMR" 668 682 do_test 6 10 10 "IPv6 mcroute FDB" ··· 672 686 ipv4_mcroute_fdb_oif0() 673 687 { 674 688 adf_install_sg 675 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 689 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 676 690 bridge fdb del dev vx10 00:00:00:00:00:00 677 691 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 678 692 do_test 4 10 10 "IPv4 mcroute oif=0" ··· 689 703 defer ip -6 route del table local multicast "$GROUP6/128" dev "$IPMR" 690 704 691 705 adf_install_sg 692 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 706 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 693 707 bridge -6 fdb del dev vx20 00:00:00:00:00:00 694 708 bridge -6 fdb add dev vx20 00:00:00:00:00:00 self static dst "$GROUP6" 695 709 do_test 6 10 10 "IPv6 mcroute oif=0" ··· 702 716 adf_install_sg_sep 703 717 704 718 adf_ip_addr_add lo 192.0.2.120/28 705 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 719 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 706 720 bridge fdb del dev vx10 00:00:00:00:00:00 707 721 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 708 722 do_test 4 10 10 "IPv4 mcroute TX!=RX oif=0" ··· 713 727 adf_install_sg_sep_rx lo 714 728 715 729 adf_ip_addr_add lo 192.0.2.120/28 716 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 730 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 717 731 bridge fdb del dev vx10 00:00:00:00:00:00 718 732 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 719 733 ipv4_do_test_rx 0 "IPv4 mcroute TX!=RX oif=0 ping" ··· 724 738 adf_install_sg_sep_rx lo 725 739 726 740 adf_ip_addr_add lo 192.0.2.120/28 727 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 741 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 728 742 bridge fdb del dev vx10 00:00:00:00:00:00 729 743 bridge fdb add \ 730 744 dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" via lo ··· 736 750 adf_install_sg_sep_rx "X$IPMR" 737 751 738 752 adf_ip_addr_add "X$IPMR" 2001:db8:5::1/64 739 - vx20_create_wait local 2001:db8:5::1 group "$GROUP6" dev "$IPMR" mcroute 753 + vx20_create local 2001:db8:5::1 group "$GROUP6" dev "$IPMR" mcroute 740 754 bridge -6 fdb del dev vx20 00:00:00:00:00:00 741 755 bridge -6 fdb add dev vx20 00:00:00:00:00:00 \ 742 756 self static dst "$GROUP6" via "X$IPMR"
+2 -1
tools/testing/selftests/net/lib.sh
··· 280 280 local selector=${1:-.packets}; shift 281 281 282 282 tc -j -s filter show dev $dev $dir pref $pref \ 283 - | jq ".[1].options.actions[].stats$selector" 283 + | jq ".[] | select(.options.actions) | 284 + .options.actions[].stats$selector" 284 285 } 285 286 286 287 tc_rule_handle_stats_get()