[08/13] net/mlx5: add support for hairpin hrxq
diff mbox series

Message ID 1569479349-36962-9-git-send-email-orika@mellanox.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • add hairpin feature
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ori Kam Sept. 26, 2019, 6:29 a.m. UTC
The hairpin hrxq is based on the DevX hrxq but uses different
pd.

Signed-off-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Slava Ovsiienko Sept. 26, 2019, 9:33 a.m. UTC | #1
> -----Original Message-----
> From: Ori Kam <orika@mellanox.com>
> Sent: Thursday, September 26, 2019 9:29
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; Ori Kam <orika@mellanox.com>; jingjing.wu@intel.com;
> stephen@networkplumber.org
> Subject: [PATCH 08/13] net/mlx5: add support for hairpin hrxq
> 
> The hairpin hrxq is based on the DevX hrxq but uses different pd.
> 
> Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_rxq.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index
> a673da9..bf39112 100644
> --- a/drivers/net/mlx5/mlx5_rxq.c
> +++ b/drivers/net/mlx5/mlx5_rxq.c
> @@ -2344,13 +2344,13 @@ struct mlx5_hrxq *
>  	struct mlx5_ind_table_obj *ind_tbl;
>  	int err;
>  	struct mlx5_devx_obj *tir = NULL;
> +	struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[queues[0]];
> +	struct mlx5_rxq_ctrl *rxq_ctrl =
> +		container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
> 
>  	queues_n = hash_fields ? queues_n : 1;
>  	ind_tbl = mlx5_ind_table_obj_get(dev, queues, queues_n);
>  	if (!ind_tbl) {
> -		struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[queues[0]];
> -		struct mlx5_rxq_ctrl *rxq_ctrl =
> -			container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
>  		enum mlx5_ind_tbl_type type;
> 
>  		type = rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_IBV ?
> @@ -2446,7 +2446,10 @@ struct mlx5_hrxq *
>  		tir_attr.rx_hash_fn = MLX5_RX_HASH_FN_TOEPLITZ;
>  		memcpy(&tir_attr.rx_hash_field_selector_outer,
> &hash_fields,
>  		       sizeof(uint64_t));
> -		tir_attr.transport_domain = priv->sh->tdn;
> +		if (rxq_ctrl->obj->type ==
> MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN)
> +			tir_attr.transport_domain = priv->sh->td->id;
> +		else
> +			tir_attr.transport_domain = priv->sh->tdn;
>  		memcpy(tir_attr.rx_hash_toeplitz_key, rss_key, rss_key_len);
>  		tir_attr.indirect_table = ind_tbl->rqt->id;
>  		if (dev->data->dev_conf.lpbk_mode)
> --
> 1.8.3.1

Patch
diff mbox series

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a673da9..bf39112 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2344,13 +2344,13 @@  struct mlx5_hrxq *
 	struct mlx5_ind_table_obj *ind_tbl;
 	int err;
 	struct mlx5_devx_obj *tir = NULL;
+	struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[queues[0]];
+	struct mlx5_rxq_ctrl *rxq_ctrl =
+		container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
 
 	queues_n = hash_fields ? queues_n : 1;
 	ind_tbl = mlx5_ind_table_obj_get(dev, queues, queues_n);
 	if (!ind_tbl) {
-		struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[queues[0]];
-		struct mlx5_rxq_ctrl *rxq_ctrl =
-			container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
 		enum mlx5_ind_tbl_type type;
 
 		type = rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_IBV ?
@@ -2446,7 +2446,10 @@  struct mlx5_hrxq *
 		tir_attr.rx_hash_fn = MLX5_RX_HASH_FN_TOEPLITZ;
 		memcpy(&tir_attr.rx_hash_field_selector_outer, &hash_fields,
 		       sizeof(uint64_t));
-		tir_attr.transport_domain = priv->sh->tdn;
+		if (rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN)
+			tir_attr.transport_domain = priv->sh->td->id;
+		else
+			tir_attr.transport_domain = priv->sh->tdn;
 		memcpy(tir_attr.rx_hash_toeplitz_key, rss_key, rss_key_len);
 		tir_attr.indirect_table = ind_tbl->rqt->id;
 		if (dev->data->dev_conf.lpbk_mode)