Ubuntu Manpages

#include <rte_common.h>
#include <rte_debug.h>
#include <rte_mbuf_dyn.h>


#define RTE_MBUF_HISTORY_BITS 4
#define RTE_MBUF_HISTORY_MAX (sizeof(rte_mbuf_history_t) * 8 / RTE_MBUF_HISTORY_BITS)


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 }


__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)


int rte_mbuf_history_field_offset

Warning

EXPERIMENTAL: this API may change without prior notice.

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.

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.

Number of bits for each history operation.

Definition at line 43 of file rte_mbuf_history.h.

Maximum number of history operations that can be stored.

Definition at line 48 of file rte_mbuf_history.h.

History operation types.

Enumerator

Initial state - never allocated
Freed back to pool
Freed by PMD
Freed by application
Allocation in mbuf library
Allocated by PMD for Rx
Allocated by application
Received
Sent
Being prepared before Tx
Returned due to Tx busy
Enqueued for processing
Dequeued for processing
Application-defined event 2
Application-defined event 1
Maximum number of operation types

Definition at line 53 of file rte_mbuf_history.h.

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.

Note: This function is called by rte_pktmbuf_pool_create, so explicit invocation is usually not required.

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.

Mark multiple mbufs with a history event.

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.

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.

Parameters

f File pointer to write the history to.
m Pointer to the mbuf to dump history for.

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.

Dump mbuf history statistics for all mempools to a file.

Warning

EXPERIMENTAL: this API may change without prior notice.

Parameters

f File pointer to write the history statistics to.

Global offset for the history dynamic field (set during initialization).

Generated automatically by Doxygen for DPDK from the source code.