[PATCH nft 0/3] memory reduction in concatenation and maps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This series uses EXPR_RANGE_VALUE in maps to reduce memory usage:

Patch #1 reduces memory footprint in concatenation of intervals,
with the following 100k example set:

 table inet x {
        set y {
                typeof ip saddr . tcp dport
                flags interval
                elements = {
                        0.1.2.0-0.1.2.240 . 0-1,
                        ...				# 100k-1 entries more
                }
        }
 }

Before: 123.80 Mbytes
After:   80.19 Mbytes (-35.23%)

Patch #2 remove EXPR_F_SINGLETON in EXPR_RANGE_VALUE that is required
by next patch.

Patch #3 reduces memory footprint in maps.

With 100k map with concatenations:

  table inet x {
         map y {
                    typeof ip saddr . tcp dport :  ip saddr
                    flags interval
                    elements = {
                        1.0.2.0-1.0.2.240 . 0-2 : 1.0.2.10,
                        ...
         }
  }

Before: 153.6 Mbytes
After: 108.9 Mbytes (-29.11%)

With 100k map without concatenations:

  table inet x {
         map y {
                    typeof ip saddr :  ip saddr
                    flags interval
                    elements = {
                        1.0.2.0-1.0.2.240 : 1.0.2.10,
                        ...
         }
  }

Before: 74.36 Mbytes
After: 62.39 Mbytes (-16.10%)

This is passing tests/shell.

Pablo Neira Ayuso (3):
  src: use constant range expression for interval+concatenation sets
  expression: constant range is not a singleton
  src: use EXPR_RANGE_VALUE in interval maps

 src/evaluate.c   |  8 ++++---
 src/expression.c |  2 +-
 src/netlink.c    | 61 ++++++++++++++++++++++++++++++++++++++++++------
 src/optimize.c   |  3 +++
 4 files changed, 63 insertions(+), 11 deletions(-)

-- 
2.30.2





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux