The GFNI thash implementation depends upon AVX-512 as well as the GFNI instruction set. The instruction set checks at build-time checked for AVX-512F and GFNI, but the actual AVX instructions used come from AVX-512 subsets VBMI, VL and DQ which are not implied by AVX-512F. While this is not a problem in practice, since systems with AVX-512F and GFNI do have all necessary other instruction sets, for correctness, let's make the checks more explicit, checking for sets which are not implied by any others.
Signed-off-by: Bruce Richardson <[email protected]> --- lib/hash/rte_thash_x86_gfni.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hash/rte_thash_x86_gfni.h b/lib/hash/rte_thash_x86_gfni.h index e5abdf2474..1a529d052a 100644 --- a/lib/hash/rte_thash_x86_gfni.h +++ b/lib/hash/rte_thash_x86_gfni.h @@ -19,7 +19,7 @@ extern "C" { #endif -#if defined(__GFNI__) && defined(__AVX512F__) +#if defined(__GFNI__) && defined(__AVX512VBMI__) && defined(__AVX512DQ__) && defined(__AVX512VL__) #define RTE_THASH_GFNI_DEFINED #define RTE_THASH_FIRST_ITER_MSK 0x0f0f0f0f0f0e0c08 @@ -217,7 +217,7 @@ rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], } } -#endif /* __GFNI__ && __AVX512F__ */ +#endif /* GFNI and AVX512 support */ #ifdef __cplusplus } -- 2.55.0

