Skip to content

Commit 5e62421

Browse files
idoschdavem330
authored andcommitted
selftests: mlxsw: vxlan_flooding_ipv6: Prevent flooding of unwanted packets
The test verifies that packets are correctly flooded by the bridge and the VXLAN device by matching on the encapsulated packets at the other end. However, if packets other than those generated by the test also ingress the bridge (e.g., MLD packets), they will be flooded as well and interfere with the expected count. Make the test more robust by making sure that only the packets generated by the test can ingress the bridge. Drop all the rest using tc filters on the egress of 'br0' and 'h1'. In the software data path, the problem can be solved by matching on the inner destination MAC or dropping unwanted packets at the egress of the VXLAN device, but this is not currently supported by mlxsw. Fixes: d01724d ("selftests: mlxsw: spectrum-2: Add a test for VxLAN flooding with IPv6") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 044011f commit 5e62421

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/testing/selftests/drivers/net/mlxsw/spectrum-2/vxlan_flooding_ipv6.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@ flooding_remotes_add()
159159
local lsb
160160
local i
161161

162+
# Prevent unwanted packets from entering the bridge and interfering
163+
# with the test.
164+
tc qdisc add dev br0 clsact
165+
tc filter add dev br0 egress protocol all pref 1 handle 1 \
166+
matchall skip_hw action drop
167+
tc qdisc add dev $h1 clsact
168+
tc filter add dev $h1 egress protocol all pref 1 handle 1 \
169+
flower skip_hw dst_mac de:ad:be:ef:13:37 action pass
170+
tc filter add dev $h1 egress protocol all pref 2 handle 2 \
171+
matchall skip_hw action drop
172+
162173
for i in $(eval echo {1..$num_remotes}); do
163174
lsb=$((i + 1))
164175

@@ -195,6 +206,12 @@ flooding_filters_del()
195206
done
196207

197208
tc qdisc del dev $rp2 clsact
209+
210+
tc filter del dev $h1 egress protocol all pref 2 handle 2 matchall
211+
tc filter del dev $h1 egress protocol all pref 1 handle 1 flower
212+
tc qdisc del dev $h1 clsact
213+
tc filter del dev br0 egress protocol all pref 1 handle 1 matchall
214+
tc qdisc del dev br0 clsact
198215
}
199216

200217
flooding_check_packets()

0 commit comments

Comments
 (0)