STRUCT BPF_KSOCK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so this page is struct bpf_ksock(9) from the Kernel API Manual, and it’s literally a refcounted BPF kernel socket context πŸ’…βœ¨. that’s the whole vibe bestie: a BPF kernel socket context that is refcounted. slay.

πŸ¦‹ SYNOPSIS πŸ¦‹

struct bpf_ksock {
    struct socket *sock;
    refcount_t usage;
    struct rcu_work rwork;
 };

πŸŽ€ Members πŸŽ€

  • sock β€” the underlying kernel socket. the main character socket, no cap 🫢
  • usage β€” reference counter. it keeps track of refs, periodt πŸ‘‘
  • rwork β€” RCU work for deferred cleanup (sock_release may sleep). so yes, cleanup is deferred, and sock_release may sleep 😴

πŸ‘€ SEE ALSO πŸ‘€


xoxo from ./net/core β€” that’s the source/version bestie β€” dated October 2026 πŸŽ€πŸ’–. bye bestie, go read those other pages! 🌈

πŸ“¦ where this page comes from