]> git.baikalelectronics.ru Git - kernel.git/commit
udp_tunnel: add central NIC RX port offload infrastructure
authorJakub Kicinski <kuba@kernel.org>
Fri, 10 Jul 2020 00:42:46 +0000 (17:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jul 2020 20:54:00 +0000 (13:54 -0700)
commit6303b17c4ba29fac33e7eb9eeacd796c289d5dee
tree7c08c7e7f6032ca4a73333ffbbd8d794a228a913
parent68ad5c387ff9a0615eb8177a6bba9073626f42b2
udp_tunnel: add central NIC RX port offload infrastructure

Cater to devices which:
 (a) may want to sleep in the callbacks;
 (b) only have IPv4 support;
 (c) need all the programming to happen while the netdev is up.

Drivers attach UDP tunnel offload info struct to their netdevs,
where they declare how many UDP ports of various tunnel types
they support. Core takes care of tracking which ports to offload.

Use a fixed-size array since this matches what almost all drivers
do, and avoids a complexity and uncertainty around memory allocations
in an atomic context.

Make sure that tunnel drivers don't try to replay the ports when
new NIC netdev is registered. Automatic replays would mess up
reference counting, and will be removed completely once all drivers
are converted.

v4:
 - use a #define NULL to avoid build issues with CONFIG_INET=n.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c
drivers/net/vxlan.c
include/linux/netdevice.h
include/net/udp_tunnel.h
net/ipv4/Makefile
net/ipv4/udp_tunnel.c [deleted file]
net/ipv4/udp_tunnel_core.c [new file with mode: 0644]
net/ipv4/udp_tunnel_nic.c [new file with mode: 0644]
net/ipv4/udp_tunnel_stub.c [new file with mode: 0644]