Scroll to navigation

rte_mbuf_history.h(3) Library Functions Manual rte_mbuf_history.h(3)

NAME

rte_mbuf_history.h

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.

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.

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

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.

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.

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

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.

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.

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.

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.

Version 25.11.0 DPDK