Skip to content

netfilter: reduce struct net size

Florian Westphal netfilter-devel 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 1 replyApplied
  2. v111 patches 0 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/11netfilter: nfnetlink: add and use nfnetlink_broadcastinclude/linux/netfilter/nfnetlink.h net/netfilter/nfnetlink.c net/netfilter/nfnetlink_acct.c+10 -20 replies
2/11netfilter: nfnetlink: use net_generic infranet/netfilter/nfnetlink.c+44 -180 replies
3/11netfilter: cttimeout: use net_generic infranet/netfilter/nfnetlink_cttimeout.c+32 -90 replies
4/11netfilter: nf_defrag_ipv6: use net_generic infrainclude/net/netfilter/ipv6/nf_defrag_ipv6.h net/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/netfilter/nf_defrag_ipv6_hooks.c+52 -370 replies
5/11netfilter: nf_defrag_ipv4: use net_generic infranet/ipv4/netfilter/nf_defrag_ipv4.c+15 -50 replies
6/11netfilter: ebtables: use net_generic infranet/bridge/netfilter/ebtables.c+34 -50 replies
7/11netfilter: nf_tables: use net_generic infra for transaction datainclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nf_tables_offload.c +2 more+243 -1280 replies
8/11netfilter: x_tables: move known table lists to net_generic infranet/netfilter/x_tables.c+33 -130 replies
9/11netfilter: conntrack: move sysctl pointer to net_generic infrainclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_standalone.c+9 -40 replies
10/11netfilter: conntrack: move ecache dwork to net_generic infrainclude/net/netfilter/nf_conntrack.h include/net/netfilter/nf_conntrack_ecache.h net/netfilter/nf_conntrack_core.c +1 more+47 -280 replies
11/11net: remove obsolete members from struct netinclude/net/net_namespace.h include/net/netns/conntrack.h include/net/netns/netfilter.h +2 more+0 -270 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH nf-next v2 00/11] netfilter: reduce struct net size

This series moves part of netfilter related pernet data from struct net to net_generic() infrastructure.

All of these users can be modules, so if they are not loaded there is no need to waste space.

Also, none of the struct members that are (re)moved are used in packet path.

A followup patch series will also remove ebt/arp/ip/ip6tables xt_table anchors from struct net.

Size reduction is 7 cachelines on x86_64.

Only change since v1 is in patch 7, it removes a 'unused variable' warning.

Florian Westphal (11):
netfilter: nfnetlink: add and use nfnetlink_broadcast
netfilter: nfnetlink: use net_generic infra
netfilter: cttimeout: use net_generic infra
netfilter: nf_defrag_ipv6: use net_generic infra
netfilter: nf_defrag_ipv4: use net_generic infra
netfilter: ebtables: use net_generic infra
netfilter: nf_tables: use net_generic infra for transaction data
netfilter: x_tables: move known table lists to net_generic infra
netfilter: conntrack: move sysctl pointer to net_generic infra
netfilter: conntrack: move ecache dwork to net_generic infra
net: remove obsolete members from struct net

 include/linux/netfilter/nfnetlink.h         |   2 +
 include/net/net_namespace.h                 |   9 -
 include/net/netfilter/ipv6/nf_defrag_ipv6.h |   6 +
 include/net/netfilter/nf_conntrack.h        |   7 +
 include/net/netfilter/nf_conntrack_ecache.h |  33 +--
 include/net/netfilter/nf_tables.h           |  11 +
 include/net/netns/conntrack.h               |   4 -
 include/net/netns/netfilter.h               |   6 -
 include/net/netns/nftables.h                |   7 -
 include/net/netns/x_tables.h                |   1 -
 net/bridge/netfilter/ebtables.c             |  39 ++-
 net/ipv4/netfilter/nf_defrag_ipv4.c         |  20 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c     |  68 +++--
 net/ipv6/netfilter/nf_defrag_ipv6_hooks.c   |  15 +-
 net/netfilter/nf_conntrack_core.c           |   7 +-
 net/netfilter/nf_conntrack_ecache.c         |  31 +-
 net/netfilter/nf_conntrack_standalone.c     |  10 +-
 net/netfilter/nf_tables_api.c               | 313 +++++++++++++-------
 net/netfilter/nf_tables_offload.c           |  30 +-
 net/netfilter/nfnetlink.c                   |  67 +++--
 net/netfilter/nfnetlink_acct.c              |   3 +-
 net/netfilter/nfnetlink_cttimeout.c         |  41 ++-
 net/netfilter/nft_chain_filter.c            |  11 +-
 net/netfilter/nft_dynset.c                  |   6 +-
 net/netfilter/x_tables.c                    |  46 ++-
 25 files changed, 518 insertions(+), 275 deletions(-)
Signature · 1 line
2.26.3