nft_pipapo_commit(9)
π nft_pipapo_commit(9)
okay so this is a page from the Kernel API Manual, and today's main character is nft_pipapo_commit(9) β like, a genuinely iconic little function that swaps your lookup data over to the current working copy. periodt. β¨
πΈ NAME
nft_pipapo_commit β replace lookup data with current working copy
Bestie, that's literally the whole job: out with the old lookup table, in with the working copy. π
π¦ SYNOPSIS
void nft_pipapo_commit (struct nft_set *set );
Returns nothing (void), takes one thing, does the swap. That's it, that's the vibe. π
π ARGUMENTS
setβ the nftables API set representation π«Ά (yes, that set, the one you've been pouring all your insertions and deletions into)
π DESCRIPTION
So while we're at it β and this is the important part β we check whether we should perform garbage collection on the working copy before committing it for lookup. Like, do we tidy up first or nah? π₯
And no cap: if the working copy doesn't have pending changes, we don't replace the table. Lowkey respect, honestly. Why redo work that's already done?
We also need to create a new working copy for subsequent insertions and deletions β because after the swap, the old working copy is out here living its new life as the live copy, so future you needs somewhere fresh to work. It's giving main character energy, but the sequel version. π
After the live copy has been replaced by the clone, we can safely queue expired elements that have been collected by pipapo_gc_scan for memory reclaim. π§ So: clone in, expired elements queued, memory reclaimed, everyone goes home happy.
β οΈ tiny order-of-operations reminder: the queueing of expired elements is safe after the live copy has been replaced by the clone. Do it in that order, iykyk. π
π SEE ALSO
Kernel file ./net/netfilter/nft_set_pipapo.c Theory of Operation(9)pipapo_refill(9)pipapo_get_slow(9)pipapo_get(9)nft_pipapo_lookup(9)nft_pipapo_get(9)pipapo_realloc_mt(9)lt_calculate_size(9)pipapo_resize(9)pipapo_bucket_set(9)pipapo_lt_4b_to_8b(9)pipapo_lt_8b_to_4b(9)pipapo_lt_bits_adjust(9)pipapo_insert(9)pipapo_step_diff(9)pipapo_step_after_end(9)pipapo_base_sum(9)pipapo_expand(9)pipapo_map(9)pipapo_free_scratch(9)pipapo_realloc_scratch(9)pipapo_maybe_clone(9)nft_pipapo_insert(9)pipapo_clone(9)pipapo_rules_same_key(9)pipapo_unmap(9)pipapo_drop(9)pipapo_gc_scan(9)pipapo_gc_queue(9)pipapo_free_fields(9)pipapo_reclaim_match(9)nft_pipapo_activate(9)nft_pipapo_deactivate(9)nft_pipapo_flush(9)pipapo_get_boundaries(9)pipapo_match_field(9)nft_pipapo_remove(9)nft_pipapo_do_walk(9)nft_pipapo_walk(9)nft_pipapo_privsize(9)nft_pipapo_estimate(9)nft_pipapo_init(9)nft_set_pipapo_match_destroy(9)nft_pipapo_destroy(9)nft_pipapo_gc_init(9)
okay that's the whole page, bestie, you ate that ππ and yes β this diva lives in ./net/netfilter, dated October 2026. slay, go read the source, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms