All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 0/9] nft_set_pipapo: remove cannot-fail allocations on commit and abort
@ 2024-04-03  8:41 Florian Westphal
  2024-04-03  8:41 ` [PATCH nf-next 1/9] netfilter: nft_set_pipapo: move prove_locking helper around Florian Westphal
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Florian Westphal @ 2024-04-03  8:41 UTC (permalink / raw)
  To: netfilter-devel; +Cc: sbrivio, Florian Westphal

pipapo keeps one active set data (used from datapath) and one shadow
copy, in priv->clone, used from transactional path to update the set.

On abort and commit, the clone/shadow becomes the active set,
and a new clone is made for the next transaction.

The problem with this is that we cannot fail in ->commit.

This patchset rearranges priv->clone allocation so the cloning occurs on
the first insertion/removal.

set flush needs a bit of extra work, this is done by adding a iter_type
hint to the walker callbacks so that a set flush will be able to perform
the needed clone.

The dirty flag is no longer meaningful after these changes, so last
patch removes it again.

After this patch it is possible to elide calls to nft_setelem_remove
from the abort path IFF the set backend implements an abort() function,
but this change isn't included here.

Florian Westphal (9):
  netfilter: nft_set_pipapo: move prove_locking helper around
  netfilter: nft_set_pipapo: make pipapo_clone helper return NULL
  netfilter: nft_set_pipapo: prepare destroy function for on-demand clone
  netfilter: nft_set_pipapo: prepare walk function for on-demand clone
  netfilter: nf_tables: pass new nft_iter_type hint to walker
  netfilter: nft_set_pipapo: merge deactivate helper into caller
  netfilter: nft_set_pipapo: prepare pipapo_get helper for on-demand clone
  netfilter: nft_set_pipapo: move cloning of match info to
    insert/removal path
  netfilter: nft_set_pipapo: remove dirty flag

 include/net/netfilter/nf_tables.h |  12 ++
 net/netfilter/nf_tables_api.c     |   1 +
 net/netfilter/nft_set_pipapo.c    | 259 +++++++++++++++---------------
 net/netfilter/nft_set_pipapo.h    |   2 -
 4 files changed, 140 insertions(+), 134 deletions(-)

-- 
2.43.2


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

end of thread, other threads:[~2024-04-09 13:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03  8:41 [PATCH nf-next 0/9] nft_set_pipapo: remove cannot-fail allocations on commit and abort Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 1/9] netfilter: nft_set_pipapo: move prove_locking helper around Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 2/9] netfilter: nft_set_pipapo: make pipapo_clone helper return NULL Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 3/9] netfilter: nft_set_pipapo: prepare destroy function for on-demand clone Florian Westphal
2024-04-08 15:45   ` Stefano Brivio
2024-04-09 11:07     ` Florian Westphal
2024-04-09 12:54       ` Stefano Brivio
2024-04-09 13:04         ` Florian Westphal
2024-04-09 13:10           ` Stefano Brivio
2024-04-03  8:41 ` [PATCH nf-next 4/9] netfilter: nft_set_pipapo: prepare walk " Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 5/9] netfilter: nf_tables: pass new nft_iter_type hint to walker Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 6/9] netfilter: nft_set_pipapo: merge deactivate helper into caller Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 7/9] netfilter: nft_set_pipapo: prepare pipapo_get helper for on-demand clone Florian Westphal
2024-04-03  8:41 ` [PATCH nf-next 8/9] netfilter: nft_set_pipapo: move cloning of match info to insert/removal path Florian Westphal
2024-04-08 15:45   ` Stefano Brivio
2024-04-03  8:41 ` [PATCH nf-next 9/9] netfilter: nft_set_pipapo: remove dirty flag Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.