Skip to content

Commit ebd032f

Browse files
ummakynesFlorian Westphal
authored andcommitted
netfilter: nf_tables: do not remove elements if set backend implements .abort
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. Fixes: 212ed75 ("netfilter: nf_tables: integrate pipapo into commit protocol") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
1 parent 50e4921 commit ebd032f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10347,7 +10347,10 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
1034710347
break;
1034810348
}
1034910349
te = (struct nft_trans_elem *)trans->data;
10350-
nft_setelem_remove(net, te->set, &te->elem);
10350+
if (!te->set->ops->abort ||
10351+
nft_setelem_is_catchall(te->set, &te->elem))
10352+
nft_setelem_remove(net, te->set, &te->elem);
10353+
1035110354
if (!nft_setelem_is_catchall(te->set, &te->elem))
1035210355
atomic_dec(&te->set->nelems);
1035310356

0 commit comments

Comments
 (0)