Blame SOURCES/0129-netdrv-mlx5-work-around-high-stack-usage-with-gcc.patch

d8f823
From 32bd5c04ec418a69b6e9701faa84ef0a7abb2745 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Tue, 12 May 2020 10:53:35 -0400
d8f823
Subject: [PATCH 129/312] [netdrv] mlx5: work around high stack usage with gcc
d8f823
d8f823
Message-id: <20200512105530.4207-10-ahleihel@redhat.com>
d8f823
Patchwork-id: 306881
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789382 009/124] mlx5: work around high stack usage with gcc
d8f823
Bugzilla: 1789382
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789382
d8f823
Upstream: v5.6-rc1
d8f823
d8f823
commit 42ae1a5c76691928ed217c7e40269db27f5225e9
d8f823
Author: Arnd Bergmann <arnd@arndb.de>
d8f823
Date:   Sat Jan 4 22:51:44 2020 +0100
d8f823
d8f823
    mlx5: work around high stack usage with gcc
d8f823
d8f823
    In some configurations, gcc tries too hard to optimize this code:
d8f823
d8f823
    drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'mlx5e_grp_sw_update_stats':
d8f823
    drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:302:1: error: the frame size of 1336 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
d8f823
d8f823
    As was stated in the bug report, the reason is that gcc runs into a corner
d8f823
    case in the register allocator that is rather hard to fix in a good way.
d8f823
d8f823
    As there is an easy way to work around it, just add a comment and the
d8f823
    barrier that stops gcc from trying to overoptimize the function.
d8f823
d8f823
    Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657
d8f823
    Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
d8f823
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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_stats.c | 3 +++
d8f823
 1 file changed, 3 insertions(+)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
d8f823
index 23587f55fad7..30b216d9284c 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
d8f823
@@ -349,6 +349,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw)
d8f823
 			s->tx_tls_drop_bypass_req   += sq_stats->tls_drop_bypass_req;
d8f823
 #endif
d8f823
 			s->tx_cqes		+= sq_stats->cqes;
d8f823
+
d8f823
+			/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657 */
d8f823
+			barrier();
d8f823
 		}
d8f823
 	}
d8f823
 }
d8f823
-- 
d8f823
2.13.6
d8f823