mlxsw: Offloading encapsulated SPAN
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest15 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | mlxsw: spectrum_ipip: Extract mlxsw_sp_l3addr_is_zerodrivers/ drivers/ | +15 | 0 replies | |
| 2/15 | mlxsw: spectrum_ipip: Support decoding IPv6 tunnel addressesdrivers/ drivers/ | +29 | 0 replies | |
| 3/15 | net: GRE: Add is_gretap_dev, is_ip6gretap_devinclude/ net/ net/ | +15 | 0 replies | |
| 4/15 | ip_tunnel: Rename & publish init_tunnel_flowinclude/ net/ | +28 | 0 replies | |
| 5/15 | mlxsw: reg: Add SPAN encapsulation to MPAT registerdrivers/ | +139 | 0 replies | |
| 6/15 | mlxsw: reg: Extend mlxsw_reg_mpat_pack()drivers/ drivers/ | +7 | 0 replies | |
| 7/15 | mlxsw: span: Remove span_entry by span_iddrivers/ drivers/ drivers/ +4 more | +37 | 0 replies | |
| 8/15 | mlxsw: spectrum_span: Initialize span_entry.id eagerlydrivers/ | +9 | 0 replies | |
| 9/15 | mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de,}configure()drivers/ | +29 | 0 replies | |
| 10/15 | mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entrydrivers/ drivers/ drivers/ +4 more | +56 | 0 replies | |
| 11/15 | mlxsw: spectrum_span: Generalize SPAN supportdrivers/ drivers/ drivers/ +1 more | +147 | 0 replies | |
| 12/15 | mlxsw: Handle config changes pertinent to SPANdrivers/ drivers/ drivers/ +1 more | +49 | 0 replies | |
| 13/15 | mlxsw: Move a mirroring check to mlxsw_sp_span_entry_createdrivers/ drivers/ | +5 | 0 replies | |
| 14/15 | mlxsw: spectrum_span: Support mirror to gretapdrivers/ drivers/ drivers/ | +175 | 0 replies | |
| 15/15 | mlxsw: spectrum_span: Support mirror to ip6gretapdrivers/ drivers/ | +103 | 3 replies |
Reviews trailers per patch
All 15 patches have a Reviewed-by or Acked-by.
| Patch | Ido Schimmel |
|---|---|
| 1/15 | R-b |
| 2/15 | R-b |
| 3/15 | R-b |
| 4/15 | R-b |
| 5/15 | R-b |
| 6/15 | R-b |
| 7/15 | R-b |
| 8/15 | R-b |
| 9/15 | R-b |
| 10/15 | R-b |
| 11/15 | R-b |
| 12/15 | R-b |
| 13/15 | R-b |
| 14/15 | R-b |
| 15/15 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch net-next 00/15] mlxsw: Offloading encapsulated SPAN
From: Jiri Pirko <[email protected]>
Petr says:
This patch series introduces support for mirroring with GRE encapsulation. It offloads tc action mirred mirror from a mlxsw port to either a gretap or an ip6gretap netdevice.
Spectrum hardware needs to know all the details of the requested
encapsulation: source and destination MAC and IP addresses, details of VLAN tagging, etc. The only variables are the encapsulated packet itself, and TOS field, which may be inherited. To that end, mlxsw driver resolves the route that encapsulated packets would take, queries the corresponding neighbor, and with that configuration in hand, configures the mirroring in the hardware.
The driver also hooks into event handlers for netdevice changes, FIB and neighbor events, and reconsiders the configuration on each such change. When the new configuration differs from the currently-offloaded one, the existing offload is removed and replaced with a new one.
It is possible to mirror to {ip6,}gretap from a matchall rule as well as from a flower match.
** Note that with this patch set, mlxsw build depends on NET_IPGRE and
IPV6_GRE.
Current limitations:
- There has to be a route that directs packets to an mlxsw port. We intend to extend the logic to support other netdevice types in the future, but the eventual egress netdevice will have to be an mlxsw port in any case.
- Offload reconfiguration due to changes in netdevice configuration creates a window of time where packets are not mirrored. Under some circumstances this can be prevented by configuring an unused port analyzer and migrating mirrors over to that. However that's currently not implemented.
- Remote address of a tunnel device needs to be set, there may not be a GRE key, checksumming or sequence numbers, and TTL needs to be fixed (non-inherit). These are hard requirements imposed by the underlying hardware.
- TOS of a tunnel device needs to be "inherit". The hardware supports a fixed TOS, but that's currently not implemented.
The series start with two patches, #1 and #2, that publish one function and add support for querying IPv6 tunnel parameters.
In patches #3 and #4, we introduce helpers to GRE and tunneling code that we will use later in the patchset from the SPAN code.
Patches #5 and #6 introduce support for encapsulated SPAN in reg.h.
The following seven patches, #7-#13, then prepare the SPAN codebase for introduction of mirroring to netdevices that don't correspond to front panel ports.
Then #14 and #15 pull all this together to implement mirroring to {ip6,}gretap netdevices.
Petr Machata (15):
mlxsw: spectrum_ipip: Extract mlxsw_sp_l3addr_is_zero
mlxsw: spectrum_ipip: Support decoding IPv6 tunnel addresses
net: GRE: Add is_gretap_dev, is_ip6gretap_dev
ip_tunnel: Rename & publish init_tunnel_flow
mlxsw: reg: Add SPAN encapsulation to MPAT register
mlxsw: reg: Extend mlxsw_reg_mpat_pack()
mlxsw: span: Remove span_entry by span_id
mlxsw: spectrum_span: Initialize span_entry.id eagerly
mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de,}configure()
mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entry
mlxsw: spectrum_span: Generalize SPAN support
mlxsw: Handle config changes pertinent to SPAN
mlxsw: Move a mirroring check to mlxsw_sp_span_entry_create
mlxsw: spectrum_span: Support mirror to gretap
mlxsw: spectrum_span: Support mirror to ip6gretap
drivers/net/ethernet/mellanox/mlxsw/Kconfig | 4 + .../mellanox/mlxsw/core_acl_flex_actions.c | 19 +- .../mellanox/mlxsw/core_acl_flex_actions.h | 9 +- drivers/net/ethernet/mellanox/mlxsw/reg.h | 145 +++++- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 50 +- drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 9 +- .../mellanox/mlxsw/spectrum_acl_flex_actions.c | 33 +- .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c | 45 +- .../net/ethernet/mellanox/mlxsw/spectrum_ipip.h | 8 +- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 7 + .../net/ethernet/mellanox/mlxsw/spectrum_span.c | 522 +++++++++++++++++++-- .../net/ethernet/mellanox/mlxsw/spectrum_span.h | 41 +- include/net/gre.h | 3 + include/net/ip_tunnels.h | 16 + net/ipv4/ip_gre.c | 6 + net/ipv4/ip_tunnel.c | 40 +- net/ipv6/ip6_gre.c | 6 + 18 files changed, 808 insertions(+), 157 deletions(-)
Signature · 1 line
2.14.3