From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net-next 2/2] rtnetlink: avoid frame size warning in rtnl_newlink() Date: Wed, 28 Nov 2018 10:53:47 -0700 Message-ID: <3c9b50e3-a233-9120-16eb-20fa1a264751@gmail.com> References: <20181128063231.12907-1-jakub.kicinski@netronome.com> <20181128063231.12907-3-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: jiri@resnulli.us, roopa@cumulusnetworks.com, christian.brauner@ubuntu.com, netdev@vger.kernel.org, oss-drivers@netronome.com To: Jakub Kicinski , davem@davemloft.net Return-path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:35748 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729309AbeK2E4Q (ORCPT ); Wed, 28 Nov 2018 23:56:16 -0500 Received: by mail-pf1-f194.google.com with SMTP id z9so10538043pfi.2 for ; Wed, 28 Nov 2018 09:53:49 -0800 (PST) In-Reply-To: <20181128063231.12907-3-jakub.kicinski@netronome.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/27/18 11:32 PM, Jakub Kicinski wrote: > Standard kernel compilation produces the following warning: > > net/core/rtnetlink.c: In function ‘rtnl_newlink’: > net/core/rtnetlink.c:3232:1: warning: the frame size of 1288 bytes is larger than 1024 bytes [-Wframe-larger-than=] > } > ^ > > This should not really be an issue, as rtnl_newlink() stack is > generally quite shallow. > > Fix the warning by allocating attributes with kmalloc() in a wrapper > and passing it down to rtnl_newlink(), avoiding complexities on error > paths. > > Alternatively we could kmalloc() some structure within rtnl_newlink(), > slave attributes look like a good candidate. In practice it adds to > already rather high complexity and length of the function. > > Signed-off-by: Jakub Kicinski > --- > net/core/rtnetlink.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > Reviewed-by: David Ahern