Florian Westphal b0f38338ae netfilter: reduce size of hook entry point locations
struct net contains:

struct nf_hook_entries __rcu *hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];

which store the hook entry point locations for the various protocol
families and the hooks.

Using array results in compact c code when doing accesses, i.e.
  x = rcu_dereference(net->nf.hooks[pf][hook]);

but its also wasting a lot of memory, as most families are
not used.

So split the array into those families that are used, which
are only 5 (instead of 13).  In most cases, the 'pf' argument is
constant, i.e. gcc removes switch statement.

struct net before:
 /* size: 5184, cachelines: 81, members: 46 */
after:
 /* size: 4672, cachelines: 73, members: 46 */

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-01-08 18:01:08 +01:00
..
2017-07-11 06:08:58 -04:00
2017-04-05 10:15:20 +02:00
2016-07-08 12:20:57 +02:00
2017-08-31 14:42:19 -07:00
2017-11-30 09:54:27 -05:00
2017-10-11 09:49:34 +02:00
2017-11-16 10:49:00 +09:00
2017-12-11 14:10:06 -05:00
2018-01-07 21:29:40 -05:00
2017-12-15 12:34:00 -05:00
2017-09-29 06:19:32 +01:00
2016-08-17 19:36:23 -04:00
2016-10-03 02:00:22 -04:00
2016-07-08 12:20:57 +02:00
2017-11-08 16:12:33 +09:00
2017-12-05 14:37:13 -05:00
2017-12-04 11:32:53 -05:00