[1/7] net/hns3: check max SIMD bitwidth

Message ID 1618653299-40380-2-git-send-email-humin29@huawei.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series features and bugfix for hns3 PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

humin (Q) April 17, 2021, 9:54 a.m. UTC
  From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports check max SIMD bitwidth when choosing NEON and SVE
vector path.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Ferruh Yigit April 20, 2021, 12:16 a.m. UTC | #1
On 4/17/2021 10:54 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> This patch supports check max SIMD bitwidth when choosing NEON and SVE
> vector path.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

This patch already part of another patchset [1] and merged there.

[1] https://patches.dpdk.org/project/dpdk/list/?series=16388&state=*
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 9bb30fc..f2022a5 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -13,6 +13,7 @@ 
 #include <rte_malloc.h>
 #if defined(RTE_ARCH_ARM64)
 #include <rte_cpuflags.h>
+#include <rte_vect.h>
 #endif
 
 #include "hns3_ethdev.h"
@@ -2800,6 +2801,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
@@ -2810,6 +2813,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