return NULL;
return rte_cpu_feature_table[feature].name;
}
+
+void
+rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics)
+{
+ memset(intrinsics, 0, sizeof(*intrinsics));
+}
#include "rte_common.h"
#include <errno.h>
+#include <rte_compat.h>
+
+/**
+ * Structure used to describe platform-specific intrinsics that may or may not
+ * be supported at runtime.
+ */
+struct rte_cpu_intrinsics {
+ uint32_t power_monitor : 1;
+ /**< indicates support for rte_power_monitor function */
+ uint32_t power_pause : 1;
+ /**< indicates support for rte_power_pause function */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Check CPU support for various intrinsics at runtime.
+ *
+ * @param intrinsics
+ * Pointer to a structure to be filled.
+ */
+__rte_experimental
+void
+rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics);
+
/**
* Enumeration of all CPU features supported
*/
* checked against the expected value, and if they match, the entering of
* optimized power state may be aborted.
*
+ * @warning It is responsibility of the user to check if this function is
+ * supported at runtime using `rte_cpu_get_features()` API call.
+ * Failing to do so may result in an illegal CPU instruction error.
+ *
* @param p
* Address to monitor for changes.
* @param expected_value
* This call will also lock a spinlock on entering sleep, and release it on
* waking up the CPU.
*
+ * @warning It is responsibility of the user to check if this function is
+ * supported at runtime using `rte_cpu_get_features()` API call.
+ * Failing to do so may result in an illegal CPU instruction error.
+ *
* @param p
* Address to monitor for changes.
* @param expected_value
* Enter an architecture-defined optimized power state until a certain TSC
* timestamp is reached.
*
+ * @warning It is responsibility of the user to check if this function is
+ * supported at runtime using `rte_cpu_get_features()` API call.
+ * Failing to do so may result in an illegal CPU instruction error.
+ *
* @param tsc_timestamp
* Maximum TSC timestamp to wait for. Note that the wait behavior is
* architecture-dependent.
#include <elf.h>
#include <fcntl.h>
#include <assert.h>
+#include <string.h>
#include <unistd.h>
/* Symbolic values for the entries in the auxiliary table */
return NULL;
return rte_cpu_feature_table[feature].name;
}
+
+void
+rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics)
+{
+ memset(intrinsics, 0, sizeof(*intrinsics));
+}
# added in 20.11
__rte_eal_trace_generic_size_t;
+ rte_cpu_get_intrinsics_support;
rte_epoll_wait_interruptible;
rte_service_lcore_may_be_active;
rte_vect_get_max_simd_bitwidth;
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
+#include <string.h>
#include "rte_cpuid.h"
return NULL;
return rte_cpu_feature_table[feature].name;
}
+
+void
+rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics)
+{
+ memset(intrinsics, 0, sizeof(*intrinsics));
+
+ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_WAITPKG)) {
+ intrinsics->power_monitor = 1;
+ intrinsics->power_pause = 1;
+ }
+}