aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/netfilter_ingress.h
diff options
context:
space:
mode:
authorAaron Conole <aconole@bytheb.org>2017-08-24 00:08:32 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-08-28 17:44:00 +0200
commit960632ece6949be1ab6f7a911faa4fa6e8305f4a (patch)
tree3135ad99971cda83b1a78b0b500f8ee9e8289b86 /include/linux/netfilter_ingress.h
parentnetfilter: fix a few (harmless) sparse warnings (diff)
downloadwireguard-linux-960632ece6949be1ab6f7a911faa4fa6e8305f4a.tar.xz
wireguard-linux-960632ece6949be1ab6f7a911faa4fa6e8305f4a.zip
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>
Diffstat (limited to 'include/linux/netfilter_ingress.h')
-rw-r--r--include/linux/netfilter_ingress.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/netfilter_ingress.h b/include/linux/netfilter_ingress.h
index 59476061de86..8d5dae1e2ff8 100644
--- a/include/linux/netfilter_ingress.h
+++ b/include/linux/netfilter_ingress.h
@@ -17,7 +17,7 @@ static inline bool nf_hook_ingress_active(const struct sk_buff *skb)
/* caller must hold rcu_read_lock */
static inline int nf_hook_ingress(struct sk_buff *skb)
{
- struct nf_hook_entry *e = rcu_dereference(skb->dev->nf_hooks_ingress);
+ struct nf_hook_entries *e = rcu_dereference(skb->dev->nf_hooks_ingress);
struct nf_hook_state state;
int ret;
@@ -30,7 +30,7 @@ static inline int nf_hook_ingress(struct sk_buff *skb)
nf_hook_state_init(&state, NF_NETDEV_INGRESS,
NFPROTO_NETDEV, skb->dev, NULL, NULL,
dev_net(skb->dev), NULL);
- ret = nf_hook_slow(skb, &state, e);
+ ret = nf_hook_slow(skb, &state, e, 0);
if (ret == 0)
return -1;