---
name: "__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/__alloc_skb"
---

# \_\_alloc\_skb(9)

allocate a network buffer

## NAME

\_\_alloc\_skb - allocate a network buffer

## SYNOPSIS

**struct sk\_buff \* \_\_alloc\_skb(unsigned int** *size***, gfp\_t** *gfp\_mask***, int** *flags***, int** *node***);**

## ARGUMENTS

*size*

size to allocate

*gfp\_mask*

allocation mask

*flags*

If SKB\_ALLOC\_FCLONE is set, allocate from fclone cache instead of head cache and allocate a cloned (child) skb. If SKB\_ALLOC\_RX is set, \_\_GFP\_MEMALLOC will be used for allocations in case the data is required for writeback

*node*

numa node to allocate memory on

## DESCRIPTION

Allocate a new sk\_buff. The returned buffer has no headroom and a tail room of at least size bytes. The object has a reference count of one. The return is the buffer. On a failure the return is **NULL**.

Buffers may only be allocated from interrupts using a *gfp\_mask* of **GFP\_ATOMIC**.

## COPYRIGHT
