patch 'net/mlx5: fix RSS hash types adjustment' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:03:01 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. 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/40b12a05613e84f38acffcfc2965b752edc3c7b9

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 40b12a05613e84f38acffcfc2965b752edc3c7b9 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Mon, 20 Jun 2022 10:37:28 +0000
Subject: [PATCH] net/mlx5: fix RSS hash types adjustment
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 ]

When an indirect action was created with an RSS action configured to
hash on both source and destination L3 addresses (or L4 ports), it caused
shared hrxq to be configured to hash only on destination address
(or port).

This patch fixes this behavior by refining RSS types specified in
configuration before calculating hash types used for hrxq. Refining RSS
types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set.

Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types")
Cc: stable at dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index aa22e85f6a..c1505b69e6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -11567,8 +11567,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  * MLX5_RSS_HASH_IPV4_DST_ONLY are mutually exclusive so they can share
  * same slot in mlx5_rss_hash_fields.
  *
- * @param[in] rss
- *   Pointer to the shared action RSS conf.
+ * @param[in] orig_rss_types
+ *   RSS type as provided in shared RSS action.
  * @param[in, out] hash_field
  *   hash_field variable needed to be adjusted.
  *
@@ -11576,10 +11576,10 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  *   void
  */
 static void
-__flow_dv_action_rss_l34_hash_adjust(struct mlx5_shared_action_rss *rss,
+__flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types,
 				     uint64_t *hash_field)
 {
-	uint64_t rss_types = rss->origin.types;
+	uint64_t rss_types = rte_eth_rss_hf_refine(orig_rss_types);
 
 	switch (*hash_field & ~IBV_RX_HASH_INNER) {
 	case MLX5_RSS_HASH_IPV4:
@@ -11680,7 +11680,8 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
 		uint64_t hash_fields = mlx5_rss_hash_fields[i];
 		int tunnel = 0;
 
-		__flow_dv_action_rss_l34_hash_adjust(shared_rss, &hash_fields);
+		__flow_dv_action_rss_l34_hash_adjust(shared_rss->origin.types,
+						     &hash_fields);
 		if (shared_rss->origin.level > 1) {
 			hash_fields |= IBV_RX_HASH_INNER;
 			tunnel = 1;
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:54.354196046 +0800
+++ 0115-net-mlx5-fix-RSS-hash-types-adjustment.patch	2022-06-21 15:37:49.287785472 +0800
@@ -1 +1 @@
-From d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 Mon Sep 17 00:00:00 2001
+From 40b12a05613e84f38acffcfc2965b752edc3c7b9 Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Thu, 21 Apr 2022 20:36:56 +0000
+Date: Mon, 20 Jun 2022 10:37:28 +0000
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 ]
@@ -21,2 +24,2 @@
- drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
+ drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
@@ -25 +28 @@
-index da2ddd58cd..cb5006bb11 100644
+index aa22e85f6a..c1505b69e6 100644
@@ -28 +31 @@
-@@ -14793,8 +14793,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
+@@ -11567,8 +11567,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
@@ -32,2 +35,2 @@
-- * @param[in] rss_types
-- *   RSS type.
+- * @param[in] rss
+- *   Pointer to the shared action RSS conf.
@@ -39 +42 @@
-@@ -14802,9 +14802,11 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
+@@ -11576,10 +11576,10 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
@@ -42,4 +45,4 @@
- void
--flow_dv_action_rss_l34_hash_adjust(uint64_t rss_types,
-+flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types,
- 				   uint64_t *hash_field)
+ static void
+-__flow_dv_action_rss_l34_hash_adjust(struct mlx5_shared_action_rss *rss,
++__flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types,
+ 				     uint64_t *hash_field)
@@ -46,0 +50 @@
+-	uint64_t rss_types = rss->origin.types;
@@ -48 +52 @@
-+
+ 
@@ -51 +55,10 @@
- 		if (rss_types & MLX5_IPV4_LAYER_TYPES) {
+@@ -11680,7 +11680,8 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
+ 		uint64_t hash_fields = mlx5_rss_hash_fields[i];
+ 		int tunnel = 0;
+ 
+-		__flow_dv_action_rss_l34_hash_adjust(shared_rss, &hash_fields);
++		__flow_dv_action_rss_l34_hash_adjust(shared_rss->origin.types,
++						     &hash_fields);
+ 		if (shared_rss->origin.level > 1) {
+ 			hash_fields |= IBV_RX_HASH_INNER;
+ 			tunnel = 1;


More information about the stable mailing list