Skip to content

mlxsw: Offloading GRE tunnels

Jiri Pirko netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 1 replyIn review
  2. v121 patches 0 repliesSuperseded

Changes in v2 from the cover letter

-fix order of patch 5

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21mlxsw: reg: Update RITR to support loopback devicedrivers/net/ethernet/mellanox/mlxsw/reg.h+88 -00 replies
2/21mlxsw: reg: Update RATR to support IP-in-IP tunnelsdrivers/net/ethernet/mellanox/mlxsw/reg.h+66 -00 replies
3/21mlxsw: reg: Move enum mlxsw_reg_ratr_trap_iddrivers/net/ethernet/mellanox/mlxsw/reg.h+5 -50 replies
4/21mlxsw: reg: Add mlxsw_reg_ralue_act_ip2me_tun_pack()drivers/net/ethernet/mellanox/mlxsw/reg.h+9 -00 replies
5/21mlxsw: reg: Add Routing Tunnel Decap Properties Registerdrivers/net/ethernet/mellanox/mlxsw/reg.h+129 -00 replies
6/21mlxsw: reg: Extract mlxsw_reg_ritr_mac_pack()drivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+9 -50 replies
7/21mlxsw: reg: Give mlxsw_reg_ratr_pack a type parameterdrivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+4 -10 replies
8/21mlxsw: spectrum_router: Publish mlxsw_sp_l3protodrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+5 -50 replies
9/21mlxsw: spectrum_router: Add mlxsw_sp_ipip_opsdrivers/net/ethernet/mellanox/mlxsw/Makefile drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h +1 more+110 -20 replies
10/21mlxsw: spectrum_router: Support FID-less RIFsdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+63 -220 replies
11/21mlxsw: spectrum_router: Introduce loopback RIFsdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+164 -20 replies
12/21mlxsw: spectrum_router: Extract mlxsw_sp_fi_is_gateway()drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+10 -40 replies
13/21mlxsw: spectrum_router: Extract mlxsw_sp_rt6_is_gateway()drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+11 -40 replies
14/21mlxsw: spectrum_router: Make nexthops typeddrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+95 -430 replies
15/21mlxsw: spectrum_router: Support IPv4 overlay encapdrivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+257 -10 replies
16/21mlxsw: spectrum_router: Support IPv6 overlay encapdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+19 -10 replies
17/21mlxsw: spectrum_router: Support IPv4 underlay decapdrivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+146 -50 replies
18/21mlxsw: spectrum_router: Use existing decap routedrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+76 -40 replies
19/21mlxsw: spectrum: Register for IPIP_DECAP_ERROR trapdrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/trap.h+2 -00 replies
20/21mlxsw: spectrum_router: Add loopback accessorsdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+13 -00 replies
21/21mlxsw: spectrum_router: Support GRE tunnelsdrivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 more+207 -00 replies

Reviews trailers per patch

All 21 patches have a Reviewed-by or Acked-by.

PatchIdo Schimmel
1/21R-b
2/21R-b
3/21R-b
4/21R-b
5/21R-b
6/21R-b
7/21R-b
8/21R-b
9/21R-b
10/21R-b
11/21R-b
12/21R-b
13/21R-b
14/21R-b
15/21R-b
16/21R-b
17/21R-b
18/21R-b
19/21R-b
20/21R-b
21/21R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [patch net-next v2 00/21] mlxsw: Offloading GRE tunnels

From: Jiri Pirko <[email protected]>

Petr says:

This patch series introduces to mlxsw driver support for offloading IP-in-IP tunnels in general, and for (subset of) GRE in particular.

This patchset supports two ways of configuring GRE:

- So called "hierarchical configuration", where the GRE device has a bound dummy device, which is in a different VRF. The VRF with host traffic is called "overlay", the one with encapsulated traffic is called "underlay".

- So called "flat configuration", where the GRE device doesn't have a bound device, and overlay and underlay are both in the same VRF (possibly the default one).

