OSDN Git Service

selftests: forwarding: router_bridge: Use port MAC for bridge address
authorPetr Machata <petrm@nvidia.com>
Tue, 20 Jun 2023 13:55:53 +0000 (15:55 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Jun 2023 21:02:52 +0000 (14:02 -0700)
In a future patch, mlxsw will start adding RIFs to uppers of front panel
port netdevices, if they have an IP address.

At the time that the front panel port is enslaved to the bridge, the bridge
MAC address does not have the same prefix as other interfaces in the
system. On Nvidia Spectrum-1 machines all the RIFs have to have the same
38-bit MAC address prefix. Since the bridge does not obey this limitation,
the RIF cannot be created, and the enslavement attempt is vetoed on the
grounds of the configuration not being offloadable.

The bridge eventually inherits MAC address from its first member, after the
enslavement is acked. A number of (mainly VXLAN) selftests already work
around the problem by setting the MAC address to whatever it will
eventually be anyway. Do the same here.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/router_bridge.sh

index ebc596a..8ce0aed 100755 (executable)
@@ -38,7 +38,8 @@ h2_destroy()
 
 router_create()
 {
-       ip link add name br1 type bridge vlan_filtering 1
+       ip link add name br1 address $(mac_get $swp1) \
+               type bridge vlan_filtering 1
        ip link set dev br1 up
 
        ip link set dev $swp1 master br1