]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: convert hook list to an array
authorAaron Conole <aconole@bytheb.org>
Wed, 23 Aug 2017 22:08:32 +0000 (00:08 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 Aug 2017 15:44:00 +0000 (17:44 +0200)
commit9f62bf5133c1161772ec52f7ba14c096c90c5f88
tree3135ad99971cda83b1a78b0b500f8ee9e8289b86
parented73089b236cf37dbf3c8c45c14e1d45db64a1d7
netfilter: convert hook list to an array

This converts the storage and layout of netfilter hook entries from a
linked list to an array.  After this commit, hook entries will be
stored adjacent in memory.  The next pointer is no longer required.

The ops pointers are stored at the end of the array as they are only
used in the register/unregister path and in the legacy br_netfilter code.

nf_unregister_net_hooks() is slower than needed as it just calls
nf_unregister_net_hook in a loop (i.e. at least n synchronize_net()
calls), this will be addressed in followup patch.

Test setup:
 - ixgbe 10gbit
 - netperf UDP_STREAM, 64 byte packets
 - 5 hooks: (raw + mangle prerouting, mangle+filter input, inet filter):
empty mangle and raw prerouting, mangle and filter input hooks:
353.9
this patch:
364.2

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netdevice.h
include/linux/netfilter.h
include/linux/netfilter_ingress.h
include/net/netfilter/nf_queue.h
include/net/netns/netfilter.h
net/bridge/br_netfilter_hooks.c
net/netfilter/core.c
net/netfilter/nf_internals.h
net/netfilter/nf_queue.c