From: Willem de Bruijn <will...@google.com> This is a *very rough* draft. Mainly for discussion while we also look at another partially overlapping approach [1].
Reduce UDP receive cost for bulk traffic by enabling datagram coalescing with GRO. Before adding more GRO callbacks, make GRO configurable by the administrator to optionally reduce the attack surface of this early receive path. See also [2]. Introduce sysctls net.(core|ipv4|ipv6).gro that expose the table of protocols for which GRO is support. Allow the administrator to disable individual entries in the table. To have a single infrastructure, convert dev_offloads to the table-based approach to existing inet(6)_offloads. Additional small benefit is that ipv6 will no longer take two list lookups to find. Patch 1 converts dev_offloads to the infra of inet(6)_offloads Patch 2 deduplicates gro_complete logic now that all share infra Patch 3 does the same for gro_receive, in anticipation of adding a branch to check whether gro_receive is enabled Patch 4 harmonizes ipv6 header opts, so that those, too can be optionally disabled. Patch 5 makes inet(6)_offloads non-const to allow disabling a flag Patch 6 introduces the administrative sysctl Patch 7 avoids udp gro cost if no udp gro callback is register Patch 8 introduces udp gro [1] http://patchwork.ozlabs.org/project/netdev/list/?series=65741 [2] http://vger.kernel.org/netconf2017_files/rx_hardening_and_udp_gso.pdf Willem de Bruijn (8): gro: convert device offloads to net_offload gro: deduplicate gro_complete gro: add net_gro_receive ipv6: remove offload exception for hopopts net: deconstify net_offload net: make gro configurable udp: gro behind static key udp: add gro drivers/net/geneve.c | 11 +--- drivers/net/vxlan.c | 8 +++ include/linux/netdevice.h | 64 +++++++++++++++++++-- include/net/protocol.h | 19 ++----- include/net/udp.h | 2 + include/uapi/linux/udp.h | 1 + net/8021q/vlan.c | 12 +--- net/core/dev.c | 112 ++++++++----------------------------- net/core/sysctl_net_core.c | 60 ++++++++++++++++++++ net/ethernet/eth.c | 13 +---- net/ipv4/af_inet.c | 21 ++----- net/ipv4/esp4_offload.c | 2 +- net/ipv4/fou.c | 41 ++++---------- net/ipv4/gre_offload.c | 26 ++++----- net/ipv4/protocol.c | 10 ++-- net/ipv4/sysctl_net_ipv4.c | 7 +++ net/ipv4/tcp_offload.c | 2 +- net/ipv4/udp.c | 73 +++++++++++++++++++++++- net/ipv4/udp_offload.c | 19 +++---- net/ipv6/esp6_offload.c | 2 +- net/ipv6/exthdrs_offload.c | 17 +++++- net/ipv6/ip6_offload.c | 69 +++++++++-------------- net/ipv6/protocol.c | 10 ++-- net/ipv6/sysctl_net_ipv6.c | 8 +++ net/ipv6/tcpv6_offload.c | 2 +- net/ipv6/udp.c | 2 +- net/ipv6/udp_offload.c | 4 +- net/sctp/offload.c | 2 +- 28 files changed, 344 insertions(+), 275 deletions(-) -- 2.19.0.397.gdd90340f6a-goog