rte_mbuf(3)
๐ rte_mbuf ๐
okay so bestie, welcome to the rte_mbuf(3) page โ that's section 3, Library Functions Manual, DPDK edition. This whole page is about the generic rte_mbuf, aka the packet mbuf, aka the lil container every packet in DPDK rides around in. Grab a boba, we're reading a struct together. ๐
โจ NAME โจ
rte_mbuf โ that's the name, that's the whole name. Short, iconic, no notes. ๐
๐ SYNOPSIS ๐
#include <rte_mbuf_core.h>
๐ธ Data Fields ๐ธ
listing these in exactly the order I was given them, no cap:
void * buf_addrstruct rte_mbuf * nextuint64_t ol_flagsstruct rte_mempool * pooluint64_t dynfield2struct rte_mbuf_ext_shared_info * shinfouint16_t priv_sizeuint16_t timesyncuint32_t dynfield1 [9]
๐ฆ Detailed Description ๐ฆ
okay so here's the tea: this is the the generic rte_mbuf, containing a packet mbuf. That's literally what it is โ the generic mbuf that holds a packet. It's defined at line 475 of the file rte_mbuf_core.h. ๐ซถ
๐ Field Documentation ๐
๐ void* buf_addr
Virtual address of the segment buffer. โจ
Definition at line 476 of file rte_mbuf_core.h.
๐ struct rte_mbuf* next
Next segment of a scattered packet. This field is valid when the physical address field is undefined. Otherwise, the next pointer in the second cache line gets used instead. ๐ซ
Definition at line 493 of file rte_mbuf_core.h.
๐ uint16_t refcnt
Reference counter. Its size should at least equal the size of the port field (16 bits), so zero-copy broadcast can work. And lowkey important: it should only be accessed using rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and rte_mbuf_refcnt_set(). Whether those functions are atomic or non-atomic is controlled by the RTE_MBUF_REFCNT_ATOMIC flag. ๐ฅ
Definition at line 514 of file rte_mbuf_core.h.
๐ uint16_t nb_segs
Number of segments. Only valid for the first segment of an mbuf chain, bestie โ first only, don't be out here reading it off segment three. ๐
Definition at line 520 of file rte_mbuf_core.h.
๐ uint16_t port
Input port (16 bits, so more than 256 virtual ports can exist). The event eth Tx adapter uses this field to specify the output port. ๐
Definition at line 525 of file rte_mbuf_core.h.
๐ uint64_t ol_flags
Offload features. โจ
Definition at line 529 of file rte_mbuf_core.h.
๐ uint32_t packet_type
L2/L3/L4 and tunnel information. ๐
Definition at line 545 of file rte_mbuf_core.h.
๐ uint8_t l2_type
(Outer) L2 type.
Definition at line 548 of file rte_mbuf_core.h.
๐ uint8_t l3_type
(Outer) L3 type.
Definition at line 549 of file rte_mbuf_core.h.
๐ uint8_t l4_type
(Outer) L4 type.
Definition at line 550 of file rte_mbuf_core.h.
๐ uint8_t tun_type
Tunnel type. ๐ณ๏ธโจ
Definition at line 551 of file rte_mbuf_core.h.
๐ uint8_t inner_esp_next_proto
ESP next protocol type, valid if the RTE_PTYPE_TUNNEL_ESP tunnel type is set on both Tx and Rx.
Definition at line 553 of file rte_mbuf_core.h.
๐ uint8_t inner_l2_type
Inner L2 type.
Definition at line 560 of file rte_mbuf_core.h.
๐ uint8_t inner_l3_type
Inner L3 type.
Definition at line 562 of file rte_mbuf_core.h.
๐ uint8_t inner_l4_type
Inner L4 type.
Definition at line 566 of file rte_mbuf_core.h.
๐ uint32_t pkt_len
Total pkt len: the sum of all segments. ๐งฎ
Definition at line 570 of file rte_mbuf_core.h.
๐ uint16_t data_len
Amount of data in the segment buffer.
Definition at line 571 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 573 of file rte_mbuf_core.h.
๐ uint32_t rss
RSS hash result, if RSS is enabled.
Definition at line 577 of file rte_mbuf_core.h.
๐ uint32_t lo
Second 4 flexible bytes.
Definition at line 584 of file rte_mbuf_core.h.
๐ uint32_t hi
First 4 flexible bytes or FD ID, dependent on the RTE_MBUF_F_RX_FDIR_* flag in ol_flags. ๐
Definition at line 587 of file rte_mbuf_core.h.
๐ struct { ... } fdir
Filter identifier, if FDIR is enabled.
๐ struct rte_mbuf_sched sched
Hierarchical scheduler : 8 bytes.
Definition at line 592 of file rte_mbuf_core.h.
๐ uint16_t txq
The event eth Tx adapter uses this field to store the Tx queue id.
See also: rte_event_eth_tx_adapter_txq_set()
Definition at line 597 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 603 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 609 of file rte_mbuf_core.h.
๐ uint16_t buf_len
Length of the segment buffer.
Definition at line 611 of file rte_mbuf_core.h.
๐ struct rte_mempool* pool
Pool from which the mbuf was allocated. ๐
Definition at line 615 of file rte_mbuf_core.h.
๐ uint64_t dynfield2
Reserved for dynamic fields when the next pointer is in the first cache line (i.e. RTE_IOVA_IN_MBUF is 0). โจ
Definition at line 635 of file rte_mbuf_core.h.
๐ uint64_t tx_offload
combined for easy fetch.
Definition at line 640 of file rte_mbuf_core.h.
๐ uint64_t l2_len
L2 (MAC) Header Length for a non-tunneling pkt. For a tunneling pkt: Outer_L4_len + ... + Inner_L2_len. ๐งต
Definition at line 643 of file rte_mbuf_core.h.
๐ uint64_t l3_len
L3 (IP) Header Length.
Definition at line 647 of file rte_mbuf_core.h.
๐ uint64_t l4_len
L4 (TCP/UDP) Header Length.
Definition at line 649 of file rte_mbuf_core.h.
๐ uint64_t tso_segsz
TCP TSO segment size.
Definition at line 651 of file rte_mbuf_core.h.
๐ uint64_t outer_l3_len
Outer L3 (IP) Hdr Length.
Definition at line 666 of file rte_mbuf_core.h.
๐ uint64_t outer_l2_len
Outer L2 (MAC) Hdr Length.
Definition at line 668 of file rte_mbuf_core.h.
๐ struct rte_mbuf_ext_shared_info* shinfo
Shared data for an external buffer attached to the mbuf. See rte_pktmbuf_attach_extbuf(). ๐
Definition at line 678 of file rte_mbuf_core.h.
๐ uint16_t priv_size
Size of the application private data. In the case of an indirect mbuf, it stores the direct mbuf's private data size. ๐งบ
Definition at line 683 of file rte_mbuf_core.h.
๐ uint16_t timesync
Timesync flags, for use with IEEE1588. โฐ
Definition at line 686 of file rte_mbuf_core.h.
๐ uint32_t dynfield1[9]
Reserved for dynamic fields.
Definition at line 688 of file rte_mbuf_core.h.
๐ซถ Author ๐ซถ
Generated automatically by Doxygen for DPDK from the source code. (Not a human, not a girlie, just Doxygen doing its lil thing. ๐)
and that's the whole page bestie!! this was DPDK, Version 25.11.3 โ that's the footer energy right there, no date on this one, just the version. mwah ๐ go forth and mbuf responsibly ๐โจ
๐ฆ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 ยท BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms