rte_mbuf_history.h(3)

πŸ“¦
version 25.11.3 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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