---
name: "__netdev_alloc_skb"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/__netdev_alloc_skb"
---

# \_\_netdev\_alloc\_skb(9)

allocate an skbuff for rx on a specific device

## 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*

network device to receive on

*len*

length to allocate

*gfp\_mask*

get\_free\_pages mask, passed to alloc\_skb

## DESCRIPTION

Allocate a new sk\_buff and assign it a usage count of one. The buffer has NET\_SKB\_PAD headroom built in. Users should allocate the headroom they think they need without accounting for the built in space. The built in space is used for optimisations.

**NULL** is returned if there is no free memory.

## COPYRIGHT
