Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp695156ybg; Mon, 1 Jun 2020 11:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTBIFD153s9Jsn1vS1FXGFSeSZg9g8yp1k+usWDkLE16g6DYT2H8okB0UGcoKtbaPfwvic X-Received: by 2002:a17:906:57d3:: with SMTP id u19mr21056014ejr.401.1591037668176; Mon, 01 Jun 2020 11:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591037668; cv=none; d=google.com; s=arc-20160816; b=Clg6jAiPz67TxuWH1+4sS8EkGdLPmCRQbcE747RcLZbYhIpnY1holgzTOYecSgWgsq AGTGvfkxgE0I0BH6OFmQXYX3GUI369lgsIbsflWm0M12MtRILFlZmlzfwF/Ev4ZzbUyZ wBjXrOIuYMpi3vhUTwIWJawY2aNaf0PG3VAzzVUVwJLf8EcJceDGgZ1XP9lLeY/1kWUc kj10aNEKVqlK8HcRZu7TmwZRT5WRKO7MzyyLlm1tzhdtdMXb8O1Le4Y4yRxdm+8arQqV T+ECKyP6QL3nc/teGKX4AnkCBh2vbAUJoXs+chhAz4iXPZc1DJYC7HECG22LU3oYy1wP qAOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=EIDkxOWiAZrzvYvJ89jFftuwZgsdZpaFDyD7VbTbK7s=; b=K1Kmmw7j11xuykZSlBznqLENGaas1E11BRqVWTUsb/DPes36vIOcfZL2rDQo9s+Yrx /YIJT8/DSb4LiiusvBrXL1fB8EZkRELM8XfEWYzjRlA2CS3Sy37ukjWXmhlwF/U1W0vA Mf9P9lgiFgVq3Cz4SwYMGCYEUex8cSyveJUGAcbQzS+ETWbql0fP5N9zvI3RKqBM46xO 5O0XBnafD+siFhOTCYxhbTYdVjsOX7vHAOH9ffcgLcyIPrWv0a9QCTpxIPUXUl+p8iDy oSF1KYXn6BnH7xY3JwBNWwXAl9tBQDgdgwzk6X/YLudviFdM9Y+AM/VRdGn8624JxbqQ Yf7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si142410edf.484.2020.06.01.11.54.05; Mon, 01 Jun 2020 11:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730953AbgFASw1 (ORCPT + 99 others); Mon, 1 Jun 2020 14:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730438AbgFASwY (ORCPT ); Mon, 1 Jun 2020 14:52:24 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7705C061A0E; Mon, 1 Jun 2020 11:52:23 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C6048120477C4; Mon, 1 Jun 2020 11:52:22 -0700 (PDT) Date: Mon, 01 Jun 2020 11:52:22 -0700 (PDT) Message-Id: <20200601.115222.628560714795578081.davem@davemloft.net> To: arnd@arndb.de Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, kuba@kernel.org, gnault@redhat.com, vladbu@mellanox.com, lucien.xin@gmail.com, pablo@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] flow_dissector: work around stack frame size warning From: David Miller In-Reply-To: <20200529201413.397679-1-arnd@arndb.de> References: <20200529201413.397679-1-arnd@arndb.de> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 01 Jun 2020 11:52:23 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Fri, 29 May 2020 22:13:58 +0200 > The fl_flow_key structure is around 500 bytes, so having two of them > on the stack in one function now exceeds the warning limit after an > otherwise correct change: > > net/sched/cls_flower.c:298:12: error: stack frame size of 1056 bytes in function 'fl_classify' [-Werror,-Wframe-larger-than=] > > I suspect the fl_classify function could be reworked to only have one > of them on the stack and modify it in place, but I could not work out > how to do that. > > As a somewhat hacky workaround, move one of them into an out-of-line > function to reduce its scope. This does not necessarily reduce the stack > usage of the outer function, but at least the second copy is removed > from the stack during most of it and does not add up to whatever is > called from there. > > I now see 552 bytes of stack usage for fl_classify(), plus 528 bytes > for fl_mask_lookup(). > > Fixes: 58cff782cc55 ("flow_dissector: Parse multiple MPLS Label Stack Entries") > Signed-off-by: Arnd Bergmann Applied, thanks.