net/mlx5: prefer DevX API to create Rx objects

Message ID ecb4c931dd3264f0fe0b48de76a0bd00e9593bea.1589109437.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: prefer DevX API to create Rx objects |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/iol-testing fail Testing issues

Commit Message

Dekel Peled May 10, 2020, 11:18 a.m. UTC
  Currently, DevX API is used to create Rx objects (RQ, RQT, TIR) only
if LRO or hairpin features are enabled on this RQ.

This patch uses DevX API by default, if DevX is supported and can be
used. Otherwise, Verbs API is used.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_trigger.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
  

Comments

Raslan Darawsheh May 12, 2020, 11:15 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Sunday, May 10, 2020 2:19 PM
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] net/mlx5: prefer DevX API to create Rx objects
> 
> Currently, DevX API is used to create Rx objects (RQ, RQT, TIR) only
> if LRO or hairpin features are enabled on this RQ.
> 
> This patch uses DevX API by default, if DevX is supported and can be
> used. Otherwise, Verbs API is used.
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_trigger.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c
> index feb9154..8d53648 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -107,17 +107,11 @@
>  	struct mlx5_priv *priv = dev->data->dev_private;
>  	unsigned int i;
>  	int ret = 0;
> -	enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
> -	struct mlx5_rxq_data *rxq = NULL;
> +	enum mlx5_rxq_obj_type obj_type =
> +			priv->config.dv_flow_en && priv->config.devx &&
> +			priv->config.dest_tir ?
> +			MLX5_RXQ_OBJ_TYPE_DEVX_RQ :
> MLX5_RXQ_OBJ_TYPE_IBV;
> 
> -	for (i = 0; i < priv->rxqs_n; ++i) {
> -		rxq = (*priv->rxqs)[i];
> -
> -		if (rxq && rxq->lro) {
> -			obj_type =  MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
> -			break;
> -		}
> -	}
>  	/* Allocate/reuse/resize mempool for Multi-Packet RQ. */
>  	if (mlx5_mprq_alloc_mp(dev)) {
>  		/* Should not release Rx queues but return immediately. */
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index feb9154..8d53648 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -107,17 +107,11 @@ 
 	struct mlx5_priv *priv = dev->data->dev_private;
 	unsigned int i;
 	int ret = 0;
-	enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
-	struct mlx5_rxq_data *rxq = NULL;
+	enum mlx5_rxq_obj_type obj_type =
+			priv->config.dv_flow_en && priv->config.devx &&
+			priv->config.dest_tir ?
+			MLX5_RXQ_OBJ_TYPE_DEVX_RQ : MLX5_RXQ_OBJ_TYPE_IBV;
 
-	for (i = 0; i < priv->rxqs_n; ++i) {
-		rxq = (*priv->rxqs)[i];
-
-		if (rxq && rxq->lro) {
-			obj_type =  MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
-			break;
-		}
-	}
 	/* Allocate/reuse/resize mempool for Multi-Packet RQ. */
 	if (mlx5_mprq_alloc_mp(dev)) {
 		/* Should not release Rx queues but return immediately. */