Skip to content

nf_tables set updates

Pablo Neira Ayuso netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9netfilter: nft_set_hash: unnecessary forward declarationnet/netfilter/nft_set_hash.c+8 -100 replies
2/9netfilter: nf_tables: no size estimation if number of set elements is unknownnet/netfilter/nft_set_hash.c net/netfilter/nft_set_rbtree.c+7 -180 replies
3/9netfilter: nft_set_hash: use nft_rhash prefix for resizable set backendnet/netfilter/nft_set_hash.c+106 -1060 replies
4/9netfilter: nf_tables: select set backend flavour depending on descriptioninclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nft_set_bitmap.c +2 more+80 -350 replies
5/9netfilter: nf_tables: pass set description to ->privsizeinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nft_set_bitmap.c +2 more+9 -50 replies
6/9netfilter: nft_set_hash: add nft_hash_buckets()net/netfilter/nft_set_hash.c+6 -10 replies
7/9netfilter: nf_tables: allow large allocations for new setsnet/netfilter/nf_tables_api.c+14 -53 replies
8/9netfilter: nft_set_hash: add non-resizable hashtable implementationnet/netfilter/nft_set_hash.c+203 -91 reply
9/9netfilter: nft_set_hash: add lookup variant for fixed size hashtablenet/netfilter/nft_set_hash.c+58 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/9] nf_tables set updates

Hi,

The following patchset contains updates for the nf_tables set infrastructure, specifically new infrastructure to select between several set backend operation of one single type, a new fixed hashtable set implementation and general performance improvements for the hashtable set type:

1) Remove unnecessary forward declaration in nft_set_hash.

2) Do not lie to the set backend selection algorithm. If we don't know the number of set elements, we cannot provide any size. We now have the memory scalability notation to use it in this case.

3) Rename nft_hash_ to nft_rhash_ for the resizable hash implementation.

4) Pass set description to ->privsize, this is required by the new fixed size hashtable implementation.

5) Add nft_hash_buckets() helper function to calculate the number of hashtable buckets both for fixed and resizable hashtables.

6) Add infrastructure to select between several set backend variants, so we can accomodate the fixed hashtable implementation in the nf_tables hashtable set type.

7) Allow large allocation for new sets, the fixed size hashtable places the bucket array in a flexible array, and its size may trigger memory allocation failures via kmalloc(), thus, fall back to vmalloc().

8) Add faster fixed size hashtable implementation. ~10% faster than the resizable hashtable, and this is just ~200 lines of code of a very simple hashtable implementation.

9) Add faster 2-byte and 4-byte lookup function for fixed hashtable, using the new set operation selection infrastructure.

Pablo Neira Ayuso (9):
netfilter: nft_set_hash: unnecessary forward declaration
netfilter: nf_tables: no size estimation if number of set elements is unknown
netfilter: nft_set_hash: use nft_rhash prefix for resizable set backend
netfilter: nf_tables: select set backend flavour depending on description
netfilter: nf_tables: pass set description to ->privsize
netfilter: nft_set_hash: add nft_hash_buckets()
netfilter: nf_tables: allow large allocations for new sets
netfilter: nft_set_hash: add non-resizable hashtable implementation
netfilter: nft_set_hash: add lookup variant for fixed size hashtable

 include/net/netfilter/nf_tables.h |  29 ++-
 net/netfilter/nf_tables_api.c     |  80 ++++---
 net/netfilter/nft_set_bitmap.c    |  13 +-
 net/netfilter/nft_set_hash.c      | 471 +++++++++++++++++++++++++++++---------
 net/netfilter/nft_set_rbtree.c    |  21 +-
 5 files changed, 457 insertions(+), 157 deletions(-)
Signature · 1 line
2.1.4