conn_tab_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… conn_tab_lock(9) β€” or, how to lock your buckets without touching the rehash (iykyk)

Okay bestie, so this is a page from the Kernel API Manual, and it's about conn_tab_lock β€” the function that locks conn_tab buckets for conn hash/unhash, and not for rehash. Read that again. Not for rehash. She has boundaries. πŸ’…


✨ SYNOPSIS ✨

void conn_tab_lock (struct ip_vs_rht *t , struct ip_vs_rht *t2 , struct ip_vs_conn *cp , u32 hash_key , u32 hash_key2 , bool use2 , bool new_hash , bool new_hash2 , struct hlist_bl_head **head_ret , struct hlist_bl_head **head2_ret );

Like, she takes ten arguments. Ten. That's not a function, that's a whole group chat. 🫢 But every one of them is doing her job, so let's meet the cast.


πŸŽ€ ARGUMENTS πŸŽ€

  • t β€” the hash table for hn0. When new_hash=true, this is new_tbl. She's the main character of table one. πŸ‘‘
  • t2 β€” the hash table for hn1. When new_hash2=true, this one's new_tbl. Table two said "I also have main character energy." 🌈
  • cp β€” the connection. The whole reason we're here, honestly.
  • hash_key β€” hash key for hn0. πŸ”‘
  • hash_key2 β€” hash key for hn1. A second key, because one is never enough (see use2).
  • use2 β€” whether we're using hn1 (that's "double hashing"), and it depends on the forwarding method. So it's giving conditional, and honestly? Valid. ✨
  • new_hash β€” the mode for hn0: hash node (true) or seek node (false). Pick your vibe.
  • new_hash2 β€” the mode for hn1: hash node (true) or seek node (false). Same energy, different node.
  • head_ret β€” the head we hand back for hn0. It's an out-param, she returns it to you like a little gift 🎁
  • head2_ret β€” the head we hand back for hn1. Matching gift, obvi. πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

Not gonna lie, this function supports 3 modes, and the vibes are immaculate in all three:

  • seek mode for both nodes β€” this one's for unhashing. Both nodes seeking, no hashing, no drama. 🌸
  • hash mode for both nodes β€” this one's for hashing. Both nodes hashing. Symmetry. We love to see it. πŸ’–
  • seek hn0 and hash hn1 β€” the mixed one, used when the forwarding method is changed. She's a little bit of both, and that's iconic, periodt. πŸ¦‹
Fr fr though, remember the headline: this locks the buckets for hash/unhash. It is not for rehash. Don't come for her about rehash, she will not answer. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./net/netfilter/ipvs/ip_vs_conn.c β€” go read the source, bestie, it's right there 🧚

That's the whole page, no cap. Sending you off with the official receipts: this was the Kernel API Manual (that's the manual name, folded in cutely up top, you're welcome πŸ’œ), source lives under ./net/netfilter/ipvs, and the date on the tin is October 2026 β€” so yes, this manual page is technically from the future. Slay. ⭐ Take care of those buckets, hn0 and hn1 are counting on you. πŸŽ€

πŸ“¦ where this page comes from