hash: fix build error due to missing include
PATCH 1/1 hash: fix build error due to missing include
The file "rte_thash.c" uses the rte_cpu_get_flag_enabled() API but does not include "rte_cpuflags.h". Add the include to fix build issues this causes:
../lib/hash/rte_thash.c: In function ‘rte_thash_gfni_supported’:../lib/hash/rte_thash.c:79:13: error: implicit declaration of function ‘rte_cpu_get_flag_enabled’ [-Wimplicit-function-declaration]
79 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_GFNI) &&
| ^~~~~~~~~~~~~~~~~~~~~~~~
--- lib/hash/rte_thash.c | 1 + 1 file changed, 1 insertion(+)
lib/hash/rte_thash.c +1 -0
@@ -14,6 +14,7 @@#include <rte_eal_memconfig.h> #include <rte_log.h> #include <rte_malloc.h> +#include <rte_cpuflags.h> RTE_LOG_REGISTER_SUFFIX (thash_logtype, thash,INFO );#define RTE_LOGTYPE_HASH thash_logtype
Signature · 1 line
2.48.1
24/09/2025 17:48, Bruce Richardson:
Quoted 8 lines
The file "
rte_thash.c" uses therte_cpu_get_flag_enabled()API but does not include "rte_cpuflags.h". Add the include to fix build issues this causes:
../lib/hash/rte_thash.c: In function ‘rte_thash_gfni_supported’:../lib/hash/rte_thash.c:79:13: error: implicit declaration of function ‘rte_cpu_get_flag_enabled’ [-Wimplicit-function-declaration]
79 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_GFNI)&&
Quoted 5 lines
| ^~~~~~~~~~~~~~~~~~~~~~~~Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")Signed-off-by Bruce Richardson <[email protected]>
How is that possible that I don't see this error in my compilations?
Quoted 11 lines · Thomas Monjalon
24/09/2025 17:48, Bruce Richardson:
Quoted 10 lines
The file "
rte_thash.c" uses therte_cpu_get_flag_enabled()API but does not include "rte_cpuflags.h". Add the include to fix build issues this causes:
../lib/hash/rte_thash.c: In function ‘rte_thash_gfni_supported’:../lib/hash/rte_thash.c:79:13: error: implicit declaration of function ‘rte_cpu_get_flag_enabled’ [-Wimplicit-function-declaration]
79 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_GFNI)&&| ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Quoted 3 lines
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")Signed-off-by Bruce Richardson <[email protected]>How is that possible that I don't see this error in my compilations?
Seems this code is only included when building with GFNI instructions enabled. :-(
/Bruce
Thomas Monjalon
Applied24/09/2025 18:05, Thomas Monjalon:
Quoted 11 lines
24/09/2025 17:48, Bruce Richardson:
Quoted 10 lines
The file "
rte_thash.c" uses therte_cpu_get_flag_enabled()API but does not include "rte_cpuflags.h". Add the include to fix build issues this causes:
../lib/hash/rte_thash.c: In function ‘rte_thash_gfni_supported’:../lib/hash/rte_thash.c:79:13: error: implicit declaration of function ‘rte_cpu_get_flag_enabled’ [-Wimplicit-function-declaration]
79 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_GFNI)&&| ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
Quoted 3 lines
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")Signed-off-by Bruce Richardson <[email protected]>How is that possible that I don't see this error in my compilations?
That's because we see it only on CPU having GFNI.
Applied, thanks.