rte_mbuf_history.h(3)
π rte_mbuf_history.h π
okay bestie, welcome to the rte_mbuf_history.h(3) page, live from the Library Functions Manual πβ¨ this is the DPDK header that keeps receipts on your mbufs β like, every mbuf gets a little diary π
β¨ NAME β¨
rte_mbuf_history.h β the header that tracks the whole life story of your mbufs ππ¦
πΈ SYNOPSIS πΈ
#include <rte_common.h>
#include <rte_debug.h>
#include <rte_mbuf_dyn.h>
π Macros
#define RTE_MBUF_HISTORY_BITS 4
#define RTE_MBUF_HISTORY_MAX (sizeof(rte_mbuf_history_t) * 8 /
RTE_MBUF_HISTORY_BITS)
π Enumerations
enum rte_mbuf_history_op { RTE_MBUF_HISTORY_OP_NEVER = 0,
RTE_MBUF_HISTORY_OP_LIB_FREE = 1, RTE_MBUF_HISTORY_OP_PMD_FREE = 2,
RTE_MBUF_HISTORY_OP_APP_FREE = 3, RTE_MBUF_HISTORY_OP_LIB_ALLOC = 4,
RTE_MBUF_HISTORY_OP_PMD_ALLOC = 5, RTE_MBUF_HISTORY_OP_APP_ALLOC =
6, RTE_MBUF_HISTORY_OP_RX = 7, RTE_MBUF_HISTORY_OP_TX = 8,
RTE_MBUF_HISTORY_OP_TX_PREP = 9, RTE_MBUF_HISTORY_OP_TX_BUSY = 10,
RTE_MBUF_HISTORY_OP_ENQUEUE = 11, RTE_MBUF_HISTORY_OP_DEQUEUE = 12,
RTE_MBUF_HISTORY_OP_USR2 = 14, RTE_MBUF_HISTORY_OP_USR1 = 15,
RTE_MBUF_HISTORY_OP_MAX = 16 }
π Functions
__rte_experimental void rte_mbuf_history_init (void)
static void rte_mbuf_history_mark (struct rte_mbuf *m, enum
rte_mbuf_history_op op)
static void rte_mbuf_history_mark_bulk (struct rte_mbuf *const *mbufs,
unsigned int count, enum rte_mbuf_history_op op)
__rte_experimental void rte_mbuf_history_dump (FILE *f, const struct
rte_mbuf *m)
__rte_experimental void rte_mbuf_history_dump_mempool (FILE *f, struct
rte_mempool *mp)
__rte_experimental void rte_mbuf_history_dump_all (FILE *f)
π Variables
int rte_mbuf_history_field_offset
π¦ Detailed Description π¦
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ (yes it said it, no cap, this thing is still cooking π©βπ³)
These functions allow to track history of mbuf objects using a dynamic field. ππ
It tracks the lifecycle of mbuf objects through the system with a fixed set of predefined events to maintain performance. πββοΈπ¨
The history is stored as an atomic value (64-bit) in a dynamic field of the mbuf, with each event encoded in 4 bits, allowing up to 16 events to be tracked. Atomic operations ensure thread safety for cloned mbufs accessed by multiple lcores. πβ¨ (four bits per event, sixteen events max β it's giving tiny diary, huge drama π)
After dumping the history in a file, the script dpdk-mbuf-history-parser.py can be used for parsing. ππ
Definition in file rte_mbuf_history.h.
π Macro Definition Documentation π
#define RTE_MBUF_HISTORY_BITS 4
Number of bits for each history operation. βοΈ
Definition at line 43 of file rte_mbuf_history.h.
#define RTE_MBUF_HISTORY_MAX (sizeof(rte_mbuf_history_t) * 8 / RTE_MBUF_HISTORY_BITS)
Maximum number of history operations that can be stored. π¦π¦π¦
Definition at line 48 of file rte_mbuf_history.h.
π Enumeration Type Documentation π
enum rte_mbuf_history_op
History operation types. ποΈ
Enumerator
RTE_MBUF_HISTORY_OP_NEVERβ Initial state - never allocated π±RTE_MBUF_HISTORY_OP_LIB_FREEβ Freed back to pool πββοΈRTE_MBUF_HISTORY_OP_PMD_FREEβ Freed by PMD π§ΉRTE_MBUF_HISTORY_OP_APP_FREEβ Freed by application π±RTE_MBUF_HISTORY_OP_LIB_ALLOCβ Allocation in mbuf library πRTE_MBUF_HISTORY_OP_PMD_ALLOCβ Allocated by PMD for Rx π₯RTE_MBUF_HISTORY_OP_APP_ALLOCβ Allocated by application ποΈRTE_MBUF_HISTORY_OP_RXβ Received π¨RTE_MBUF_HISTORY_OP_TXβ Sent πRTE_MBUF_HISTORY_OP_TX_PREPβ Being prepared before Tx π½RTE_MBUF_HISTORY_OP_TX_BUSYβ Returned due to Tx busy π΅βπ«RTE_MBUF_HISTORY_OP_ENQUEUEβ Enqueued for processing β‘οΈRTE_MBUF_HISTORY_OP_DEQUEUEβ Dequeued for processing β¬ οΈRTE_MBUF_HISTORY_OP_USR2β Application-defined event 2 πRTE_MBUF_HISTORY_OP_USR1β Application-defined event 1 πRTE_MBUF_HISTORY_OP_MAXβ Maximum number of operation types π
Definition at line 53 of file rte_mbuf_history.h.
π Function Documentation π
__rte_experimental void rte_mbuf_history_init (void )
Initialize the mbuf history system. π
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ
This function registers the dynamic field for mbuf history tracking. It should be called once during application initialization. 1οΈβ£β¨
Note: This function is called by rte_pktmbuf_pool_create, so explicit invocation is usually not required. π
ββοΈ (she already showed up to the party, bestie)
void rte_mbuf_history_mark (struct rte_mbuf * m, enum rte_mbuf_history_op op) [inline], [static]
Mark an mbuf with a history event. ποΈπ
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ
Parameters
mβ Pointer to the mbuf. πopβ The operation to record. π
Definition at line 105 of file rte_mbuf_history.h.
void rte_mbuf_history_mark_bulk (struct rte_mbuf *const * mbufs, unsigned int count, enum rte_mbuf_history_op op) [inline], [static]
Mark multiple mbufs with a history event. ποΈποΈποΈ (bulk marking, because doing it one by one is so not the move)
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ
Parameters
mbufsβ Array of mbuf pointers. π§Ίcountβ Number of mbufs to mark. π’opβ The operation to record. π
Definition at line 142 of file rte_mbuf_history.h.
__rte_experimental void rte_mbuf_history_dump (FILE * f, const struct rte_mbuf * m)
Dump mbuf history for a single mbuf to a file. ποΈπ€
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ EXPERIMENTAL: this API may change without prior notice. β οΈ (yes bestie it really does say it twice, iconic of it honestly)
Parameters
fβ File pointer to write the history to. πmβ Pointer to the mbuf to dump history for. π
__rte_experimental void rte_mbuf_history_dump_mempool (FILE * f, struct rte_mempool * mp)
Dump mbuf history statistics for a single mempool to a file. ποΈπ
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ
Parameters
fβ File pointer to write the history statistics to. πmpβ Pointer to the mempool to dump history for. ποΈ
__rte_experimental void rte_mbuf_history_dump_all (FILE * f)
Dump mbuf history statistics for all mempools to a file. ποΈπ (every single one, no mbuf left behind π«Ά)
Warning EXPERIMENTAL: this API may change without prior notice. β οΈ
Parameters
fβ File pointer to write the history statistics to. π
π Variable Documentation π
int rte_mbuf_history_field_offset [extern]
Global offset for the history dynamic field (set during initialization). ππ
π Author π
Generated automatically by Doxygen for DPDK from the source code. π€π« (not me writing paragraphs, the robot did it, and honestly? ate)
aaaand that's the whole page bestie, you're officially an mbuf historian ππ¦ go track those lifecycles, no cap π
DPDK Version 25.11.3 β rte_mbuf_history.h(3) β¨ mwah, go slay π
π
π¦ 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