All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix tunnel offloads
@ 2018-08-01  8:37 Matan Azrad
  2018-08-01 11:58 ` Shahaf Shuler
  0 siblings, 1 reply; 2+ messages in thread
From: Matan Azrad @ 2018-08-01  8:37 UTC (permalink / raw)
  To: Yongseok Koh, Shahaf Shuler; +Cc: dev

There are a dedicated QP attributes, tunnel offload flag and mask, which
must be configured in order to allow part of the HW tunnel offloads.

So, if a QP is pointed by a tunnel flow, the above QP attributes
should be configured.

The mask configuration is wrongly only performed if an internal RSS was
configured by the user, while there is no reason to condition the
tunnel offloads in RSS configurations.

Consequently, some of the tunnel offloads was not performed by the HW
when a tunnel flow was configured, for example, the packet tunnel
types was not reported to the user.

Replace the internal RSS condition with the tunnel flow condition.

Fixes: df6afd377ace ("net/mlx5: remove useless arguments in hrxq API")

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 +++-
 drivers/net/mlx5/mlx5_rxq.c  | 8 ++++----
 drivers/net/mlx5/mlx5_rxtx.h | 3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index adda4df..923fc28 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2879,7 +2879,9 @@ mlx5_flow_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
 						     MLX5_RSS_HASH_KEY_LEN,
 						     verbs->hash_fields,
 						     (*flow->queue),
-						     flow->rss.queue_num);
+						     flow->rss.queue_num,
+						     !!(flow->layers &
+						      MLX5_FLOW_LAYER_TUNNEL));
 			if (!hrxq) {
 				rte_flow_error_set
 					(error, rte_errno,
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 16e1641..97b3e8e 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1752,7 +1752,8 @@ struct mlx5_hrxq *
 mlx5_hrxq_new(struct rte_eth_dev *dev,
 	      const uint8_t *rss_key, uint32_t rss_key_len,
 	      uint64_t hash_fields,
-	      const uint16_t *queues, uint32_t queues_n)
+	      const uint16_t *queues, uint32_t queues_n,
+	      int tunnel __rte_unused)
 {
 	struct priv *priv = dev->data->dev_private;
 	struct mlx5_hrxq *hrxq;
@@ -1794,9 +1795,8 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,
 			.pd = priv->pd,
 		 },
 		 &(struct mlx5dv_qp_init_attr){
-			.comp_mask = (hash_fields & IBV_RX_HASH_INNER) ?
-				 MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS :
-				 0,
+			.comp_mask = tunnel ?
+				MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS : 0,
 			.create_flags = MLX5DV_QP_CREATE_TUNNEL_OFFLOADS,
 		 });
 #else
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 992e977..48ed2b2 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -283,7 +283,8 @@ void mlx5_ind_table_ibv_drop_release(struct rte_eth_dev *dev);
 struct mlx5_hrxq *mlx5_hrxq_new(struct rte_eth_dev *dev,
 				const uint8_t *rss_key, uint32_t rss_key_len,
 				uint64_t hash_fields,
-				const uint16_t *queues, uint32_t queues_n);
+				const uint16_t *queues, uint32_t queues_n,
+				int tunnel __rte_unused);
 struct mlx5_hrxq *mlx5_hrxq_get(struct rte_eth_dev *dev,
 				const uint8_t *rss_key, uint32_t rss_key_len,
 				uint64_t hash_fields,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/mlx5: fix tunnel offloads
  2018-08-01  8:37 [PATCH] net/mlx5: fix tunnel offloads Matan Azrad
@ 2018-08-01 11:58 ` Shahaf Shuler
  0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-08-01 11:58 UTC (permalink / raw)
  To: Matan Azrad, Yongseok Koh; +Cc: dev

Wednesday, August 1, 2018 11:38 AM, Matan Azrad:
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix tunnel offloads
> 
> There are a dedicated QP attributes, tunnel offload flag and mask, which
> must be configured in order to allow part of the HW tunnel offloads.
> 
> So, if a QP is pointed by a tunnel flow, the above QP attributes should be
> configured.
> 
> The mask configuration is wrongly only performed if an internal RSS was
> configured by the user, while there is no reason to condition the tunnel
> offloads in RSS configurations.
> 
> Consequently, some of the tunnel offloads was not performed by the HW
> when a tunnel flow was configured, for example, the packet tunnel types
> was not reported to the user.
> 
> Replace the internal RSS condition with the tunnel flow condition.
> 
> Fixes: df6afd377ace ("net/mlx5: remove useless arguments in hrxq API")
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>

Applied to next-net-mlx, thanks. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-01 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01  8:37 [PATCH] net/mlx5: fix tunnel offloads Matan Azrad
2018-08-01 11:58 ` Shahaf Shuler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.