netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 22 Sep 2023 16:30:25 +0000 (18:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:34 +0000 (14:56 +0200)
commit92b4b4bde94033b03a030964bc003cdfd8c44e16
treec89610836d951b08e536391899e96b8cc877a361
parent9a8c544158f68f656d1734eb5ba00c4f817b76b1
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention

commit 96b33300fba880ec0eafcf3d82486f3463b4b6da upstream.

rbtree GC does not modify the datastructure, instead it collects expired
elements and it enqueues a GC transaction. Use a read spinlock instead
to avoid data contention while GC worker is running.

Fixes: f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_set_rbtree.c