conn_tab_lock(9)
π 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 forhn0. Whennew_hash=true, this isnew_tbl. She's the main character of table one. πt2β the hash table forhn1. Whennew_hash2=true, this one'snew_tbl. Table two said "I also have main character energy." πcpβ the connection. The whole reason we're here, honestly.hash_keyβ hash key forhn0. πhash_key2β hash key forhn1. A second key, because one is never enough (seeuse2).use2β whether we're usinghn1(that's "double hashing"), and it depends on the forwarding method. So it's giving conditional, and honestly? Valid. β¨new_hashβ the mode forhn0: hash node (true) or seek node (false). Pick your vibe.new_hash2β the mode forhn1: hash node (true) or seek node (false). Same energy, different node.head_retβ the head we hand back forhn0. It's an out-param, she returns it to you like a little gift πhead2_retβ the head we hand back forhn1. 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
hn0and hashhn1β 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
- 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