All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 00/11] nf_tables datapath ruleset blob and register tracking
@ 2021-12-10  0:28 Pablo Neira Ayuso
  2021-12-10  0:28 ` [PATCH nf-next 01/11] netfilter: nft_connlimit: move stateful fields out of expression data Pablo Neira Ayuso
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Pablo Neira Ayuso @ 2021-12-10  0:28 UTC (permalink / raw)
  To: netfilter-devel

Hi,

The following patchset contains updates for the datapath ruleset
representation and new infrastructure to skip redundant selector store
to register operations.

- Patch 1 to 6, allocate stateful information via kmalloc() to prepare
  for the ruleset blob layout.

- Patch 7, adds datapath blob ruleset per chain representation, generated
  from the commit phase. This blob contains read-only ruleset data:

      size (unsigned long)
        struct nft_rule_dp
          struct nft_expr
          ...
        struct nft_rule_dp
          struct nft_expr
          ...
        struct nft_rule_dp (is_last=1)

  The new structure nft_rule_dp represents the rule in a more compact way
  (smaller memory footprint) compared to the control-plane nft_rule
  structure.

  The ruleset blob is a read-only data structure. The first field contains
  the blob size, then the rules containing expressions. There is a trailing
  rule which is used by the tracing infrastructure which is equivalent to
  the NULL rule marker in the previous representation. The blob size field
  does not include the size of this trailing rule marker.

- Patch 8 to 11, adds register tracking infrastructure to skip redundant
  selector store operations on registers which allows to recycle existing
  data. This results in a x2 boost in performance in pure linear rulesets,
  but it also helps a bit in rulesets already heavily relying in maps.
  This infra supports for dynamic ruleset updates since the ruleset blob
  is generated from the kernel on updates.

Userspace update is needed to maximize register utilization, to allow
the nf_tables kernel side to recycle register data.

This is still v1, quickly tested here.

Thanks.

Pablo Neira Ayuso (11):
  netfilter: nft_connlimit: move stateful fields out of expression data
  netfilter: nft_last: move stateful fields out of expression data
  netfilter: nft_quota: move stateful fields out of expression data
  netfilter: nft_numgen: move stateful fields out of expression data
  netfilter: nft_limit: rename stateful structure
  netfilter: nft_limit: move stateful fields out of expression data
  netfilter: nf_tables: add rule blob layout
  netfilter: nf_tables: add register tracking infrastructure
  netfilter: nft_payload: track register operations
  netfilter: nft_meta: track register operations
  netfilter: nft_bitwise: track register operations

 include/net/netfilter/nf_tables.h |  34 +++++-
 net/netfilter/nf_tables_api.c     | 132 +++++++++++++++--------
 net/netfilter/nf_tables_core.c    |  41 ++++---
 net/netfilter/nf_tables_trace.c   |   2 +-
 net/netfilter/nft_bitwise.c       |  79 ++++++++++++++
 net/netfilter/nft_connlimit.c     |  26 +++--
 net/netfilter/nft_last.c          |  69 ++++++++----
 net/netfilter/nft_limit.c         | 172 +++++++++++++++++++++---------
 net/netfilter/nft_meta.c          |  37 +++++++
 net/netfilter/nft_numgen.c        |  34 ++++--
 net/netfilter/nft_payload.c       |  39 +++++++
 net/netfilter/nft_quota.c         |  52 ++++++++-
 12 files changed, 564 insertions(+), 153 deletions(-)

--
2.30.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-10  0:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10  0:28 [PATCH nf-next 00/11] nf_tables datapath ruleset blob and register tracking Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 01/11] netfilter: nft_connlimit: move stateful fields out of expression data Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 02/11] netfilter: nft_last: " Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 03/11] netfilter: nft_quota: " Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 04/11] netfilter: nft_numgen: " Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 05/11] netfilter: nft_limit: rename stateful structure Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 06/11] netfilter: nft_limit: move stateful fields out of expression data Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 07/11] netfilter: nf_tables: add rule blob layout Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 08/11] netfilter: nf_tables: add register tracking infrastructure Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 09/11] netfilter: nft_payload: track register operations Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 10/11] netfilter: nft_meta: " Pablo Neira Ayuso
2021-12-10  0:28 ` [PATCH nf-next 11/11] netfilter: nft_bitwise: " Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.