Skip to content

netfilter: skbuff: merge nfctinfo bits and nfct pointer

Florian Westphal netfilter-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 1 replyIn review
  2. v37 patches 5 repliesSuperseded
  3. v24 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7netfilter: conntrack: no need to pass ctinfo to error handlerinclude/net/netfilter/nf_conntrack_l4proto.h net/ipv4/netfilter/nf_conntrack_proto_icmp.c net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +5 more+16 -200 replies
2/7netfilter: reset netfilter state when duplicating packetnet/ipv4/netfilter/nf_dup_ipv4.c net/ipv6/netfilter/nf_dup_ipv6.c+2 -20 replies
3/7netfilter: reduce direct skb->nfct usageinclude/net/ip_vs.h net/netfilter/nf_conntrack_core.c+15 -90 replies
4/7skbuff: add and use skb_nfct helperinclude/linux/skbuff.h include/net/netfilter/nf_conntrack_core.h net/core/skbuff.c +12 more+36 -290 replies
5/7netfilter: add and use nf_ct_set helperinclude/net/ip_vs.h include/net/netfilter/nf_conntrack.h net/ipv4/netfilter/ipt_SYNPROXY.c +9 more+24 -340 replies
6/7netfilter: guarantee 8 byte minalign for template addressesinclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_core.c+26 -50 replies
7/7netfilter: merge ctinfo into nfct pointer storage areainclude/linux/skbuff.h include/net/netfilter/nf_conntrack.h net/ipv6/netfilter/nf_dup_ipv6.c +4 more+28 -260 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH nf-next v4 0/7] netfilter: skbuff: merge nfctinfo bits and nfct pointer

Whenever we fetch skb conntrack info, we need to access two distinct cache lines in sk_buff, #2 (nfct pointer) and #3 (nfctinfo bits). This series removes nfctinfo and joins it with the data pointer in a single ulong.

We have 3 nfctinfo bits, the slab cache used for nf_conn objects guarantees at least 8 byte alignment so there is no overlap.

For the conntrack templates most arches also guarantee an 8 byte minalign, but not all.

Patch #6 adds manual alignment of the templates if ARCH_KMALLOC_MINALIGN isn't sufficient.

A followup series to this one will resurrect an old patch from Pablo that adds an 'untracked' ctinfo status, this then allows to get rid of the conntrack template object (which in turn avoids get/put atomic ops for untracked skbs).

See individual patches for changes since v3.

 include/linux/skbuff.h                         |   34 ++++++-----
 include/net/ip_vs.h                            |   12 ++--
 include/net/netfilter/nf_conntrack.h           |   21 +++++--
 include/net/netfilter/nf_conntrack_core.h      |    2 
 include/net/netfilter/nf_conntrack_l4proto.h   |    2 
 net/core/skbuff.c                              |    2 
 net/ipv4/netfilter/ipt_SYNPROXY.c              |   11 +--
 net/ipv4/netfilter/nf_conntrack_proto_icmp.c   |   17 ++---
 net/ipv4/netfilter/nf_defrag_ipv4.c            |    4 -
 net/ipv4/netfilter/nf_dup_ipv4.c               |    7 +-
 net/ipv6/netfilter/ip6t_SYNPROXY.c             |   11 +--
 net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c |   22 +++----
 net/ipv6/netfilter/nf_defrag_ipv6_hooks.c      |    4 -
 net/ipv6/netfilter/nf_dup_ipv6.c               |    7 +-
 net/netfilter/core.c                           |    2 
 net/netfilter/nf_conntrack_core.c              |   73 +++++++++++++++----------
 net/netfilter/nf_conntrack_proto_dccp.c        |    1 
 net/netfilter/nf_conntrack_proto_sctp.c        |    2 
 net/netfilter/nf_conntrack_proto_tcp.c         |    1 
 net/netfilter/nf_conntrack_proto_udp.c         |    3 -
 net/netfilter/nf_conntrack_standalone.c        |    3 +
 net/netfilter/nf_nat_helper.c                  |    2 
 net/netfilter/nft_ct.c                         |    3 -
 net/netfilter/xt_CT.c                          |   12 +---
 net/openvswitch/conntrack.c                    |   12 +---
 net/sched/cls_flow.c                           |    2 
 26 files changed, 147 insertions(+), 125 deletions(-)