Skip to content

netfilter: nft_set_pipapo: speed up bulk element insertions

Florian Westphal netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4netfilter: nft_set_pipapo: constify lookup fn args where possiblenet/netfilter/nft_set_pipapo.c net/netfilter/nft_set_pipapo.h net/netfilter/nft_set_pipapo_avx2.c+48 -350 replies
2/4netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTRnet/netfilter/nft_set_pipapo.c+14 -61 reply
3/4netfilter: nft_set_pipapo: shrink data structuresnet/netfilter/nft_set_pipapo.c net/netfilter/nft_set_pipapo.h+51 -400 replies
4/4netfilter: nft_set_pipapo: speed up bulk element insertionsnet/netfilter/nft_set_pipapo.c net/netfilter/nft_set_pipapo.h+69 -160 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStefano Brivio
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 nf-next 0/4] netfilter: nft_set_pipapo: speed up bulk element insertions

v2: addressed comments from Stefano, see patches for details.

Bulk insertions into pipapo set type take a very long time, each new element allocates space for elem+1 elements, then copies all existing elements and appends the new element.

Alloc extra slack space to reduce the realloc overhead to speed this up.

While at it, shrink a few data structures, in may cases a much smaller type can be used.

Florian Westphal (4):
netfilter: nft_set_pipapo: constify lookup fn args where possible
netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR
netfilter: nft_set_pipapo: shrink data structures
netfilter: nft_set_pipapo: speed up bulk element insertions

 net/netfilter/nft_set_pipapo.c      | 178 ++++++++++++++++++++--------
 net/netfilter/nft_set_pipapo.h      |  37 +++---
 net/netfilter/nft_set_pipapo_avx2.c |  59 +++++----
 3 files changed, 179 insertions(+), 95 deletions(-)
Signature · 1 line
2.43.0