Skip to content

netfilter: nft_set_pipapo_avx2: don't return non-matching entry

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expirynet/netfilter/nft_set_pipapo_avx2.c+10 -101 reply
2/2selftests: netfilter: nft_concat_range.sh: add check for flush+reload bugtools/testing/selftests/net/netfilter/nft_concat_range.sh+67 -11 reply

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 0/2] netfilter: nft_set_pipapo_avx2: don't return non-matching entry

While adding more comprehensive tests for set transactions to nftables I found nft cannot restore a valid set via:

(echo flush set t s; cat foo) | nft -f -

... because the avx2 functions can return a non-matching entry iff the entry that it found in first round was expired.

Patch 1 fixes this bug and patch 2 add a test that triggers the problem.

- C implementation doesn't have this problem
- forcing 'slow' mode in avx2 by axing the actual avx2 routines also 'fixes' this issue
- No noticeable performance differences with this patch.
- Also have an alternative fix that calls pipapo_refill OR nft_pipapo_avx2_refill, but that diff is significantly larger, so I picked the one that is smaller.

Florian Westphal (2):
netfilter: nft_set_pipapo_avx2: don't return non-matching entry on
expiry
selftests: netfilter: nft_concat_range.sh: add check for flush+reload
bug

 net/netfilter/nft_set_pipapo_avx2.c           | 20 +++---
 .../net/netfilter/nft_concat_range.sh         | 68 ++++++++++++++++++-
 2 files changed, 77 insertions(+), 11 deletions(-)
Signature · 1 line
2.52.0