Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH nft 0/7] prepare for EXPR_SET_ELEM removal
@ 2025-09-05 15:36 Pablo Neira Ayuso
  2025-09-05 15:36 ` [PATCH nft 1/7] src: normalize set element with EXPR_MAPPING Pablo Neira Ayuso
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2025-09-05 15:36 UTC (permalink / raw)
  To: netfilter-devel

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


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

end of thread, other threads:[~2025-09-08  7:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 15:36 [PATCH nft 0/7] prepare for EXPR_SET_ELEM removal Pablo Neira Ayuso
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox