[dpdk-stable] patch 'net/mlx5: fix shared inner RSS' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:01:33 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/43af55f5bfb54bd8b66e07728dc769c2ca12644c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 43af55f5bfb54bd8b66e07728dc769c2ca12644c Mon Sep 17 00:00:00 2001
From: Xiaoyu Min <jackmin at nvidia.com>
Date: Fri, 26 Mar 2021 13:20:20 +0800
Subject: [PATCH] net/mlx5: fix shared inner RSS
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit b27bbe81579202409de8bb5ca307f9e10d5bb9e2 ]

The shared RSS action use the _tunnel_ information which is derived
from flow items to decide whether need to do inner RSS or not.
However, inner RSS should be decided by RSS level (>1) in configuration
and then to create TIR with 'IBV_RX_HASH_INNER' hash bit set.

Also, for one shared RSS action there is only one set of TIRs -
outer or inner could be so the unnecessary set of TIRs are removed
in order to reduce resource.

Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")

Signed-off-by: Xiaoyu Min <jackmin at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h    |  2 --
 drivers/net/mlx5/mlx5_flow_dv.c | 48 +++++++++++++++------------------
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 91f48923c0..76c0208a85 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1082,8 +1082,6 @@ struct mlx5_shared_action_rss {
 	/**< Hash RX queues (hrxq, hrxq_tunnel fields) indirection table. */
 	uint32_t hrxq[MLX5_RSS_HASH_FIELDS_LEN];
 	/**< Hash RX queue indexes mapped to mlx5_rss_hash_fields */
-	uint32_t hrxq_tunnel[MLX5_RSS_HASH_FIELDS_LEN];
-	/**< Hash RX queue indexes for tunneled RSS */
 	rte_spinlock_t action_rss_sl; /**< Shared RSS action spinlock. */
 };
 
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 347c3a1c13..8e64b82e10 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -10675,10 +10675,9 @@ flow_dv_translate(struct rte_eth_dev *dev,
 static int
 __flow_dv_action_rss_hrxq_set(struct mlx5_shared_action_rss *action,
 			      const uint64_t hash_fields,
-			      const int tunnel,
 			      uint32_t hrxq_idx)
 {
-	uint32_t *hrxqs = tunnel ? action->hrxq : action->hrxq_tunnel;
+	uint32_t *hrxqs = action->hrxq;
 
 	switch (hash_fields & ~IBV_RX_HASH_INNER) {
 	case MLX5_RSS_HASH_IPV4:
@@ -10725,14 +10724,12 @@ __flow_dv_action_rss_hrxq_set(struct mlx5_shared_action_rss *action,
  */
 static uint32_t
 __flow_dv_action_rss_hrxq_lookup(struct rte_eth_dev *dev, uint32_t idx,
-				 const uint64_t hash_fields,
-				 const int tunnel)
+				 const uint64_t hash_fields)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_shared_action_rss *shared_rss =
 	    mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS], idx);
-	const uint32_t *hrxqs = tunnel ? shared_rss->hrxq :
-							shared_rss->hrxq_tunnel;
+	const uint32_t *hrxqs = shared_rss->hrxq;
 
 	switch (hash_fields & ~IBV_RX_HASH_INNER) {
 	case MLX5_RSS_HASH_IPV4:
@@ -10821,9 +10818,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
 
 			hrxq_idx = __flow_dv_action_rss_hrxq_lookup(dev,
 						rss_desc->shared_rss,
-						dev_flow->hash_fields,
-						!!(dh->layers &
-						MLX5_FLOW_LAYER_TUNNEL));
+						dev_flow->hash_fields);
 			if (hrxq_idx)
 				hrxq = mlx5_ipool_get
 					(priv->sh->ipool[MLX5_IPOOL_HRXQ],
@@ -11415,8 +11410,7 @@ static int
 __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
 				 struct mlx5_shared_action_rss *shared_rss)
 {
-	return __flow_dv_hrxqs_release(dev, &shared_rss->hrxq) +
-		__flow_dv_hrxqs_release(dev, &shared_rss->hrxq_tunnel);
+	return __flow_dv_hrxqs_release(dev, &shared_rss->hrxq);
 }
 
 /**
@@ -11462,23 +11456,25 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
 	for (i = 0; i < MLX5_RSS_HASH_FIELDS_LEN; i++) {
 		uint32_t hrxq_idx;
 		uint64_t hash_fields = mlx5_rss_hash_fields[i];
-		int tunnel;
+		int tunnel = 0;
 
-		for (tunnel = 0; tunnel < 2; tunnel++) {
-			rss_desc.tunnel = tunnel;
-			rss_desc.hash_fields = hash_fields;
-			hrxq_idx = mlx5_hrxq_get(dev, &rss_desc);
-			if (!hrxq_idx) {
-				rte_flow_error_set
-					(error, rte_errno,
-					 RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
-					 "cannot get hash queue");
-				goto error_hrxq_new;
-			}
-			err = __flow_dv_action_rss_hrxq_set
-				(shared_rss, hash_fields, tunnel, hrxq_idx);
-			MLX5_ASSERT(!err);
+		if (shared_rss->origin.level > 1) {
+			hash_fields |= IBV_RX_HASH_INNER;
+			tunnel = 1;
+		}
+		rss_desc.tunnel = tunnel;
+		rss_desc.hash_fields = hash_fields;
+		hrxq_idx = mlx5_hrxq_get(dev, &rss_desc);
+		if (!hrxq_idx) {
+			rte_flow_error_set
+				(error, rte_errno,
+				 RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				 "cannot get hash queue");
+			goto error_hrxq_new;
 		}
+		err = __flow_dv_action_rss_hrxq_set
+			(shared_rss, hash_fields, hrxq_idx);
+		MLX5_ASSERT(!err);
 	}
 	return 0;
 error_hrxq_new:
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:30.319968600 +0800
+++ 0145-net-mlx5-fix-shared-inner-RSS.patch	2021-05-10 23:59:26.560000000 +0800
@@ -1 +1 @@
-From b27bbe81579202409de8bb5ca307f9e10d5bb9e2 Mon Sep 17 00:00:00 2001
+From 43af55f5bfb54bd8b66e07728dc769c2ca12644c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit b27bbe81579202409de8bb5ca307f9e10d5bb9e2 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 8324e188e1..00b6cd97b9 100644
+index 91f48923c0..76c0208a85 100644
@@ -29 +31 @@
-@@ -1129,8 +1129,6 @@ struct mlx5_shared_action_rss {
+@@ -1082,8 +1082,6 @@ struct mlx5_shared_action_rss {
@@ -39 +41 @@
-index 223a7d0e36..264dd69a72 100644
+index 347c3a1c13..8e64b82e10 100644
@@ -42 +44 @@
-@@ -11895,10 +11895,9 @@ flow_dv_translate(struct rte_eth_dev *dev,
+@@ -10675,10 +10675,9 @@ flow_dv_translate(struct rte_eth_dev *dev,
@@ -54 +56 @@
-@@ -11945,14 +11944,12 @@ __flow_dv_action_rss_hrxq_set(struct mlx5_shared_action_rss *action,
+@@ -10725,14 +10724,12 @@ __flow_dv_action_rss_hrxq_set(struct mlx5_shared_action_rss *action,
@@ -71 +73 @@
-@@ -12041,9 +12038,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
+@@ -10821,9 +10818,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
@@ -82 +84 @@
-@@ -12654,8 +12649,7 @@ static int
+@@ -11415,8 +11410,7 @@ static int
@@ -92 +94 @@
-@@ -12701,23 +12695,25 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
+@@ -11462,23 +11456,25 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,


More information about the stable mailing list