Skip to content

netfilter: reduce hook sizes in struct net

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4netfilter: reduce size of hook entry point locationsinclude/linux/netfilter.h include/net/netns/netfilter.h net/bridge/br_netfilter_hooks.c +2 more+77 -130 replies
2/4netfilter: add BUILD_BUG_ON asserts for hook array sizesinclude/linux/netfilter.h+5 -03 replies
3/4netfilter: reduce hook array sizes to what is neededinclude/linux/netfilter.h include/net/netns/netfilter.h+6 -60 replies
4/4netfilter: add ifdefs to avoid memory waste if family is not supportedinclude/linux/netfilter.h include/net/netns/netfilter.h net/netfilter/core.c+24 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/4] netfilter: reduce hook sizes in struct net

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.
This can be compacted a lot by only storing the families and hooks that are actually implemented.

struct net before:
/* size: 5184, cachelines: 81, members: 46 */
after:
/* size: 4544, cachelines: 71, members: 46 */

In case this is too late just ignore this thing, I will resubmit once next opens again.