__skb_queue_purge_reason(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 __skb_queue_purge_reason β€” a.k.a. "empty a list" πŸ’…

okay bestie, so this one's from the Kernel API Manual and honestly? it's giving "quietly does the most important cleanup ever" energy. iconic behavior. let's get into it ✨


✨ NAME ✨

__skb_queue_purge_reason β€” literally just empty a list. that's the whole vibe. no cap, that's it 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

void __skb_queue_purge_reason (struct sk_buff_head *list , enum
skb_drop_reason reason );

look at that signature bestie. two args, no return value, zero drama (void, periodt). πŸŽ€


πŸ’– ARGUMENTS πŸ’–

  • list β€” the list you wanna empty out. the target. the main character of this whole operation. 🌸
  • reason β€” the drop reason. like, why are we yeeting these buffers? you gotta say. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” this function deletes all buffers on an sk_buff list. every single one. gone. πŸ¦‹

the way it works: each buffer is removed from the list, and one reference gets dropped for each of them. so it's not just a lazy unlink, there's actual refcount business happening. ngl, she's thorough. πŸ’…

⚠️ no cap, this part matters: this function does not take the list lock. like, at all. so the caller must hold the relevant locks to use it. if you don't, you're on your own and that's a you problem bestie 😭 please lock your lists. i'm literally begging. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

first up, the source file for all of this:

  • Kernel file ./include/linux/skbuff.h

and now the extended friend group β€” every single one of these, no skips, we don't gatekeep here 🫢🌺


and that's the whole page bestie!! πŸ§šπŸ’œ this little cutie lives over in ./include/linux and this edition is dated October 2026 β€” so like, future iconic. go forth, purge your queues, hold your locks, and slay πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from