mlxsw: Allow 802.1d and .1ad VxLAN bridges to coexist on Spectrum>=2
authorAmit Cohen <amcohen@nvidia.com>
Wed, 17 Mar 2021 10:35:27 +0000 (12:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Mar 2021 19:26:28 +0000 (12:26 -0700)
commitbf677bd25a9956bbeb9b4e13cb0c786c814d917e
treebf759ce57ed6e9c020df32e9740382487ecc5567
parent0f74fa5617305aa555db7cbc8c19b8eff4806efe
mlxsw: Allow 802.1d and .1ad VxLAN bridges to coexist on Spectrum>=2

Currently only one EtherType can be configured for pushing in tunnels
because EtherType is configured using SPVID.et_vlan for tunnel port.

This behavior is forbidden by comparing mlxsw_sp_nve_config struct for
each new tunnel, the struct contains 'ethertype' field which means that
only one EtherType is legal at any given time. Remove 'ethertype' field to
allow creating VxLAN devices with different bridges.

To allow using several types of VxLAN bridges at the same time, the
EtherType should be determined at the egress port. This behavior is
achieved by setting SPVID to decide which EtherType to push at egress and
for each local_port which is member in 802.1ad bridge, set SPEVET.et_vlan
to ether_type1 (i.e., 0x88A8).

Use switchdev_ops->init() to set different mlxsw_sp_bridge_ops for
different ASICs in order to be able to split the behavior when port joins /
leaves an 802.1ad bridge in different ASICs.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c