netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf 0/2] nf_tables rbtree fixes
@ 2023-01-14 23:10 Pablo Neira Ayuso
  2023-01-14 23:10 ` [PATCH nf 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
  2023-01-14 23:10 ` [PATCH nf 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection Pablo Neira Ayuso
  0 siblings, 2 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-01-14 23:10 UTC (permalink / raw)
  To: netfilter-devel; +Cc: fw, sbrivio

Hi,

The following patchset contains two fixes for the rbtree set backend:

1) Switch back to the list walk to detect overlap as proposed by Stefano.
   Use tree descent to locate nearest more than element to speed up
   overlap detection. Perform garbarge collection of expired element
   from the insert path while walking the list to avoid bogus overlap
   reports.

2) Do not interfer with ongoing transaction from garbage collector.
   Skip inactive elements from the garbage collection. Reset annotated
   end element coming before expired start element when it is busy with
   transaction update.

nftables shell test sets/0044interval_overlap_0 passes without errors.
This also passes this test when disabling set_overlap() in userspace nft
which perform overlap detection from userspace for older kernels (< 5.7).

Pablo Neira Ayuso (2):
  netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
  netfilter: nft_set_rbtree: skip elements in transaction from garbage collection

 net/netfilter/nft_set_rbtree.c | 331 ++++++++++++++++++++-------------
 1 file changed, 204 insertions(+), 127 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-17 11:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-14 23:10 [PATCH nf 0/2] nf_tables rbtree fixes Pablo Neira Ayuso
2023-01-14 23:10 ` [PATCH nf 1/2] netfilter: nft_set_rbtree: Switch to node list walk for overlap detection Pablo Neira Ayuso
2023-01-17 10:40   ` Stefano Brivio
2023-01-17 11:05     ` Pablo Neira Ayuso
2023-01-14 23:10 ` [PATCH nf 2/2] netfilter: nft_set_rbtree: skip elements in transaction from garbage collection Pablo Neira Ayuso
2023-01-17 10:41   ` Stefano Brivio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).