pipapo_lt_8b_to_4b(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

pipapo_lt_8b_to_4b β€” bestie, this is the glow-up function that switches your lookup table group width from 8 bits to 4 bits πŸ’… (yeah, we're doing a whole wardrobe change on the lookup table, it's giving makeover episode)

Quick vibe check: we're deep in the kernel API manual, the pipapo corner of the universe, so you know it's the nftables set-matching lore 🧚


🌸 SYNOPSIS 🌸

void pipapo_lt_8b_to_4b(int old_groups, int bsize, unsigned long *old_lt, unsigned long *new_lt);

πŸŽ€ ARGUMENTS πŸŽ€

  • old_groups β€” the number of groups you've got right now, like the headcount before the remix ✨
  • bsize β€” size of one bucket, measured in longs (yes, longs, not vibes, keep up 🫢)
  • old_lt β€” pointer to the current lookup table, the O.G. πŸ’œ
  • new_lt β€” pointer to the new lookup table, which you already pre-allocated yourself, no cap, that part is on you πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea β˜•. Every bucket with index b in the new lookup table, the one that belongs to group g, gets filled up with the bit union of these two things:

  • literally all the buckets whose index is such that the upper four bits of the lower byte equal b, taken from group g, where g is odd 🌈
  • literally all the buckets whose index is such that the lower four bits equal b, taken from group g, where g is even 🌸

So like, if you think about buckets from the new lookup table N(x, y) and the old lookup table O(x, y), where x is the bucket index and y is the group index, then:

  • when g is odd: N(b, g) := U(O(x, g) for each x : x = (b & 0xf0) >> 4)
  • when g is even: N(b, g) := U(O(x, g) for each x : x = b & 0x0f)

where U is the arbitrary union operation (that's the binary OR of n terms, for the uninitiated 🧠✨). And the whole point of this little maneuver? It ensures equivalence of the matching results on lookup. Periodt. That's the guarantee, and it ate πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

The main character file is ./net/netfilter/nft_set_pipapo.c and its buddy Theory of Operation(9), plus the whole extended friend group β€” every single one of them, no gatekeeping here 🫢:


✨ mwah πŸ’‹ that's the whole page bestie ✨

Source lives at ./net/netfilter and this lil masterpiece was stamped October 2026 β€” screenshot it, cite it, tell your friends, iykyk πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from