[PATCH net-next mlxsw v2 0/7] mlxsw: SPAN: Support routes pointing at bridges
petrm at mellanox.com
Wed Apr 25 09:08:38 AEST 2018
When mirroring to a gretap or ip6gretap netdevice, the route that
directs the encapsulated packets can reference a bridge. In that case,
in the software model, the packet is switched.
Thus when offloading mirroring like that, take into consideration FDB,
STP, PVID configured at the bridge, and whether that VLAN ID should be
tagged on egress.
Patch #1 introduces a suite of functions to query various bridge bits of
configuration: FDB, VLAN groups, etc.
Patches #2 and #3 refactor some existing code and introduce a new
With patches #4, #5 and #6, mlxsw calls mlxsw_sp_span_respin() on
switchdev events as well. There is no impact yet, because bridge as an
underlay device is still not allowed.
That is implemented in patch #7, which uses the new interfaces to figure
out on which one port the mirroring should be configured, and whether
the mirrored packets should be VLAN-tagged and how.
Changes from v1 to v2:
- Handle switchdev_port_obj_add and switchdev_port_obj_del. To that end,
add a new patch to pass VLAN objects through respin function to SPAN
parms hook. Adjust patch #7 to take advantage of the information to
get updated VLAN configuration.
- The part of patchset that dealt with sending events for non-user-added
FDB entries was split out and will be posted separately.
- See also notes at individual patches.
Petr Machata (7):
net: bridge: Publish bridge accessor functions
mlxsw: spectrum: Extract mlxsw_sp_stp_spms_state()
mlxsw: spectrum_switchdev: Publish two functions
mlxsw: spectrum: Register SPAN before switchdev
mlxsw: spectrum: Pass switchdev VLAN object to SPAN respin
mlxsw: Respin SPAN on switchdev events
mlxsw: spectrum_span: Allow bridge for gretap mirror
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 52 ++++----
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 1 +
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 6 +-
.../net/ethernet/mellanox/mlxsw/spectrum_span.c | 132 ++++++++++++++++++---
.../net/ethernet/mellanox/mlxsw/spectrum_span.h | 6 +-
.../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 32 ++++-
.../ethernet/mellanox/mlxsw/spectrum_switchdev.h | 43 +++++++
include/linux/if_bridge.h | 55 +++++++++
net/bridge/br_fdb.c | 23 ++++
net/bridge/br_private.h | 17 ++-
net/bridge/br_vlan.c | 32 +++++
11 files changed, 341 insertions(+), 58 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.h
More information about the Linux-mlxsw