[PATCH net-next mlxsw 0/6] Tie bridge RIF FID to bridge PVID

Petr Machata petrm at mellanox.com
Tue Jun 5 23:37:32 AEST 2018


When traffic is inserted on a router interface associated with an 802.1q
bridge, the VLAN that the traffic appears on is determined by PVID of the
bridge CPU port. However currently mlxsw always configures such traffic
to be forwarded to VLAN 1, regardless of the bridge PVID.

Fix the problem by modifying the FID-handling code to assign such
traffic not to FID that corresponds to VLAN 1, but to a FID that
corresponds to the configured PVID. Bail out if there is no PVID. This
is implemented in patches #1 and #2.

>From that point on, also forbid any changes to CPU port PVID, because
such changes would not be reflected. This is implemented in patches #3,
#4 and #5.

Finally in patch #6, introduce tests that use bridge as a routed
interface, and test mlxsw in both the currently-supported scenario of
using PVID 1, and the newly-supported one of using a custom PVID.

Petr Machata (6):
  mlxsw: spectrum_router: Propagate extack to .fid_get()
  mlxsw: spectrum_router: Allocate FID according to PVID
  mlxsw: spectrum_router: Publish mlxsw_sp_rif_find_by_dev()
  mlxsw: spectrum_router: Add mlxsw_sp_rif_fid()
  mlxsw: spectrum_switchdev: Ban PVID change if bridge has a RIF
  selftests: forwarding: Test routed bridge interface

 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  42 +++++---
 .../net/ethernet/mellanox/mlxsw/spectrum_router.h  |   3 +
 .../ethernet/mellanox/mlxsw/spectrum_switchdev.c   |  38 ++++++-
 .../selftests/net/forwarding/router_bridge.sh      | 113 +++++++++++++++++++
 .../selftests/net/forwarding/router_bridge_vlan.sh | 119 +++++++++++++++++++++
 5 files changed, 301 insertions(+), 14 deletions(-)
 create mode 100755 tools/testing/selftests/net/forwarding/router_bridge.sh
 create mode 100755 tools/testing/selftests/net/forwarding/router_bridge_vlan.sh

-- 
2.4.11



More information about the Linux-mlxsw mailing list