---
name: "rte_mbuf"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_mbuf"
---

# rte\_mbuf(3)

## NAME

rte\_mbuf

## SYNOPSIS

`#include <rte_mbuf_core.h>`

### Data Fields

**void** \* **buf\_addr**\
 struct **rte\_mbuf** \* **next**\
 **uint64\_t** **ol\_flags**\
 **struct** **rte\_mempool** \* **pool**\
 **uint64\_t** **dynfield2**\
 **struct** **rte\_mbuf\_ext\_shared\_info** \* **shinfo**\
 **uint16\_t** **priv\_size**\
 **uint16\_t** **timesync**\
 **uint32\_t** **dynfield1** \[9\]\

## Detailed Description

The generic **rte\_mbuf**, containing a packet mbuf.

Definition at line **467** of file **rte\_mbuf\_core.h**.

## Field Documentation

### void\* buf\_addr

Virtual address of segment buffer.

Definition at line **468** of file **rte\_mbuf\_core.h**.

### struct rte\_mbuf\* next

Next segment of scattered packet. This field is valid when physical address field is undefined. Otherwise next pointer in the second cache line will be used.

Definition at line **485** of file **rte\_mbuf\_core.h**.

### uint16\_t refcnt

Reference counter. Its size should at least equal to the size of port field (16 bits), to support zero-copy broadcast. It should only be accessed using the following functions: **rte\_mbuf\_refcnt\_update()**, **rte\_mbuf\_refcnt\_read()**, and **rte\_mbuf\_refcnt\_set()**. The functionality of these functions (atomic, or non-atomic) is controlled by the RTE\_MBUF\_REFCNT\_ATOMIC flag.

Definition at line **503** of file **rte\_mbuf\_core.h**.

### uint16\_t nb\_segs

Number of segments. Only valid for the first segment of an mbuf chain.

Definition at line **509** of file **rte\_mbuf\_core.h**.

### uint16\_t port

Input port (16 bits to support more than 256 virtual ports). The event eth Tx adapter uses this field to specify the output port.

Definition at line **514** of file **rte\_mbuf\_core.h**.

### uint64\_t ol\_flags

Offload features.

Definition at line **518** of file **rte\_mbuf\_core.h**.

### uint32\_t packet\_type

L2/L3/L4 and tunnel information.

Definition at line **534** of file **rte\_mbuf\_core.h**.

### uint8\_t l2\_type

(Outer) L2 type.

Definition at line **537** of file **rte\_mbuf\_core.h**.

### uint8\_t l3\_type

(Outer) L3 type.

Definition at line **538** of file **rte\_mbuf\_core.h**.

### uint8\_t l4\_type

(Outer) L4 type.

Definition at line **539** of file **rte\_mbuf\_core.h**.

### uint8\_t tun\_type

Tunnel type.

Definition at line **540** of file **rte\_mbuf\_core.h**.

### uint8\_t inner\_esp\_next\_proto

ESP next protocol type, valid if RTE\_PTYPE\_TUNNEL\_ESP tunnel type is set on both Tx and Rx.

Definition at line **542** of file **rte\_mbuf\_core.h**.

### uint8\_t inner\_l2\_type

Inner L2 type.

Definition at line **549** of file **rte\_mbuf\_core.h**.

### uint8\_t inner\_l3\_type

Inner L3 type.

Definition at line **551** of file **rte\_mbuf\_core.h**.

### uint8\_t inner\_l4\_type

Inner L4 type.

Definition at line **555** of file **rte\_mbuf\_core.h**.

### uint32\_t pkt\_len

Total pkt len: sum of all segments.

Definition at line **559** of file **rte\_mbuf\_core.h**.

### uint16\_t data\_len

Amount of data in segment buffer.

Definition at line **560** of file **rte\_mbuf\_core.h**.

### uint16\_t vlan\_tci

