mbox series

[net-next,00/16] selftests: Preparations for out-of-order-operations patches in mlxsw

Message ID cover.1687265905.git.petrm@nvidia.com
Headers show
Series selftests: Preparations for out-of-order-operations patches in mlxsw | expand

Message

Petr Machata June 20, 2023, 1:55 p.m. UTC
The mlxsw driver currently makes the assumption that the user applies
configuration in a bottom-up manner. Thus netdevices need to be added to
the bridge before IP addresses are configured on that bridge or SVI added
on top of it. Enslaving a netdevice to another netdevice that already has
uppers is in fact forbidden by mlxsw for this reason. Despite this safety,
it is rather easy to get into situations where the offloaded configuration
is just plain wrong.

Over the course of the following several patchsets, mlxsw code is going to
be adjusted to diminish the space of wrongly offloaded configurations.
Ideally the offload state will reflect the actual state, regardless of the
sequence of operation used to construct that state.

Several selftests build configurations that will not be offloadable in the
future on some systems. The reason is that what will get offloaded is the
actual configuration, not the configuration steps.

For example, when a port is added to a bridge that has an IP address, that
bridge will get a RIF, which it would not have with the current code. But
on Nvidia Spectrum-1 machines, MAC addresses of all RIFs need to have the
same prefix, which the bridge will violate. The RIF thus couldn't be
created, and the enslavement is therefore canceled, because it would lead
to an unoffloadable configuration. This breaks some selftests.

In this patchset, adjust selftests to avoid the configurations that mlxsw
would be incapable of offloading, while maintaining relevance with regards
to the feature that is being tested. There are generally two cases of
fixes:

- Disabling IPv6 autogen on bridges that do not participate in routing,
  either because of the abovementioned requirement to keep the same MAC
  prefix on all in-HW router interfaces, or, on 802.1ad bridges, because
  in-HW router interfaces are not supported at all.

- Setting the bridge MAC address to what it will become after the first
  member port is attached, so that the in-HW router interface is created
  with a supported MAC address.

The patchset is then split thus:

- Patches #1-#7 adjust generic selftests
- Patches #8-#16 adjust mlxsw-specific selftests

Petr Machata (16):
  selftests: forwarding: q_in_vni: Disable IPv6 autogen on bridges
  selftests: forwarding: dual_vxlan_bridge: Disable IPv6 autogen on
    bridges
  selftests: forwarding: skbedit_priority: Disable IPv6 autogen on a
    bridge
  selftests: forwarding: pedit_dsfield: Disable IPv6 autogen on a bridge
  selftests: forwarding: mirror_gre_*: Disable IPv6 autogen on bridges
  selftests: forwarding: mirror_gre_*: Use port MAC for bridge address
  selftests: forwarding: router_bridge: Use port MAC for bridge address
  selftests: mlxsw: q_in_q_veto: Disable IPv6 autogen on bridges
  selftests: mlxsw: extack: Disable IPv6 autogen on bridges
  selftests: mlxsw: mirror_gre_scale: Disable IPv6 autogen on a bridge
  selftests: mlxsw: qos_dscp_bridge: Disable IPv6 autogen on a bridge
  selftests: mlxsw: qos_ets_strict: Disable IPv6 autogen on bridges
  selftests: mlxsw: qos_mc_aware: Disable IPv6 autogen on bridges
  selftests: mlxsw: spectrum: q_in_vni_veto: Disable IPv6 autogen on a
    bridge
  selftests: mlxsw: vxlan: Disable IPv6 autogen on bridges
  selftests: mlxsw: one_armed_router: Use port MAC for bridge address

 .../selftests/drivers/net/mlxsw/extack.sh     | 24 ++++++++---
 .../drivers/net/mlxsw/mirror_gre_scale.sh     |  1 +
 .../drivers/net/mlxsw/one_armed_router.sh     |  3 +-
 .../drivers/net/mlxsw/q_in_q_veto.sh          |  8 ++++
 .../drivers/net/mlxsw/qos_dscp_bridge.sh      |  1 +
 .../drivers/net/mlxsw/qos_ets_strict.sh       |  8 +++-
 .../drivers/net/mlxsw/qos_mc_aware.sh         |  2 +
 .../net/mlxsw/spectrum/q_in_vni_veto.sh       |  1 +
 .../selftests/drivers/net/mlxsw/vxlan.sh      | 41 ++++++++++++++-----
 .../net/forwarding/dual_vxlan_bridge.sh       |  1 +
 .../net/forwarding/mirror_gre_bound.sh        |  1 +
 .../net/forwarding/mirror_gre_bridge_1d.sh    |  3 +-
 .../forwarding/mirror_gre_bridge_1d_vlan.sh   |  3 +-
 .../forwarding/mirror_gre_bridge_1q_lag.sh    |  3 +-
 .../net/forwarding/mirror_topo_lib.sh         |  1 +
 .../selftests/net/forwarding/pedit_dsfield.sh |  4 +-
 .../selftests/net/forwarding/q_in_vni.sh      |  1 +
 .../selftests/net/forwarding/router_bridge.sh |  3 +-
 .../net/forwarding/skbedit_priority.sh        |  4 +-
 19 files changed, 88 insertions(+), 25 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 21, 2023, 9:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 20 Jun 2023 15:55:46 +0200 you wrote:
