On 1/14/2021 6:39 AM, Leyi Rong wrote:
As eal parameter --force-max-simd-bitwidth is already introduced,
to make it more clear when setting rx/tx function, remove
devarg use-latest-supported-vec support.
Signed-off-by: Leyi Rong <leyi.r...@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo...@intel.com>
<...>
-static eth_rx_burst_t
-i40e_get_recommend_rx_vec(bool scatter)
+static inline bool
+get_avx_supported(bool request_avx512)
{
-#if defined(RTE_ARCH_X86) && defined(CC_AVX2_SUPPORT)
- /*
- * since AVX frequency can be different to base frequency, limit
- * use of AVX2 version to later plaforms, not all those that could
- * theoretically run it.
- */
- if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) &&
- rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
- return scatter ? i40e_recv_scattered_pkts_vec_avx2 :
- i40e_recv_pkts_vec_avx2;
+#ifdef RTE_ARCH_X86
+ if (request_avx512) {
+ if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
+ rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+ rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
+#ifdef CC_AVX512_SUPPORT
+ return true;
+#else
+ PMD_DRV_LOG(NOTICE,
+ "AVX512 is not supported in build env");
+ return false;
+#endif
+ } else {
+ if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256 &&
+ rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 &&
+ rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
+#ifdef CC_AVX2_SUPPORT
+ return true;
+#else
+ PMD_DRV_LOG(NOTICE,
+ "AVX2 is not supported in build env");
+ return false;
#endif
- return scatter ? i40e_recv_scattered_pkts_vec :
- i40e_recv_pkts_vec;
+ }
+#endif /* RTE_ARCH_X86 */
+
+ return false;
}
This was still causing build error for non x86, becuase of not used
'request_avx512' variable, updated as below in next-net:
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index a4661cdd8377..ce2b0bc12ed9 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3122,6 +3122,8 @@ get_avx_supported(bool request_avx512)
return false;
#endif
}
+#else
+ RTE_SET_USED(request_avx512);
#endif /* RTE_ARCH_X86 */
return false;