From patchwork Wed Oct 9 21:22:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1174095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uHMIc9nt"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46pRyk3C7tz9sDB for ; Thu, 10 Oct 2019 08:23:10 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2D20DD12; Wed, 9 Oct 2019 21:22:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id C2CE0CC2 for ; Wed, 9 Oct 2019 21:22:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5BFFB14D for ; Wed, 9 Oct 2019 21:22:24 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id e5so1666966pls.9 for ; Wed, 09 Oct 2019 14:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y4BuTNww3SVFQuf2i2O03KkRbwf6Rqme/+LN2g1oj+g=; b=uHMIc9ntMG4xSnRxjyqIM+skvcRQEt7CyQhF4V1b3ZOYyy6XluRcbxy18AzBzEGSLo jeihF951lOjpCGLK5rQVCY4i5pRkTkWdD61R58YSlGgzkKJy0JrVSDrYHjn/mZWHvagR Pngl4t9mj5qZFzEw5QRC42cAifuz71RPySA2bbhAb2SdfFlDFrbjtYshnfJAU+VPySAu puMZTCVW4Xfs8utAmAJcMalCss0+QmtWBrDdK08dIcFDG0kU90B67lcfpBej3rvf93CO A4plamjDiXPmT9DNQpP6wX/RDlkH4Ros+EAqNFcwlcfSjiqBqlbcZb3V+CrVf7KiVuLa kIdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y4BuTNww3SVFQuf2i2O03KkRbwf6Rqme/+LN2g1oj+g=; b=UV6pgxviMwxxBGnB/poMwYJn/PEeU8vmuMSjjGuofsuqdkF6pxITWWHJV+Tpl0/VKn 5hlFfLce4AGTsrrYLrkKBV5NGYExeDkdwJ3rwncSGOAuGYhS1oa8/jT9A8ss8AmFXeqb 4Tr7IfiRJC4K1+zhFsBi0yL2uc2icR6NAs8rxP+CLkZeoPc6txXTFDxjLk5fD0BbWQHm mJzxXRjaWmgHq+irUyTX8+zk7xVr+Gr5ZIktm+vwRcQWQIrh0urL9Cxs5tSOFVuysWtw 7pw5oAioYt9rpJr8JLe478mWJGwNeMQGkpelIXdqs454e1m6mjQygs0diH/FBmJJh2u5 vK4w== X-Gm-Message-State: APjAAAV/A8/IEd7bFgVTlS5r444X6F0zt1FjN84c3zt+ikWEIeMLF8/i +FA7qSotfsMsBy+NtE/0jSFR9ZxA X-Google-Smtp-Source: APXvYqxIjW5fhhwWKvAkHGCnVXk7TkXVBjzjNI+k/90PyHtyIo3BLqIbdzccExAr2QFZgHYSx33oEw== X-Received: by 2002:a17:902:9696:: with SMTP id n22mr4912821plp.252.1570656143411; Wed, 09 Oct 2019 14:22:23 -0700 (PDT) Received: from gizo.domain (97-115-119-26.ptld.qwest.net. [97.115.119.26]) by smtp.gmail.com with ESMTPSA id a13sm5191756pfg.10.2019.10.09.14.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Oct 2019 14:22:22 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 9 Oct 2019 14:22:10 -0700 Message-Id: <1570656134-11957-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570656134-11957-1-git-send-email-gvrose8192@gmail.com> References: <1570656134-11957-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Arnd Bergmann Subject: [ovs-dev] [PATCH 1/5] datapath: hide clang frame-overflow warnings X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Arnd Bergmann Upstream commit: commit 260637903f47f20c5918bb5c1eea52b2a28ea863 Author: Arnd Bergmann Date: Mon Jul 22 17:00:01 2019 +0200 ovs: datapath: hide clang frame-overflow warnings Some functions in the datapath code are factored out so that each one has a stack frame smaller than 1024 bytes with gcc. However, when compiling with clang, the functions are inlined more aggressively and combined again so we get net/openvswitch/datapath.c:1124:12: error: stack frame size of 1528 bytes in function 'ovs_flow_cmd_set' [-Werror,-Wframe-larger-than=] Marking both get_flow_actions() and ovs_nla_init_match_and_action() as 'noinline_for_stack' gives us the same behavior that we see with gcc, and no warning. Note that this does not mean we actually use less stack, as the functions call each other, and we still get three copies of the large 'struct sw_flow_key' type on the stack. The comment tells us that this was previously considered safe, presumably since the netlink parsing functions are called with a known backchain that does not also use a lot of stack space. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Cc: Arnd Bergmann Signed-off-by: Greg Rose Acked-by: Yi-Hung Wei --- datapath/datapath.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 94e4f6f..15af156 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1069,7 +1069,7 @@ error: } /* Factor out action copy to avoid "Wframe-larger-than=1024" warning. */ -static struct sw_flow_actions *get_flow_actions(struct net *net, +static noinline_for_stack struct sw_flow_actions *get_flow_actions(struct net *net, const struct nlattr *a, const struct sw_flow_key *key, const struct sw_flow_mask *mask, @@ -1103,12 +1103,13 @@ static struct sw_flow_actions *get_flow_actions(struct net *net, * we should not to return match object with dangling reference * to mask. * */ -static int ovs_nla_init_match_and_action(struct net *net, - struct sw_flow_match *match, - struct sw_flow_key *key, - struct nlattr **a, - struct sw_flow_actions **acts, - bool log) +static noinline_for_stack int +ovs_nla_init_match_and_action(struct net *net, + struct sw_flow_match *match, + struct sw_flow_key *key, + struct nlattr **a, + struct sw_flow_actions **acts, + bool log) { struct sw_flow_mask mask; int error = 0;