A FIB created with RTE_FIB_F_LOOKUP_NETWORK_ORDER was given the vector
lookup, which reads the addresses in host order. Leave such a FIB to
the scalar functions.
Fixes: f2ccf5fc334b ("fib: lookup with RISC-V vector extension")
Cc: [email protected]
Signed-off-by: Sun Yuechi <[email protected]>
---
lib/fib/dir24_8.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index 489d2ef427..c135285a65 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -94,8 +94,8 @@ get_vector_fn(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr)
return NULL;
}
#elif defined(RTE_RISCV_FEATURE_V)
- RTE_SET_USED(be_addr);
- if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_RISCV_ISA_V) <= 0)
+ /* the vector functions take addresses in host order only */
+ if (be_addr || rte_cpu_get_flag_enabled(RTE_CPUFLAG_RISCV_ISA_V) <= 0)
return NULL;
switch (nh_sz) {
case RTE_FIB_DIR24_8_1B:
--
2.56.0