Skip to content

Commit 044011f

Browse files
idoschdavem330
authored andcommitted
selftests: mlxsw: vxlan_flooding: 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: 94d302d ("selftests: mlxsw: Add a test for VxLAN flooding") 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 c5d0fc5 commit 044011f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/testing/selftests/drivers/net/mlxsw/vxlan_flooding.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@ flooding_filters_add()
172172
local lsb
173173
local i
174174

175+
# Prevent unwanted packets from entering the bridge and interfering
176+
# with the test.
177+
tc qdisc add dev br0 clsact
178+
tc filter add dev br0 egress protocol all pref 1 handle 1 \
179+
matchall skip_hw action drop
180+
tc qdisc add dev $h1 clsact
181+
tc filter add dev $h1 egress protocol all pref 1 handle 1 \
182+
flower skip_hw dst_mac de:ad:be:ef:13:37 action pass
183+
tc filter add dev $h1 egress protocol all pref 2 handle 2 \
184+
matchall skip_hw action drop
185+
175186
tc qdisc add dev $rp2 clsact
176187

177188
for i in $(eval echo {1..$num_remotes}); do
@@ -194,6 +205,12 @@ flooding_filters_del()
194205
done
195206

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

199216
flooding_check_packets()

0 commit comments

Comments
 (0)