__netdev_alloc_skb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __netdev_alloc_skb(9) πŸ’–

okay bestie, gather round πŸ’… this is the Kernel API Manual page for __netdev_alloc_skb(9) β€” yes the title is also the function, we love a main character. It’s all about allocating an skbuff for rx on a specific device, and every detail is right here. 🫢


✨ NAME ✨

__netdev_alloc_skb β€” allocate an skbuff for rx on a specific device πŸ¦‹

🌸 SYNOPSIS 🌸

struct sk_buff * __netdev_alloc_skb (struct net_device *dev , unsigned
int len , gfp_t gfp_mask );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the network device to receive on. πŸ’–
  • len β€” the length to allocate. ✨
  • gfp_mask β€” the get_free_pages mask, passed to alloc_skb. 🧚

πŸ’… DESCRIPTION πŸ’…

Okay so __netdev_alloc_skb allocates a new sk_buff and gives it a usage count of one. Iconic. The buffer comes with NET_SKB_PAD headroom built in, so when you’re allocating the headroom you think you need, do not account for that built-in space. The built-in space is there for optimisations. No cap. πŸ”₯

NULL is returned if there is no free memory. 😭

πŸ”₯ SEE ALSO πŸ”₯

The kernel file is ./net/core/skbuff.c, and the whole linked bestie squad is:

mwah πŸ’‹ this page’s source/version corner is ./net/core, dated October 2026 β€” periodt. πŸŽ€

πŸ“¦ where this page comes from