Skip to contentSkip to conversation

hash: fix build error due to missing include

PATCH Applied Bruce Richardson 2 participants 4 messages Sep 24, 2025

lore
Share & tools
lore
#0 lore raw

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) &&

         |             ^~~~~~~~~~~~~~~~~~~~~~~~
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")
---
 lib/hash/rte_thash.c | 1 +
 1 file changed, 1 insertion(+)
lib/hash/rte_thash.c +1 -0
index 0f9ed20d0d..fcd41248b9 100644
@@ -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
#1 lore raw

24/09/2025 17:48, Bruce Richardson:

Quoted 8 lines

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) &&

Quoted 5 lines
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")

How is that possible that I don't see this error in my compilations?

#2 lore raw
Quoted 11 lines · Thomas Monjalon

24/09/2025 17:48, Bruce Richardson:

Quoted 10 lines

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) &&

         |             ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Quoted 3 lines
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")

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

#3 lore raw
In reply to Thomas Monjalon

24/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 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) &&

         |             ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
Quoted 3 lines
Fixes d8f0f514428e ("eal/x86: remove useless include from spinlock header")

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.