Skip to content

Commit c7c059f

Browse files
daniellertsPaolo Abeni
authored andcommitted
selftests: forwarding: Fix race condition in mirror installation
When mirroring to a gretap in hardware the device expects to be programmed with the egress port and all the encapsulating headers. This requires the driver to resolve the path the packet will take in the software data path and program the device accordingly. If the path cannot be resolved (in this case because of an unresolved neighbor), then mirror installation fails until the path is resolved. This results in a race that causes the test to sometimes fail. Fix this by setting the neighbor's state to permanent in a couple of tests, so that it is always valid. Fixes: 35c31d5 ("selftests: forwarding: Test mirror-to-gretap w/ UL 802.1d") Fixes: 239e754 ("selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q") Signed-off-by: Danielle Ratson <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Petr Machata <[email protected]> Link: https://lore.kernel.org/r/268816ac729cb6028c7a34d4dda6f4ec7af55333.1687264607.git.petrm@nvidia.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7f4e097 commit c7c059f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,16 @@ cleanup()
9393

9494
test_gretap()
9595
{
96+
ip neigh replace 192.0.2.130 lladdr $(mac_get $h3) \
97+
nud permanent dev br2
9698
full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap"
9799
full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
98100
}
99101

100102
test_ip6gretap()
101103
{
104+
ip neigh replace 2001:db8:2::2 lladdr $(mac_get $h3) \
105+
nud permanent dev br2
102106
full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
103107
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
104108
}

tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,16 @@ cleanup()
9090

9191
test_gretap()
9292
{
93+
ip neigh replace 192.0.2.130 lladdr $(mac_get $h3) \
94+
nud permanent dev br1
9395
full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap"
9496
full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
9597
}
9698

9799
test_ip6gretap()
98100
{
101+
ip neigh replace 2001:db8:2::2 lladdr $(mac_get $h3) \
102+
nud permanent dev br1
99103
full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
100104
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
101105
}

0 commit comments

Comments
 (0)