linux/include/net/netns
Pablo Neira Ayuso 67cc570eda netfilter: nf_tables: coalesce multiple notifications into one skbuff
On x86_64, each notification results in one skbuff allocation which
consumes at least 768 bytes due to the skbuff overhead.

This patch coalesces several notifications into one single skbuff, so
each notification consumes at least ~211 bytes, that ~3.5 times less
memory consumption. As a result, this is reducing the chances to exhaust
the netlink socket receive buffer.

Rule of thumb is that each notification batch only contains netlink
messages whose report flag is the same, nfnetlink_send() requires this
to do appropriate delivery to userspace, either via unicast (echo
mode) or multicast (monitor mode).

The skbuff control buffer is used to annotate the report flag for later
handling at the new coalescing routine.

The batch skbuff notification size is NLMSG_GOODSIZE, using a larger
skbuff would allow for more socket receiver buffer savings (to amortize
the cost of the skbuff even more), however, going over that size might
break userspace applications, so let's be conservative and stick to
NLMSG_GOODSIZE.

Reported-by: Phil Sutter <phil@nwl.cc>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2020-09-08 13:02:44 +02:00
..
bpf.h bpf, netns: Keep a list of attached bpf_link's 2020-06-30 10:45:08 -07:00
can.h can: netns: remove "can_" prefix from members struct netns_can 2019-09-04 13:29:14 +02:00
conntrack.h netfilter: conntrack: limit sysctl setting for boolean options 2019-04-30 14:18:56 +02:00
core.h sock: Hide unused variable when !CONFIG_PROC_FS. 2017-12-19 09:58:14 -05:00
dccp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hash.h netns: provide pure entropy for net_hash_mix() 2019-03-28 17:00:45 -07:00
ieee802154_6lowpan.h net: dynamically allocate fqdir structures 2019-05-26 14:08:05 -07:00
ipv4.h tcp: add hrtimer slack to sack compression 2020-04-30 13:24:01 -07:00
ipv6.h ipv6: keep track of routes using src 2019-11-21 14:45:55 -08:00
mib.h mptcp: add and use MIB counter infrastructure 2020-03-29 22:14:49 -07:00
mpls.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
netfilter.h netfilter: don't allocate space for arp/bridge hooks unless needed 2018-01-08 18:01:11 +01:00
nexthop.h nexthop: add support for notifiers 2020-05-22 14:00:38 -07:00
nftables.h netfilter: nf_tables: coalesce multiple notifications into one skbuff 2020-09-08 13:02:44 +02:00
packet.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sctp.h sctp: add support for Primary Path Switchover 2019-11-08 14:18:32 -08:00
unix.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x_tables.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xdp.h net: xsk: track AF_XDP sockets on a per-netns list 2019-01-25 01:50:03 +01:00
xfrm.h xfrm: policy: store inexact policies in an rhashtable 2018-11-09 11:57:47 +01:00