Skip to content

netfilter: reduce hook array sizes

Florian Westphal netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest5 patches 0 repliesNew

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5netfilter: add defines for arp/decnet max hooksinclude/linux/netfilter_defs.h include/uapi/linux/netfilter_arp.h include/uapi/linux/netfilter_decnet.h+12 -10 replies
2/5netfilter: reduce hook array sizes to what is neededinclude/net/netns/netfilter.h net/netfilter/core.c+22 -120 replies
3/5netfilter: don't allocate space for decnet hooks unless neededinclude/linux/netfilter.h include/net/netns/netfilter.h net/netfilter/core.c+8 -00 replies
4/5netfilter: don't allocate space for arp/bridge hooks unless neededinclude/linux/netfilter.h include/net/netns/netfilter.h net/Kconfig +5 more+29 -00 replies
5/5netfilter: reduce NF_MAX_HOOKS defineinclude/linux/netfilter_defs.h+7 -30 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 nf-next 0/5] netfilter: reduce hook array sizes

This series further reduces size of the hook arrays by only resevering space for the hooks that are implemented/supported (e.g., arp only supports 3 different hook points as it lacks PRE/POST_ROUTING).

Furthermore, add #ifdef guard to not declare arp/bridge/decnet hooks unless they are needed.

At least Fedora has CONFIG_DECNET=n so this even reduces size for some distro kernels.

I ran a few randconfig builds last night and it did not catch any build errors.

See individual patches for changes since v2.

Florian Westphal (5):
netfilter: add defines for arp/decnet max hooks
netfilter: reduce hook array sizes to what is needed
netfilter: don't allocate space for decnet hooks unless needed
netfilter: don't allocate space for arp/bridge hooks unless needed
netfilter: reduce NF_MAX_HOOKS define

 include/linux/netfilter.h             |    6 +++++
 include/linux/netfilter_defs.h        |   12 ++++++++++-
 include/net/netns/netfilter.h         |   16 ++++++++++-----
 include/uapi/linux/netfilter_arp.h    |    3 ++
 include/uapi/linux/netfilter_decnet.h |    4 ++-
 net/Kconfig                           |    1 
 net/bridge/netfilter/Kconfig          |    2 +
 net/ipv4/netfilter/Kconfig            |    2 +
 net/netfilter/Kconfig                 |    6 +++++
 net/netfilter/core.c                  |   36 +++++++++++++++++++++++++++-------
 net/netfilter/nf_queue.c              |    2 +
 11 files changed, 76 insertions(+), 14 deletions(-)