Commit d02bfae3 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'selftests-forwarding-various-fixes'

Ido Schimmel says:

====================
selftests: forwarding: Various fixes

Fix various problems in the forwarding selftests so that they will pass
in the netdev CI instead of being ignored. See commit messages for
details.
====================

Link: https://lore.kernel.org/r/20240208155529.1199729-1-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 38ee0cb2 f97f1fcc
...@@ -327,10 +327,10 @@ locked_port_mab_redirect() ...@@ -327,10 +327,10 @@ locked_port_mab_redirect()
RET=0 RET=0
check_port_mab_support || return 0 check_port_mab_support || return 0
bridge link set dev $swp1 learning on locked on mab on
tc qdisc add dev $swp1 clsact tc qdisc add dev $swp1 clsact
tc filter add dev $swp1 ingress protocol all pref 1 handle 101 flower \ tc filter add dev $swp1 ingress protocol all pref 1 handle 101 flower \
action mirred egress redirect dev $swp2 action mirred egress redirect dev $swp2
bridge link set dev $swp1 learning on locked on mab on
ping_do $h1 192.0.2.2 ping_do $h1 192.0.2.2
check_err $? "Ping did not work with redirection" check_err $? "Ping did not work with redirection"
...@@ -349,8 +349,8 @@ locked_port_mab_redirect() ...@@ -349,8 +349,8 @@ locked_port_mab_redirect()
check_err $? "Locked entry not created after deleting filter" check_err $? "Locked entry not created after deleting filter"
bridge fdb del `mac_get $h1` vlan 1 dev $swp1 master bridge fdb del `mac_get $h1` vlan 1 dev $swp1 master
tc qdisc del dev $swp1 clsact
bridge link set dev $swp1 learning off locked off mab off bridge link set dev $swp1 learning off locked off mab off
tc qdisc del dev $swp1 clsact
log_test "Locked port MAB redirect" log_test "Locked port MAB redirect"
} }
......
...@@ -329,7 +329,7 @@ __cfg_test_port_ip_star_g() ...@@ -329,7 +329,7 @@ __cfg_test_port_ip_star_g()
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00"
check_err $? "(*, G) \"permanent\" entry has a pending group timer" check_err $? "(*, G) \"permanent\" entry has a pending group timer"
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "\/0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00"
check_err $? "\"permanent\" source entry has a pending source timer" check_err $? "\"permanent\" source entry has a pending source timer"
bridge mdb del dev br0 port $swp1 grp $grp vid 10 bridge mdb del dev br0 port $swp1 grp $grp vid 10
...@@ -346,7 +346,7 @@ __cfg_test_port_ip_star_g() ...@@ -346,7 +346,7 @@ __cfg_test_port_ip_star_g()
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00"
check_fail $? "(*, G) EXCLUDE entry does not have a pending group timer" check_fail $? "(*, G) EXCLUDE entry does not have a pending group timer"
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "\/0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00"
check_err $? "\"blocked\" source entry has a pending source timer" check_err $? "\"blocked\" source entry has a pending source timer"
bridge mdb del dev br0 port $swp1 grp $grp vid 10 bridge mdb del dev br0 port $swp1 grp $grp vid 10
...@@ -363,7 +363,7 @@ __cfg_test_port_ip_star_g() ...@@ -363,7 +363,7 @@ __cfg_test_port_ip_star_g()
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00"
check_err $? "(*, G) INCLUDE entry has a pending group timer" check_err $? "(*, G) INCLUDE entry has a pending group timer"
bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "\/0.00" bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00"
check_fail $? "Source entry does not have a pending source timer" check_fail $? "Source entry does not have a pending source timer"
bridge mdb del dev br0 port $swp1 grp $grp vid 10 bridge mdb del dev br0 port $swp1 grp $grp vid 10
...@@ -1252,14 +1252,17 @@ fwd_test() ...@@ -1252,14 +1252,17 @@ fwd_test()
echo echo
log_info "# Forwarding tests" log_info "# Forwarding tests"
# Set the Max Response Delay to 100 centiseconds (1 second) so that the
# bridge will start forwarding according to its MDB soon after a
# multicast querier is enabled.
ip link set dev br0 type bridge mcast_query_response_interval 100
# Forwarding according to MDB entries only takes place when the bridge # Forwarding according to MDB entries only takes place when the bridge
# detects that there is a valid querier in the network. Set the bridge # detects that there is a valid querier in the network. Set the bridge
# as the querier and assign it a valid IPv6 link-local address to be # as the querier and assign it a valid IPv6 link-local address to be
# used as the source address for MLD queries. # used as the source address for MLD queries.
ip -6 address add fe80::1/64 nodad dev br0 ip -6 address add fe80::1/64 nodad dev br0
ip link set dev br0 type bridge mcast_querier 1 ip link set dev br0 type bridge mcast_querier 1
# Wait the default Query Response Interval (10 seconds) for the bridge
# to determine that there are no other queriers in the network.
sleep 10 sleep 10
fwd_test_host fwd_test_host
...@@ -1267,6 +1270,7 @@ fwd_test() ...@@ -1267,6 +1270,7 @@ fwd_test()
ip link set dev br0 type bridge mcast_querier 0 ip link set dev br0 type bridge mcast_querier 0
ip -6 address del fe80::1/64 dev br0 ip -6 address del fe80::1/64 dev br0
ip link set dev br0 type bridge mcast_query_response_interval 1000
} }
ctrl_igmpv3_is_in_test() ctrl_igmpv3_is_in_test()
......
...@@ -209,14 +209,17 @@ test_l2_miss_multicast() ...@@ -209,14 +209,17 @@ test_l2_miss_multicast()
# both registered and unregistered multicast traffic. # both registered and unregistered multicast traffic.
bridge link set dev $swp2 mcast_router 2 bridge link set dev $swp2 mcast_router 2
# Set the Max Response Delay to 100 centiseconds (1 second) so that the
# bridge will start forwarding according to its MDB soon after a
# multicast querier is enabled.
ip link set dev br1 type bridge mcast_query_response_interval 100
# Forwarding according to MDB entries only takes place when the bridge # Forwarding according to MDB entries only takes place when the bridge
# detects that there is a valid querier in the network. Set the bridge # detects that there is a valid querier in the network. Set the bridge
# as the querier and assign it a valid IPv6 link-local address to be # as the querier and assign it a valid IPv6 link-local address to be
# used as the source address for MLD queries. # used as the source address for MLD queries.
ip link set dev br1 type bridge mcast_querier 1 ip link set dev br1 type bridge mcast_querier 1
ip -6 address add fe80::1/64 nodad dev br1 ip -6 address add fe80::1/64 nodad dev br1
# Wait the default Query Response Interval (10 seconds) for the bridge
# to determine that there are no other queriers in the network.
sleep 10 sleep 10
test_l2_miss_multicast_ipv4 test_l2_miss_multicast_ipv4
...@@ -224,6 +227,7 @@ test_l2_miss_multicast() ...@@ -224,6 +227,7 @@ test_l2_miss_multicast()
ip -6 address del fe80::1/64 dev br1 ip -6 address del fe80::1/64 dev br1
ip link set dev br1 type bridge mcast_querier 0 ip link set dev br1 type bridge mcast_querier 0
ip link set dev br1 type bridge mcast_query_response_interval 1000
bridge link set dev $swp2 mcast_router 1 bridge link set dev $swp2 mcast_router 1
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment