Merge branch 'mlxsw-Offloading-GRE-tunnels'
Jiri Pirko says:
====================
mlxsw: Offloading GRE tunnels
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
====================
Signed-off-by: David S. Miller <davem@davemloft.net>