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 replaces rte_delay_us.
  • rte_delay_us_block restores 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