> The mlxsw driver currently makes the assumption that the user applies
> configuration in a bottom-up manner. Thus netdevices need to be added to
> the bridge before IP addresses are configured on that bridge or SVI added
> on top of it. Enslaving a netdevice to another netdevice that already has
> uppers is in fact forbidden by mlxsw for this reason. Despite this safety,
> it is rather easy to get into situations where the offloaded configuration
> is just plain wrong.
> 
> [...]

Here is the summary with links:
  - [net-next,01/16] selftests: forwarding: q_in_vni: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/8c3736ce595b
  - [net-next,02/16] selftests: forwarding: dual_vxlan_bridge: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/c801533304ca
  - [net-next,03/16] selftests: forwarding: skbedit_priority: Disable IPv6 autogen on a bridge
    https://git.kernel.org/netdev/net-next/c/d7442b7d288e
  - [net-next,04/16] selftests: forwarding: pedit_dsfield: Disable IPv6 autogen on a bridge
    https://git.kernel.org/netdev/net-next/c/f61018dc3e21
  - [net-next,05/16] selftests: forwarding: mirror_gre_*: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/92c3bb5393db
  - [net-next,06/16] selftests: forwarding: mirror_gre_*: Use port MAC for bridge address
    https://git.kernel.org/netdev/net-next/c/8fd32576e650
  - [net-next,07/16] selftests: forwarding: router_bridge: Use port MAC for bridge address
    https://git.kernel.org/netdev/net-next/c/5e71bf50c2e2
  - [net-next,08/16] selftests: mlxsw: q_in_q_veto: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/8cfdd300a5e9
  - [net-next,09/16] selftests: mlxsw: extack: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/a758dc469a9c
  - [net-next,10/16] selftests: mlxsw: mirror_gre_scale: Disable IPv6 autogen on a bridge
    https://git.kernel.org/netdev/net-next/c/32b3a7bf8570
  - [net-next,11/16] selftests: mlxsw: qos_dscp_bridge: Disable IPv6 autogen on a bridge
    https://git.kernel.org/netdev/net-next/c/6349f9bbbfb2
  - [net-next,12/16] selftests: mlxsw: qos_ets_strict: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/ec7023e6745e
  - [net-next,13/16] selftests: mlxsw: qos_mc_aware: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/ea2d5f757e91
  - [net-next,14/16] selftests: mlxsw: spectrum: q_in_vni_veto: Disable IPv6 autogen on a bridge
    https://git.kernel.org/netdev/net-next/c/08035d8e354d
  - [net-next,15/16] selftests: mlxsw: vxlan: Disable IPv6 autogen on bridges
    https://git.kernel.org/netdev/net-next/c/5541577521cc
  - [net-next,16/16] selftests: mlxsw: one_armed_router: Use port MAC for bridge address
    https://git.kernel.org/netdev/net-next/c/664bc72dd200

You are awesome, thank you!