---
name: "__napi_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/__napi_alloc_skb"
---

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

allocate skbuff for rx in a specific NAPI instance

## NAME

\_\_napi\_alloc\_skb - allocate skbuff for rx in a specific NAPI instance

## SYNOPSIS

**struct sk\_buff \* \_\_napi\_alloc\_skb(struct napi\_struct \*** *napi***, unsigned int** *len***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*napi*

napi instance this buffer was allocated for

*len*

length to allocate

*gfp\_mask*

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

## DESCRIPTION

Allocate a new sk\_buff for use in NAPI receive. This buffer will attempt to allocate the head from a special reserved region used only for NAPI Rx allocation. By doing this we can save several CPU cycles by avoiding having to disable and re-enable IRQs.

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

## COPYRIGHT
