netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
authorSasha Levin <sashal@kernel.org>
Fri, 22 Sep 2023 17:01:15 +0000 (19:01 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 29 Sep 2023 04:25:15 +0000 (05:25 +0100)
commitc8a3c2e2dca69850ecb51f050bb38e3202d3f03a
treed05516a8cdddbbcef858f5359d356204b88724c2
parent62246dc0db49cc4b59bf5a938df6ccab31bcb19d
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>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name netfilter-nft_set_rbtree-use-read-spinlock-to-avoid-.patch
net/netfilter/nft_set_rbtree.c