[v3,14/18] distributor: add checks for max SIMD bitwidth

Message ID 20200930130415.11211-15-ciara.power@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series add max SIMD bitwidth to EAL |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Power, Ciara Sept. 30, 2020, 1:04 p.m. UTC
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path.

Cc: David Hunt <david.hunt@intel.com>

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 lib/librte_distributor/rte_distributor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Hunt, David Oct. 6, 2020, 12:17 p.m. UTC | #1
Hi Ciara,

On 30/9/2020 2:04 PM, Ciara Power wrote:
> When choosing a vector path to take, an extra condition must be
> satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
> path.
>
> Cc: David Hunt <david.hunt@intel.com>
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>   lib/librte_distributor/rte_distributor.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
> index 1c047f065a..9f0a9b1d48 100644
> --- a/lib/librte_distributor/rte_distributor.c
> +++ b/lib/librte_distributor/rte_distributor.c
> @@ -636,7 +636,8 @@ rte_distributor_create(const char *name,
>   
>   	d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
>   #if defined(RTE_ARCH_X86)
> -	d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
> +	if (rte_get_max_simd_bitwidth() >= RTE_MAX_128_SIMD)
> +		d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
>   #endif
>   
>   	/*


Acked-by: David Hunt <david.hunt@intel.com>
  

Patch

diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
index 1c047f065a..9f0a9b1d48 100644
--- a/lib/librte_distributor/rte_distributor.c
+++ b/lib/librte_distributor/rte_distributor.c
@@ -636,7 +636,8 @@  rte_distributor_create(const char *name,
 
 	d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
 #if defined(RTE_ARCH_X86)
-	d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
+	if (rte_get_max_simd_bitwidth() >= RTE_MAX_128_SIMD)
+		d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
 #endif
 
 	/*