Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 0/7] prepare for EXPR_SET_ELEM removal
Date: Fri,  5 Sep 2025 17:36:20 +0200	[thread overview]
Message-ID: <20250905153627.1315405-1-pablo@netfilter.org> (raw)

Hi,

Currently EXPR_MAPPING contains EXPR_SET_ELEM in the lhs:

                      EXPR_SET_ELEM -> EXPR_VALUE
                     /
        EXPR_MAPPING |
                     \
                      EXPR_VALUE

this series normalizes the expression for mappings:

                                       EXPR_SET_ELEM -> EXPR_VALUE
                                      /
        EXPR_SET_ELEM -> EXPR_MAPPING |
                                      \
                                       EXPR_VALUE

After this update, expr_set(expr)->expressions always contains
EXPR_SET_ELEM.

Another patch in this series moves expr->flags for EXPR_SET_ELEM to
expr->key->flags.

Midterm goal is to reduce memory footprint by introducing a struct
set_elem for expr_set() whose size is smaller that struct expr,
structure location is already provided by expr->key, this will also
remove the largest EXPR_* type in the struct expr union, this is not yet
accomplished by this series.

Pablo Neira Ayuso (7):
  src: normalize set element with EXPR_MAPPING
  src: allocate EXPR_SET_ELEM for EXPR_SET in embedded set declaration in sets
  src: assert on EXPR_SET only contains EXPR_SET_ELEM in the expressions list
  evaluate: simplify sets as set elems evaluation
  evaluate: clean up expr_evaluate_set()
  segtree: rename set_elem_add() to set_elem_expr_add()
  src: move flags from EXPR_SET_ELEM to key

 include/expression.h      |   4 +-
 src/datatype.c            |   1 +
 src/evaluate.c            | 126 +++++++++++------------
 src/expression.c          |  45 ++++++--
 src/intervals.c           | 209 ++++++++++++++++++++++----------------
 src/json.c                |  42 ++++++--
 src/monitor.c             |   2 +-
 src/netlink.c             | 105 ++++++++++---------
 src/netlink_delinearize.c |  18 +++-
 src/optimize.c            |  52 ++++++----
 src/parser_bison.y        |  12 ++-
 src/parser_json.c         |  14 ++-
 src/segtree.c             |  75 +++++++-------
 13 files changed, 415 insertions(+), 290 deletions(-)

-- 
2.30.2


             reply	other threads:[~2025-09-05 15:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 15:36 Pablo Neira Ayuso [this message]
2025-09-05 15:36 ` [PATCH nft 1/7] src: normalize set element with EXPR_MAPPING Pablo Neira Ayuso
2025-09-07 14:10   ` Florian Westphal
2025-09-08  7:59     ` Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 2/7] src: allocate EXPR_SET_ELEM for EXPR_SET in embedded set declaration in sets Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 3/7] src: assert on EXPR_SET only contains EXPR_SET_ELEM in the expressions list Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 4/7] evaluate: simplify sets as set elems evaluation Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 5/7] evaluate: clean up expr_evaluate_set() Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 6/7] segtree: rename set_elem_add() to set_elem_expr_add() Pablo Neira Ayuso
2025-09-05 15:36 ` [PATCH nft 7/7] src: move flags from EXPR_SET_ELEM to key 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=20250905153627.1315405-1-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --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