Skip to content

Commit

Permalink
selftests: forwarding: Fix race condition in mirror installation
Browse files Browse the repository at this point in the history
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 <danieller@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/268816ac729cb6028c7a34d4dda6f4ec7af55333.1687264607.git.petrm@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
daniellerts authored and Paolo Abeni committed Jun 22, 2023
1 parent 7f4e097 commit c7c059f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,16 @@ cleanup()

test_gretap()
{
ip neigh replace 192.0.2.130 lladdr $(mac_get $h3) \
nud permanent dev br2
full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap"
full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
}

test_ip6gretap()
{
ip neigh replace 2001:db8:2::2 lladdr $(mac_get $h3) \
nud permanent dev br2
full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ cleanup()

test_gretap()
{
ip neigh replace 192.0.2.130 lladdr $(mac_get $h3) \
nud permanent dev br1
full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap"
full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap"
}

test_ip6gretap()
{
ip neigh replace 2001:db8:2::2 lladdr $(mac_get $h3) \
nud permanent dev br1
full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap"
full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap"
}
Expand Down

0 comments on commit c7c059f

Please sign in to comment.