Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933150AbcLICbO (ORCPT ); Thu, 8 Dec 2016 21:31:14 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:47908 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932672AbcLICbN (ORCPT ); Thu, 8 Dec 2016 21:31:13 -0500 Date: Thu, 08 Dec 2016 21:31:10 -0500 (EST) Message-Id: <20161208.213110.1398471429588400159.davem@davemloft.net> To: arnd@arndb.de Cc: isubramanian@apm.com, kchudgar@apm.com, kdinh@apm.com, qnguyen@apm.com, tinamdar@apm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/3] net: xgene: move xgene_cle_ptree_ewdn data off stack From: David Miller In-Reply-To: <20161208215727.44841-2-arnd@arndb.de> References: <20161208215727.44841-1-arnd@arndb.de> <20161208215727.44841-2-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-7 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 08 Dec 2016 17:31:51 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uB92VW7M028959 Content-Length: 1131 Lines: 25 From: Arnd Bergmann Date: Thu, 8 Dec 2016 22:57:04 +0100 > The array for initializing the cle is set up on the stack with > almost entirely constant data and then passed to a function that > converts it into HW specific bit patterns. With the latest > addition, the size of this array has grown to the point that > we get a warning about potential stack overflow in allmodconfig > builds: > > xgene_enet_cle.c: In function ?xgene_enet_cle_init?: > xgene_enet_cle.c:836:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > Looking a bit deeper at the usage, I noticed that the only modification > of the data is in dead code, as we don't even use the cle module > for phy_mode other than PHY_INTERFACE_MODE_XGMII. This means we > can simply mark the structure constant and access it directly rather > than passing the pointer down through another structure, making > the code more efficient at the same time as avoiding the > warning. > > Fixes: a809701fed15 ("drivers: net: xgene: fix: RSS for non-TCP/UDP") > Signed-off-by: Arnd Bergmann Applied.