Message ID | 20231012085724.15155-2-fw@strlen.de (mailing list archive) |
---|---|
State | Accepted |
Commit | ebd032fa881882fef2acb9da1bbde48d8233241d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,1/7] netfilter: nf_tables: do not remove elements if set backend implements .abort | expand |
Hello: This series was applied to netdev/net.git (main) by Florian Westphal <fw@strlen.de>: On Thu, 12 Oct 2023 10:57:04 +0200 you wrote: > From: Pablo Neira Ayuso <pablo@netfilter.org> > > pipapo set backend maintains two copies of the datastructure, removing > the elements from the copy that is going to be discarded slows down > the abort path significantly, from several minutes to few seconds after > this patch. > > [...] Here is the summary with links: - [net,1/7] netfilter: nf_tables: do not remove elements if set backend implements .abort https://git.kernel.org/netdev/net/c/ebd032fa8818 - [net,2/7] netfilter: nfnetlink_log: silence bogus compiler warning https://git.kernel.org/netdev/net/c/2e1d17541097 - [net,3/7] netfilter: nf_tables: Annotate struct nft_pipapo_match with __counted_by https://git.kernel.org/netdev/net/c/d51c42cdef5f - [net,4/7] netfilter: nf_tables: do not refresh timeout when resetting element https://git.kernel.org/netdev/net/c/4c90bba60c26 - [net,5/7] nf_tables: fix NULL pointer dereference in nft_inner_init() https://git.kernel.org/netdev/net/c/52177bbf19e6 - [net,6/7] nf_tables: fix NULL pointer dereference in nft_expr_inner_parse() https://git.kernel.org/netdev/net/c/505ce0630ad5 - [net,7/7] netfilter: nft_payload: fix wrong mac header matching https://git.kernel.org/netdev/net/c/d351c1ea2de3 You are awesome, thank you!
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index a72b6aeefb1b..c3de3791cabd 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -10347,7 +10347,10 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) break; } te = (struct nft_trans_elem *)trans->data; - nft_setelem_remove(net, te->set, &te->elem); + if (!te->set->ops->abort || + nft_setelem_is_catchall(te->set, &te->elem)) + nft_setelem_remove(net, te->set, &te->elem); + if (!nft_setelem_is_catchall(te->set, &te->elem)) atomic_dec(&te->set->nelems);