rte_pause.h(3)

πŸ’– rte_pause.h(3) β€” Library Functions Manual πŸ’–

okay bestie, welcome to the pause page 🫢 it's giving "chill out, CPU, take a lil breath." this is rte_pause.h(3) from the DPDK docs, and we're gonna go through the whole thing together, no skipping, no cap ✨


🌸 NAME 🌸

rte_pause.h β€” that's it, that's the name, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

#include <stdint.h>
#include <assert.h>
#include <rte_common.h>
#include <rte_atomic.h>
#include <rte_stdatomic.h>

πŸ¦‹ Functions

static void rte_pause (void)
static __rte_always_inline void rte_wait_until_equal_16 (volatile
    uint16_t *addr, uint16_t expected, rte_memory_order memorder)
static __rte_always_inline void rte_wait_until_equal_32 (volatile
    uint32_t *addr, uint32_t expected, rte_memory_order memorder)
static __rte_always_inline void rte_wait_until_equal_64 (volatile
    uint64_t *addr, uint64_t expected, rte_memory_order memorder)

four little functions, all of them static, three of them __rte_always_inline β€” the whole girl group is here πŸ’…


πŸ’œ Detailed Description πŸ’œ

CPU pause operation.

like, that's the entire point of the header. it pauses. it waits. it chills 🌈

Definition in file rte_pause.h.


πŸŽ€ Function Documentation πŸŽ€

⭐ void rte_pause (void ) [inline], [static]

Pause CPU execution for a short while. 😴

This call is intended for tight loops which poll a shared resource or wait for an event. A short pause within the loop may reduce the power consumption. πŸ”‹βœ¨ so like, if you're vibing in a spin loop burning watts for no reason, hit this and let the CPU nap for a sec. main character energy is knowing when NOT to be busy.


⭐ __rte_always_inline void rte_wait_until_equal_16 (volatile uint16_t * addr, uint16_t expected, rte_memory_order memorder) [static]

Wait for *addr to be updated with a 16-bit expected value, with a relaxed memory ordering model meaning the loads around this API can be reordered. πŸ‘€

Parameters

  • addr β€” A pointer to the memory location.
  • expected β€” A 16-bit expected value to be in the memory location.
  • memorder β€” Two different memory orders that can be specified: rte_memory_order_acquire and rte_memory_order_relaxed.

Definition at line 84 of file rte_pause.h.


⭐ __rte_always_inline void rte_wait_until_equal_32 (volatile uint32_t * addr, uint32_t expected, rte_memory_order memorder) [static]

Wait for *addr to be updated with a 32-bit expected value, with a relaxed memory ordering model meaning the loads around this API can be reordered. πŸ¦‹ same energy, wider girl.

Parameters

  • addr β€” A pointer to the memory location.
  • expected β€” A 32-bit expected value to be in the memory location.
  • memorder β€” Two different memory orders that can be specified: rte_memory_order_acquire and rte_memory_order_relaxed.

Definition at line 95 of file rte_pause.h.


⭐ __rte_always_inline void rte_wait_until_equal_64 (volatile uint64_t * addr, uint64_t expected, rte_memory_order memorder) [static]

Wait for *addr to be updated with a 64-bit expected value, with a relaxed memory ordering model meaning the loads around this API can be reordered. πŸ‘‘

Parameters

  • addr β€” A pointer to the memory location.
  • expected β€” A 64-bit expected value to be in the memory location.
  • memorder β€” Two different memory orders that can be specified: rte_memory_order_acquire and rte_memory_order_relaxed.

Definition at line 106 of file rte_pause.h.

🫢 friendly reminder bestie: rte_memory_order_relaxed and rte_memory_order_acquire are the only two memorders you can pass here. don't get creative, the docs said what the docs said fr fr.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for DPDK from the source code. not a human, just a very dedicated little documentation robot doing its thing πŸ€–πŸ’–


aaaaand that's the whole page, you ate it, you read all of it, I'm so proud πŸ₯Ήβœ¨

this was DPDK, Version 25.11.3, and the page is rte_pause.h(3) β€” mwah, bye bestie, go pause responsibly πŸ’…πŸŒΈ

πŸ“¦ where this page comes from