Blame SOURCES/0121-netdrv-net-mlx5e-Fix-hairpin-RSS-table-size.patch

d8f823
From 14f853c86f2b801cbe7aa38ebc2fac7883122ec7 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Sun, 10 May 2020 15:04:46 -0400
d8f823
Subject: [PATCH 121/312] [netdrv] net/mlx5e: Fix hairpin RSS table size
d8f823
d8f823
Message-id: <20200510150452.10307-82-ahleihel@redhat.com>
d8f823
Patchwork-id: 306705
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789380 v2 81/87] net/mlx5e: Fix hairpin RSS table size
d8f823
Bugzilla: 1789380
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789380
d8f823
Upstream: v5.5-rc6
d8f823
d8f823
commit 6412bb396a63f28de994b1480edf8e4caf4aa494
d8f823
Author: Eli Cohen <eli@mellanox.com>
d8f823
Date:   Wed Dec 11 09:17:40 2019 +0200
d8f823
d8f823
    net/mlx5e: Fix hairpin RSS table size
d8f823
d8f823
    Set hairpin table size to the corret size, based on the groups that
d8f823
    would be created in it. Groups are laid out on the table such that a
d8f823
    group occupies a range of entries in the table. This implies that the
d8f823
    group ranges should have correspondence to the table they are laid upon.
d8f823
d8f823
    The patch cited below  made group 1's size to grow hence causing
d8f823
    overflow of group range laid on the table.
d8f823
d8f823
    Fixes: a795d8db2a6d ("net/mlx5e: Support RSS for IP-in-IP and IPv6 tunneled packets")
d8f823
    Signed-off-by: Eli Cohen <eli@mellanox.com>
d8f823
    Signed-off-by: Mark Bloch <markb@mellanox.com>
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 16 ++++++++++++++++
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 16 ----------------
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |  2 +-
d8f823
 3 files changed, 17 insertions(+), 17 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
d8f823
index 68d593074f6c..d48292ccda29 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
d8f823
@@ -122,6 +122,22 @@ enum {
d8f823
 #endif
d8f823
 };
d8f823
 
d8f823
+#define MLX5E_TTC_NUM_GROUPS	3
d8f823
+#define MLX5E_TTC_GROUP1_SIZE	(BIT(3) + MLX5E_NUM_TUNNEL_TT)
d8f823
+#define MLX5E_TTC_GROUP2_SIZE	 BIT(1)
d8f823
+#define MLX5E_TTC_GROUP3_SIZE	 BIT(0)
d8f823
+#define MLX5E_TTC_TABLE_SIZE	(MLX5E_TTC_GROUP1_SIZE +\
d8f823
+				 MLX5E_TTC_GROUP2_SIZE +\
d8f823
+				 MLX5E_TTC_GROUP3_SIZE)
d8f823
+
d8f823
+#define MLX5E_INNER_TTC_NUM_GROUPS	3
d8f823
+#define MLX5E_INNER_TTC_GROUP1_SIZE	BIT(3)
d8f823
+#define MLX5E_INNER_TTC_GROUP2_SIZE	BIT(1)
d8f823
+#define MLX5E_INNER_TTC_GROUP3_SIZE	BIT(0)
d8f823
+#define MLX5E_INNER_TTC_TABLE_SIZE	(MLX5E_INNER_TTC_GROUP1_SIZE +\
d8f823
+					 MLX5E_INNER_TTC_GROUP2_SIZE +\
d8f823
+					 MLX5E_INNER_TTC_GROUP3_SIZE)
d8f823
+
d8f823
 #ifdef CONFIG_MLX5_EN_RXNFC
d8f823
 
d8f823
 struct mlx5e_ethtool_table {
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
d8f823
index 15b7f0f1427c..73d3dc07331f 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
d8f823
@@ -904,22 +904,6 @@ static int mlx5e_generate_ttc_table_rules(struct mlx5e_priv *priv,
d8f823
 	return err;
d8f823
 }
d8f823
 
d8f823
-#define MLX5E_TTC_NUM_GROUPS	3
d8f823
-#define MLX5E_TTC_GROUP1_SIZE	(BIT(3) + MLX5E_NUM_TUNNEL_TT)
d8f823
-#define MLX5E_TTC_GROUP2_SIZE	 BIT(1)
d8f823
-#define MLX5E_TTC_GROUP3_SIZE	 BIT(0)
d8f823
-#define MLX5E_TTC_TABLE_SIZE	(MLX5E_TTC_GROUP1_SIZE +\
d8f823
-				 MLX5E_TTC_GROUP2_SIZE +\
d8f823
-				 MLX5E_TTC_GROUP3_SIZE)
d8f823
-
d8f823
-#define MLX5E_INNER_TTC_NUM_GROUPS	3
d8f823
-#define MLX5E_INNER_TTC_GROUP1_SIZE	BIT(3)
d8f823
-#define MLX5E_INNER_TTC_GROUP2_SIZE	BIT(1)
d8f823
-#define MLX5E_INNER_TTC_GROUP3_SIZE	BIT(0)
d8f823
-#define MLX5E_INNER_TTC_TABLE_SIZE	(MLX5E_INNER_TTC_GROUP1_SIZE +\
d8f823
-					 MLX5E_INNER_TTC_GROUP2_SIZE +\
d8f823
-					 MLX5E_INNER_TTC_GROUP3_SIZE)
d8f823
-
d8f823
 static int mlx5e_create_ttc_table_groups(struct mlx5e_ttc_table *ttc,
d8f823
 					 bool use_ipv)
d8f823
 {
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
index 0af1d5b1e438..daef493b8e50 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
@@ -586,7 +586,7 @@ static void mlx5e_hairpin_set_ttc_params(struct mlx5e_hairpin *hp,
d8f823
 	for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++)
d8f823
 		ttc_params->indir_tirn[tt] = hp->indir_tirn[tt];
d8f823
 
d8f823
-	ft_attr->max_fte = MLX5E_NUM_TT;
d8f823
+	ft_attr->max_fte = MLX5E_TTC_TABLE_SIZE;
d8f823
 	ft_attr->level = MLX5E_TC_TTC_FT_LEVEL;
d8f823
 	ft_attr->prio = MLX5E_TC_PRIO;
d8f823
 }
d8f823
-- 
d8f823
2.13.6
d8f823