OSDN Git Service

nfp: flower: offload pre-tunnel rules
authorJohn Hurley <john.hurley@netronome.com>
Sun, 4 Aug 2019 15:09:10 +0000 (16:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Aug 2019 21:24:22 +0000 (14:24 -0700)
commitf12725d98cbe862c7680c63fd1f8b381af965f7b
treed6b695879ff28cdfdd5218e13ee9ffb07a24dc15
parent120ffd84a9ec2430faba83db274a6946374f4631
nfp: flower: offload pre-tunnel rules

Pre-tunnel rules are TC flower and OvS rules that forward a packet to the
tunnel end point where it can then pass through the network stack and be
decapsulated. These are required if the tunnel end point is, say, an OvS
internal port.

Currently, firmware determines that a packet is in a tunnel and decaps it
if it has a known destination IP and MAC address. However, this bypasses
the flower pre-tunnel rule and so does not update the stats. Further to
this it ignores VLANs that may exist outside of the tunnel header.

Offload pre-tunnel rules to the NFP. This embeds the pre-tunnel rule into
the tunnel decap process based on (firmware) mac index and VLAN. This
means that decap can be carried out correctly with VLANs and that stats
can be updated for all kernel rules correctly.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/cmsg.h
drivers/net/ethernet/netronome/nfp/flower/main.c
drivers/net/ethernet/netronome/nfp/flower/main.h
drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c