rte_cycles.h(3)
π rte_cycles.h β bestie edition π
okay so this is a page from the Library Functions Manual, and it's all about rte_cycles.h β DPDK's cute little time-reference toolkit β¨ (cycles and HPET, if you're fancy). Clock stuff. Delay stuff. The lore is real.
πΈ NAME πΈ
rte_cycles.h β the header that handles your cycles and your delays, no cap π
β¨ SYNOPSIS β¨
first, the includes, because you gotta bring the right friends to the function party:
#include <stdint.h>
#include <rte_debug.h>
#include <rte_atomic.h>
π Functions
uint64_t rte_get_tsc_hz (void)
static uint64_t rte_get_tsc_cycles (void)
static uint64_t rte_get_timer_cycles (void)
static uint64_t rte_get_timer_hz (void)
static void rte_delay_ms (unsigned ms)
void rte_delay_us_block (unsigned int us)
void rte_delay_us_sleep (unsigned int us)
void rte_delay_us_callback_register (void(*userfunc)(unsigned int))
π¦ Variables
void(* rte_delay_us )(unsigned int us)
π Detailed Description π
Simple Time Reference Functions (Cycles and HPET). she's simple, she's powerful, she's literally holding your whole sense of time together π«Ά
Definition in file rte_cycles.h.
π₯ Function Documentation π₯
uint64_t rte_get_tsc_hz (void )
Get the measured frequency of the RDTSC counter. like, how fast is this counter actually ticking, measured and everything π
Returns
- The TSC frequency for this lcore
uint64_t rte_get_tsc_cycles (void ) [inline], [static]
Return the number of TSC cycles since boot. how many ticks have happened since the machine woke up, bestie β°
Returns
- the number of cycles
uint64_t rte_get_timer_cycles (void ) [inline], [static]
Get the number of cycles since boot from the default timer. same vibe, but the default timer this time, okay? π
Returns
- The number of cycles
Definition at line 97 of file rte_cycles.h.
uint64_t rte_get_timer_hz (void ) [inline], [static]
Get the number of cycles in one second for the default timer. one whole second of cycles, that's it, that's the whole function π
Returns
- The number of cycles in one second.
Definition at line 119 of file rte_cycles.h.
void rte_delay_ms (unsigned ms) [inline], [static]
Wait at least ms milliseconds. at least β meaning it might take longer, so don't come for her about precision, she said what she said π
Parameters
msβ The number of milliseconds to wait.
Definition at line 151 of file rte_cycles.h.
void rte_delay_us_block (unsigned int us)
Blocking delay function. she will sit there and BLOCK. full commitment, no multitasking, main character energy π§βοΈ
Parameters
usβ Number of microseconds to wait.
void rte_delay_us_sleep (unsigned int us)
Delay function that uses system sleep. Does not block the CPU core. so polite of her actually, she lets the core go do its own thing while she naps π΄
Parameters
usβ Number of microseconds to wait.
void rte_delay_us_callback_register (void(* userfunc )(unsigned int))
Replace rte_delay_us with user defined function. yes bestie, you get to swap in your own delay function, it's giving customizable π
Parameters
userfuncβ User function which replacesrte_delay_us.rte_delay_us_blockrestores builtin block delay function.
π Variable Documentation π
void(* rte_delay_us) (unsigned int us) (unsigned int us) [extern]
Wait at least us microseconds. This function can be replaced with user-defined function. lowkey the plug of this whole header π
See also
rte_delay_us_callback_register
Parameters
usβ The number of microseconds to wait.
π Author π
Generated automatically by Doxygen for DPDK from the source code. (not a human, not a vibe curator, just Doxygen doing its thing π)
okay and that's the whole page, mwah π this one's from DPDK, Version 25.11.3, and it's the rte_cycles.h(3) page β go forth and measure your cycles, bestie βπΈπ
π¦ 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