MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_cpu_is_supported

Function rte_cpu_is_supported

dpdk/lib/eal/common/eal_common_cpuflags.c:10–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <rte_cpuflags.h>
9
10int
11rte_cpu_is_supported(void)
12{
13 /* This is generated at compile-time by the build system */
14 static const enum rte_cpu_flag_t compile_time_flags[] = {
15 RTE_COMPILE_TIME_CPUFLAGS
16 };
17 unsigned count = RTE_DIM(compile_time_flags), i;
18 int ret;
19
20 for (i = 0; i < count; i++) {
21 ret = rte_cpu_get_flag_enabled(compile_time_flags[i]);
22
23 if (ret < 0) {
24 fprintf(stderr,
25 "ERROR: CPU feature flag lookup failed with error %d\n",
26 ret);
27 return 0;
28 }
29 if (!ret) {
30 fprintf(stderr,
31 "ERROR: This system does not support \"%s\".\n"
32 "Please check that RTE_MACHINE is set correctly.\n",
33 rte_cpu_get_flag_name(compile_time_flags[i]));
34 return 0;
35 }
36 }
37
38 return 1;
39}

Callers 2

rte_eal_initFunction · 0.85
rte_eal_initFunction · 0.85

Calls 2

rte_cpu_get_flag_enabledFunction · 0.50
rte_cpu_get_flag_nameFunction · 0.50

Tested by

no test coverage detected