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_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 ๐Ÿฆ‹

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