Two routes are then interesting: a route that directs traffic to a GRE device (which would typically be in overlay VRF, but could be in another one), and a local route for the tunnel's local address (in underlay). Handling of these two route types is then introduced as patches to support, respectively, IPv4 and IPv6 encapsulation and IPv4 decapsulation.

The encap and decap routes then reference a loopback device, a new type of RIF introduced by this patchset for the specific use of offloading tunnels.

The encap and decap code is abstract with respect to the particulars of individual L3 tunnel types. This patchset introduces support for GRE tunnels in particular.

Limitations:

- Each tunnel needs to have a different local address (within a given VRF). When two tunnels are used that are in conflict, FIB abort is triggered and the driver ceases offloading FIBs. Full handling of such configurations needs special setup in the hardware, such that the tunnels that share an address are dispatched correctly according to their key (or lack thereof). That's currently not implemented, and to keep things deterministic, the driver triggers FIB abort.

- A next hop that uses an incompletely-specified tunnel (e.g. such that are used for LWT) is not offloaded, but doesn't trigger FIB abort like the above. If such routes end up being in a de facto conflict with other tunnels, then if there already is an offload for that address, the traffic for the conflicting tunnel will end up mismatching the configuration of the offloaded tunnel, and thus gets to slow path through an error trap.

- GRE checksumming and sequence numbers are not supported and TTL and TOS need to be set to inherit. Tunnels with a different configuration are not offloaded and their traffic is trapping to slow path.

Note in particular that TOS of inherit is not the default configuration and needs to be explicitly specified when the tunnel is created.

- The only feature that is not graciously handled is that if a change is made to the tunnel, e.g. through "ip tunnel change", such changes are not reflected in the driver. There is currently no notification mechanism for these changes. Introduction of this mechanism and its leverage in the driver will be subject of follow-up work. For now this limitation can be worked around by removing and re-adding the encap route.

---
v1->v2:
-fix order of patch 5

Petr Machata (21):
mlxsw: reg: Update RITR to support loopback device
mlxsw: reg: Update RATR to support IP-in-IP tunnels
mlxsw: reg: Move enum mlxsw_reg_ratr_trap_id
mlxsw: reg: Add mlxsw_reg_ralue_act_ip2me_tun_pack()
mlxsw: reg: Add Routing Tunnel Decap Properties Register
mlxsw: reg: Extract mlxsw_reg_ritr_mac_pack()
mlxsw: reg: Give mlxsw_reg_ratr_pack a type parameter
mlxsw: spectrum_router: Publish mlxsw_sp_l3proto
mlxsw: spectrum_router: Add mlxsw_sp_ipip_ops
mlxsw: spectrum_router: Support FID-less RIFs
mlxsw: spectrum_router: Introduce loopback RIFs
mlxsw: spectrum_router: Extract mlxsw_sp_fi_is_gateway()
mlxsw: spectrum_router: Extract mlxsw_sp_rt6_is_gateway()
mlxsw: spectrum_router: Make nexthops typed
mlxsw: spectrum_router: Support IPv4 overlay encap
mlxsw: spectrum_router: Support IPv6 overlay encap
mlxsw: spectrum_router: Support IPv4 underlay decap
mlxsw: spectrum_router: Use existing decap route
mlxsw: spectrum: Register for IPIP_DECAP_ERROR trap
mlxsw: spectrum_router: Add loopback accessors
mlxsw: spectrum_router: Support GRE tunnels

 drivers/net/ethernet/mellanox/mlxsw/Makefile       |   4 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h          | 311 ++++++-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |   1 +
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h     |   1 +
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c    | 214 +++++
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.h    |  79 ++
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  | 947 +++++++++++++++++++--
 .../net/ethernet/mellanox/mlxsw/spectrum_router.h  |  28 +
 drivers/net/ethernet/mellanox/mlxsw/trap.h         |   1 +
 9 files changed, 1485 insertions(+), 101 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h
Signature · 1 line
2.9.3