Skip to content

Commit 45ddc56

Browse files
vmedvedkdavid-marchand
authored andcommitted
fib6: add runtime checks in AVX512 lookup
AVX512 lookup function requires CPU to support RTE_CPUFLAG_AVX512DQ and RTE_CPUFLAG_AVX512BW. Add runtime checks of these two flags when deciding if vector function can be used. Fixes: 1e5630e ("fib6: add AVX512 lookup") Cc: [email protected] Signed-off-by: Vladimir Medvedkin <[email protected]> Reviewed-by: David Marchand <[email protected]>
1 parent 8d03152 commit 45ddc56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/fib/trie.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ static inline rte_fib6_lookup_fn_t
4646
get_vector_fn(enum rte_fib_trie_nh_sz nh_sz)
4747
{
4848
#ifdef CC_TRIE_AVX512_SUPPORT
49-
if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0) ||
50-
(rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512))
49+
if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0 ||
50+
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0 ||
51+
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) <= 0 ||
52+
rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)
5153
return NULL;
5254
switch (nh_sz) {
5355
case RTE_FIB6_TRIE_2B:

0 commit comments

Comments
 (0)