rte_cpuflags.h(3)

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

okay bestie, sit down, hydrate, because we're reading the manual page for rte_cpuflags.h and it's genuinely so useful. it's a C header, it lives in the DPDK-verse, and its whole personality is "let me tell you what your CPU can actually do at runtime." let's get into it 🫢


✨ NAME ✨

rte_cpuflags.h β€” the header itself, icon, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include 'rte_common.h'
#include <errno.h>
#include <rte_compat.h>

πŸŽ€ Data Structures

  • struct rte_cpu_intrinsics

πŸ¦‹ Functions

void rte_cpu_get_intrinsics_support (struct rte_cpu_intrinsics *intrinsics)
__extension__ const char * rte_cpu_get_flag_name (enum rte_cpu_flag_t feature)
__extension__ int rte_cpu_get_flag_enabled (enum rte_cpu_flag_t feature)
int rte_cpu_is_supported (void)
unsigned long rte_cpu_getauxval (unsigned long type)
int rte_cpu_strcmp_auxval (unsigned long type, const char *str)

πŸ’œ Detailed Description πŸ’œ

Architecture specific API to determine available CPU features at runtime. that's the whole vibe. your binary got compiled assuming certain CPU goodies exist, and this page is how you check what's actually there on the machine you're running on. no cap.

Definition in file rte_cpuflags.h.


πŸ‘‘ Function Documentation πŸ‘‘

πŸ’– void rte_cpu_get_intrinsics_support (struct rte_cpu_intrinsics * intrinsics)

Check CPU support for various intrinsics at runtime. like a vibe check, but for CPU instructions ✨

Parameters

  • intrinsics β€” Pointer to a structure to be filled.

πŸ’… __extension__ const char * rte_cpu_get_flag_name (enum rte_cpu_flag_t feature)

Get name of CPU flag. she's giving name-tag energy 🏷️

Parameters

  • feature β€” CPU flag ID

Returns

  • flag name
  • NULL if flag ID is invalid

πŸ”₯ __extension__ int rte_cpu_get_flag_enabled (enum rte_cpu_flag_t feature)

Function for checking a CPU flag availability. the "do you have this tho" function, fr fr.

Parameters

  • feature β€” CPU flag to query CPU for

Returns

  • 1 if flag is available
  • 0 if flag is not available
  • -ENOENT if flag is invalid

πŸ¦‹ int rte_cpu_is_supported (void )

This function checks that the currently used CPU supports the CPU features that were specified at compile time. It is called automatically within the EAL, so does not need to be used by applications. This version returns a result so that decisions may be made (for instance, graceful shutdowns). so you literally don't have to call it, but if you want the tea, it'll hand it over 🍡

ngl, the "called automatically within the EAL" part is the key detail. don't go calling it for no reason, bestie.

⭐ unsigned long rte_cpu_getauxval (unsigned long type)

This function attempts to retrieve a value from the auxiliary vector. If it is unsuccessful, the result will be 0, and errno will be set.

Returns

A value from the auxiliary vector. When the value is 0, check errno to determine if an error occurred.

⚠️ important: a 0 result is not automatically a fail, so please, please check errno before you panic πŸ’€

🌈 int rte_cpu_strcmp_auxval (unsigned long type, const char * str)

This function retrieves a value from the auxiliary vector, and compares it as a string against the value retrieved.

Returns

The result of calling strcmp() against the value retrieved from the auxiliary vector. When the value is 0 (meaning a match is found), check errno to determine if an error occurred.

⚠️ same energy as above: 0 means a match was found, but ALSO check errno to know if something went sideways πŸ™ˆ

🧚 Author 🧚

Generated automatically by Doxygen for DPDK from the source code. not a human, not a bestie, just a doc generator doing her thing 😭


and that's the page!! πŸ’– DPDK, Version 25.11.3, rte_cpuflags.h(3) β€” slay, stay safe out there, and always check your errno before you ship πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from