]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: flower: offload tunnel decap rules via indirect TC blocks
authorJohn Hurley <john.hurley@netronome.com>
Sat, 10 Nov 2018 05:21:29 +0000 (21:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Nov 2018 17:54:53 +0000 (09:54 -0800)
commit266395d897e886526a445f9a055ef973d7dec651
treed51a3ea773e675248593c8feebfecbfcb682dc05
parent63dc792a9b2e4c33ee0e2b5416f54ab2bb2ccb6e
nfp: flower: offload tunnel decap rules via indirect TC blocks

Previously, TC block tunnel decap rules were only offloaded when a
callback was triggered through registration of the rules egress device.
This meant that the driver had no access to the ingress netdev and so
could not verify it was the same tunnel type that the rule implied.

Register tunnel devices for indirect TC block offloads in NFP, giving
access to new rules based on the ingress device rather than egress. Use
this to verify the netdev type of VXLAN and Geneve based rules and offload
the rules to HW if applicable.

Tunnel registration is done via a netdev notifier. On notifier
registration, this is triggered for already existing netdevs. This means
that NFP can register for offloads from devices that exist before it is
loaded (filter rules will be replayed from the TC core). Similarly, on
notifier unregister, a call is triggered for each currently active netdev.
This allows the driver to unregister any indirect block callbacks that may
still be active.

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