nft_pipapo_commit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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


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