sk_eat_skb(9)
π sk_eat_skb β the Kernel API Manual, but make it make sense β¨
okay so bestie, you found sk_eat_skb in the kernel API manual (section 9, networking-era energy π«Ά) and you're like "what does it mean to eat a socket buffer??" and honestly? valid question. let's get into it π
πΈ NAME πΈ
sk_eat_skb β Release a skb if it is no longer needed
like, the skb gets released only if it's not needed anymore. it's giving "if you don't want those fries, I'll finish them" energy π
β¨ SYNOPSIS β¨
void sk_eat_skb (struct sock *sk , struct sk_buff *skb );
that's the whole signature. returns void, so no return value to check, no "did it work" drama. iconic, honestly π
π ARGUMENTS π
skβ the socket to eat this skb from π½οΈskbβ the socket buffer to eat π
π¦ DESCRIPTION π¦
This routine must be called with interrupts disabled or with the socket locked, so that the sk_buff queue operation is ok.
bestie, this is a hard requirement, not a vibe suggestion π call it with interrupts disabled or with the socket locked, or the queue operation will not be ok. no cap, respect the locking rule.
π SEE ALSO π
all the friends in the group chat, aka the kernel file ./include/net/sock.h fam:
struct sock_common(9)struct sock(9)sk_user_data_is_nocopy(9)__locked_read_sk_user_data_with_flags(9)__rcu_dereference_sk_user_data_with_flags(9)sk_for_each_entry_offset_rcu(9)SOCK_CONNECT_BIND(9)lock_sock_fast(9)unlock_sock_fast(9)sk_wmem_alloc_get(9)sk_rmem_alloc_get(9)sk_has_allocations(9)skwq_has_sleeper(9)sock_poll_wait(9)sk_page_frag(9)_sock_tx_timestamp(9)
β the sign-off β
this page lives in ./include/net and the date on it is October 2026 π so when you're out here calling sk_eat_skb, remember: interrupts off or socket locked, periodt π
go slay those skbs bestie πβ¨
π¦ 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