netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nf-next 0/4] netfilter: conntrack: avoid eache extension allocation
Date: Mon, 25 Apr 2022 15:15:40 +0200	[thread overview]
Message-ID: <20220425131544.27860-1-fw@strlen.de> (raw)

This patch series changes ecache infra to no longer allocate the
extension by default.

After this series, the default behaviour is to allocate the
extension if either a conntrack template has been set to configure event
masks via nft/iptables ruleset, the syctl 'nf_conntrack_events' is set
to 1, or if a userspace program has subscribed to one of the ctnetlink
event groups.

This has advantages in case the events are not used:
1. Conntrack allocation/free avoids extra kmalloc/kfree call.
2. nf_confirm hook doesn't perform an indirect call into ctnetlink
   only to discover that there is nothing to do.

Florian Westphal (4):
  netfilter: nfnetlink: allow to detect if ctnetlink listeners exist
  netfilter: conntrack: un-inline nf_ct_ecache_ext_add
  netfilter: conntrack: add nf_conntrack_events autodetect mode
  netfilter: prefer extension check to pointer check

 .../networking/nf_conntrack-sysctl.rst        |  5 +-
 include/net/netfilter/nf_conntrack_core.h     |  2 +-
 include/net/netfilter/nf_conntrack_ecache.h   | 49 ++++++-------------
 include/net/netns/conntrack.h                 |  1 +
 net/netfilter/nf_conntrack_core.c             | 15 ++++--
 net/netfilter/nf_conntrack_ecache.c           | 39 ++++++++++++++-
 net/netfilter/nf_conntrack_standalone.c       |  2 +-
 net/netfilter/nfnetlink.c                     | 40 +++++++++++++--
 8 files changed, 108 insertions(+), 45 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-04-25 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 13:15 Florian Westphal [this message]
2022-04-25 13:15 ` [PATCH nf-next 1/4] netfilter: nfnetlink: allow to detect if ctnetlink listeners exist Florian Westphal
2022-04-25 13:15 ` [PATCH nf-next 2/4] netfilter: conntrack: un-inline nf_ct_ecache_ext_add Florian Westphal
2022-04-25 13:15 ` [PATCH nf-next 3/4] netfilter: conntrack: add nf_conntrack_events autodetect mode Florian Westphal
2022-04-25 13:15 ` [PATCH nf-next 4/4] netfilter: prefer extension check to pointer check Florian Westphal
2022-05-09  6:07 ` [PATCH nf-next 0/4] netfilter: conntrack: avoid eache extension allocation Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220425131544.27860-1-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).