]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - net/core/flow_offload.c
net: flow_offload: consolidate indirect flow_block infrastructure
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 29 May 2020 00:25:35 +0000 (02:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jun 2020 18:41:12 +0000 (11:41 -0700)
commit1fac52da5942c58dd3e337fd7c5a550925ca752e
tree7f13f7aa52d4285ef434c6857f34deda4061de74
parenta8284c6899cf7321abbd258d970a9442978b0a4f
net: flow_offload: consolidate indirect flow_block infrastructure

Tunnel devices provide no dev->netdev_ops->ndo_setup_tc(...) interface.
The tunnel device and route control plane does not provide an obvious
way to relate tunnel and physical devices.

This patch allows drivers to register a tunnel device offload handler
for the tc and netfilter frontends through flow_indr_dev_register() and
flow_indr_dev_unregister().

The frontend calls flow_indr_dev_setup_offload() that iterates over the
list of drivers that are offering tunnel device hardware offload
support and it sets up the flow block for this tunnel device.

If the driver module is removed, the indirect flow_block ends up with a
stale callback reference. The module removal path triggers the
dev_shutdown() path to remove the qdisc and the flow_blocks for the
physical devices. However, this is not useful for tunnel devices, where
relation between the physical and the tunnel device is not explicit.

This patch introduces a cleanup callback that is invoked when the driver
module is removed to clean up the tunnel device flow_block. This patch
defines struct flow_block_indr and it uses it from flow_block_cb to
store the information that front-end requires to perform the
flow_block_cb cleanup on module removal.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/flow_offload.h
net/core/flow_offload.c