Skip to content

netfilter: nft_set_pipapo: speed up insertions

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfilter: nft_set_pipapo_avx2: split lookup function in two partsnet/netfilter/nft_set_pipapo_avx2.c+76 -513 replies
2/2netfilter: nft_set_pipapo: use avx2 algorithm for insertions toonet/netfilter/nft_set_pipapo.c net/netfilter/nft_set_pipapo_avx2.c net/netfilter/nft_set_pipapo_avx2.h+49 -84 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchStefano Brivio
1/2R-b
2/2R-b

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

Read the v1 thread

Cover letter [PATCH nf-next 0/2] netfilter: nft_set_pipapo: speed up insertions

Always prefer the avx2 implementation if its available. This greatly improves insertion performance (each insertion checks if the new element would overlap with an existing one):

time nft -f - <<EOF

table ip pipapo {
	set s {
		typeof ip saddr . tcp dport
		flags interval
		size 800000
		elements = { 10.1.1.1 - 10.1.1.4 . 3996,

[.. 800k entries elided .. ]

before:

real    1m55.993s
user    0m2.505s
sys     1m53.296s

after:

real    0m42.586s
user    0m2.554s
sys     0m39.811s

First patch does some refactoring so the common part can be reused for both packetpath and control plane.
Second patch alters control plane to use avx2.

Florian Westphal (2):
netfilter: nft_set_pipapo_avx2: split lookup function in two parts
netfilter: nft_set_pipapo: use avx2 algorithm for insertions too

 net/netfilter/nft_set_pipapo.c      |  47 ++++++++--
 net/netfilter/nft_set_pipapo_avx2.c | 127 +++++++++++++++++-----------
 net/netfilter/nft_set_pipapo_avx2.h |   4 +
 3 files changed, 122 insertions(+), 56 deletions(-)
Signature · 1 line
2.49.1