Skip to content

netfilter: conntrack: shrink size of netns_ct

Florian Westphal netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v15 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5netfilter: conntrack: move autoassign warning member to net_generic datainclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_helper.c+10 -30 replies
2/5netfilter: conntrack: move autoassign_helper sysctl to net_generic datainclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_helper.c net/netfilter/nf_conntrack_standalone.c+8 -60 replies
3/5netfilter: conntrack: move expect counter to net_generic datainclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_core.c net/netfilter/nf_conntrack_expect.c+22 -70 replies
4/5netfilter: conntrack: move ct counter to net_generic datainclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_core.c net/netfilter/nf_conntrack_netlink.c +1 more+47 -170 replies
5/5netfilter: conntrack: convert sysctls to u8include/net/netns/conntrack.h net/netfilter/nf_conntrack_proto_tcp.c net/netfilter/nf_conntrack_standalone.c+45 -540 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 0/5] netfilter: conntrack: shrink size of netns_ct

v2: fix linker error when PROCFS=n. This only affects patch 4/5, no other changes.

This reduces size of the netns_ct structure, which itself is embedded in struct net.

First two patches move two helper related settings to net_generic, these are only accessed when a new connection is added.

Patches 3 and 4 move the ct and expect counter to net_generic too. While these are used from packet path, they are not accessed when conntack finds an existing entry.

This also makes netns_ct a read-mostly structure, at this time each newly accepted conntrack dirties the first netns_ct cacheline for other cpus.

Last patch converts a few sysctls to u8. Most conntrack sysctls are timeouts, so these need to be kept as ints.

Florian Westphal (5):
netfilter: conntrack: move autoassign warning member to net_generic
data
netfilter: conntrack: move autoassign_helper sysctl to net_generic
data
netfilter: conntrack: move expect counter to net_generic data
netfilter: conntrack: move ct counter to net_generic data
netfilter: conntrack: convert sysctls to u8

 include/net/netfilter/nf_conntrack.h    |  8 +++
 include/net/netns/conntrack.h           | 23 ++++-----
 net/netfilter/nf_conntrack_core.c       | 46 ++++++++++++-----
 net/netfilter/nf_conntrack_expect.c     | 22 ++++++---
 net/netfilter/nf_conntrack_helper.c     | 15 ++++--
 net/netfilter/nf_conntrack_netlink.c    |  5 +-
 net/netfilter/nf_conntrack_proto_tcp.c  | 34 ++++++-------
 net/netfilter/nf_conntrack_standalone.c | 66 +++++++++++++------------
 8 files changed, 132 insertions(+), 87 deletions(-)
Signature · 1 line
2.26.3