netfilter: x_tables: remove XT_TABLE_INFO_SZ and a dereference.
authorEric Dumazet <edumazet@google.com>
Mon, 15 Jun 2015 16:57:30 +0000 (09:57 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 15 Jun 2015 18:19:20 +0000 (20:19 +0200)
commit711bdde6a884354ddae8da2fcb495b2a9364cc90
tree3d1053945cd05a3fdcc45fa74c73b226dcf80bb3
parent53b8762727cfc81212fd7073618cb2609bd2fd60
netfilter: x_tables: remove XT_TABLE_INFO_SZ and a dereference.

After Florian patches, there is no need for XT_TABLE_INFO_SZ anymore :
Only one copy of table is kept, instead of one copy per cpu.

We also can avoid a dereference if we put table data right after
xt_table_info. It reduces register pressure and helps compiler.

Then, we attempt a kmalloc() if total size is under order-3 allocation,
to reduce TLB pressure, as in many cases, rules fit in 32 KB.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/x_tables.h
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c
net/netfilter/x_tables.c