VLAN TCI (CPU order), valid if RTE\_MBUF\_F\_RX\_VLAN is set.

Definition at line **562** of file **rte\_mbuf\_core.h**.

### uint32\_t rss

RSS hash result if RSS enabled

Definition at line **566** of file **rte\_mbuf\_core.h**.

### uint32\_t lo

Second 4 flexible bytes

Definition at line **573** of file **rte\_mbuf\_core.h**.

### uint32\_t hi

First 4 flexible bytes or FD ID, dependent on RTE\_MBUF\_F\_RX\_FDIR\_\* flag in ol\_flags.

Definition at line **576** of file **rte\_mbuf\_core.h**.

### struct { ... } fdir

Filter identifier if FDIR enabled

### struct rte\_mbuf\_sched sched

Hierarchical scheduler : 8 bytes

Definition at line **581** of file **rte\_mbuf\_core.h**.

### uint16\_t txq

The event eth Tx adapter uses this field to store Tx queue id.

**See also**

**rte\_event\_eth\_tx\_adapter\_txq\_set()**

Definition at line **586** of file **rte\_mbuf\_core.h**.

### struct { ... } txadapter

Eventdev ethdev Tx adapter

### uint32\_t usr

User defined tags. See **rte\_distributor\_process()**

Definition at line **592** of file **rte\_mbuf\_core.h**.

### union { ... } hash

hash information

### uint16\_t vlan\_tci\_outer

Outer VLAN TCI (CPU order), valid if RTE\_MBUF\_F\_RX\_QINQ is set.

Definition at line **598** of file **rte\_mbuf\_core.h**.

### uint16\_t buf\_len

Length of segment buffer.

Definition at line **600** of file **rte\_mbuf\_core.h**.

### struct rte\_mempool\* pool

Pool from which mbuf was allocated.

Definition at line **604** of file **rte\_mbuf\_core.h**.

### uint64\_t dynfield2

Reserved for dynamic fields when the next pointer is in first cache line (i.e. RTE\_IOVA\_IN\_MBUF is 0).

Definition at line **620** of file **rte\_mbuf\_core.h**.

### uint64\_t tx\_offload

combined for easy fetch

Definition at line **625** of file **rte\_mbuf\_core.h**.

### uint64\_t l2\_len

L2 (MAC) Header Length for non-tunneling pkt. Outer\_L4\_len + ... + Inner\_L2\_len for tunneling pkt.

Definition at line **628** of file **rte\_mbuf\_core.h**.

### uint64\_t l3\_len

L3 (IP) Header Length.

Definition at line **632** of file **rte\_mbuf\_core.h**.

### uint64\_t l4\_len

L4 (TCP/UDP) Header Length.

Definition at line **634** of file **rte\_mbuf\_core.h**.

### uint64\_t tso\_segsz

TCP TSO segment size

Definition at line **636** of file **rte\_mbuf\_core.h**.

### uint64\_t outer\_l3\_len

Outer L3 (IP) Hdr Length.

Definition at line **651** of file **rte\_mbuf\_core.h**.

### uint64\_t outer\_l2\_len

Outer L2 (MAC) Hdr Length.

Definition at line **653** of file **rte\_mbuf\_core.h**.

### struct rte\_mbuf\_ext\_shared\_info\* shinfo

Shared data for external buffer attached to mbuf. See **rte\_pktmbuf\_attach\_extbuf()**.

Definition at line **663** of file **rte\_mbuf\_core.h**.

### uint16\_t priv\_size

Size of the application private data. In case of an indirect mbuf, it stores the direct mbuf private data size.

Definition at line **668** of file **rte\_mbuf\_core.h**.

### uint16\_t timesync

Timesync flags for use with IEEE1588.

Definition at line **671** of file **rte\_mbuf\_core.h**.

### uint32\_t dynfield1\[9\]

Reserved for dynamic fields.

Definition at line **673** of file **rte\_mbuf\_core.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
