From: Chengwen Feng Date: Thu, 15 Apr 2021 03:52:02 +0000 (+0800) Subject: net/hns3: check max SIMD bitwidth X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=86644b3fb39f38ecae82772701e311301f217ce4 net/hns3: check max SIMD bitwidth This patch supports check max SIMD bitwidth when choosing NEON and SVE vector path. Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index b8d8d15c27..3881a72903 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -13,6 +13,7 @@ #include #if defined(RTE_ARCH_ARM64) #include +#include #endif #include "hns3_ethdev.h" @@ -2790,6 +2791,8 @@ static bool hns3_get_default_vec_support(void) { #if defined(RTE_ARCH_ARM64) + if (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_128) + return false; if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON)) return true; #endif @@ -2800,6 +2803,8 @@ static bool hns3_get_sve_support(void) { #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_SVE) + if (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_256) + return false; if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SVE)) return true; #endif