Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7462834ybp; Wed, 16 Oct 2019 09:02:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF9xN8JV9Rz5vkNVtAJ+jhLw81wmPUK7Rhn+lT0n7KoquUD5HDvBo2a4avUeeSKZITr7Bw X-Received: by 2002:a17:906:8317:: with SMTP id j23mr39847924ejx.314.1571241722816; Wed, 16 Oct 2019 09:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571241722; cv=none; d=google.com; s=arc-20160816; b=Gw44flOdRiJy6amkaimqRzKgHjmtuc+liq4FOqYojNtPzZWElcVBE85MWHzeL9gqV3 qgzi8h6jktASptsJE57gU4kBlo4ExxHIizy2kyqh0+MRYhWgYLR1/K/yGB0U4lr5yZ9U 36U2P1NKF7c1vwUTOCy+fk6fWdN7vIpRpBG1gUWVw70UiFfVMUVxXNq43jEet1r8X4Zf xv9yrS2zKL6WlsyePPIVeRHQvl19RH/4dxwfPKJ2OQ5fnuV/4olFJFHXf4Tt2BzpBFHC VSy6v+DtEiq+raVJvKn9Q+yhjKhG0eM8zfbJ4mlRfP3HKxG/pdraTbf5shOdBQSlToDd N0zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HhAK8bqHk3L+9Oa/kYYP/l8S0opnsPmjLepoQf3t2vY=; b=CYpQOFcDvHqxRss7hJ2273LIyUYs7EgPjtP5nuglV+D3NiU5uUSuFrK0i3HiqgTcLY wIUOArQC/KeE16y2YlZl/xxiH6fzSBOecpSz1CtnyYIBlMRK3g6g6B1xhoejp60NLykj xEkQ36ujTYOvmmysU+qZRPPJgvDpGNRDlOY6uofDrG8kpUwXeVO5in3WKMSgtkMNp62i QZh+Xed7C+EjCtYIjiIr/ncKx36k+dKXZ8/aA+d+g/FH7IutEioNkV6oWPSCtxIPwFvQ yhu9Npd3gh60d8C4WiYgkEv6/7D3ygXlOzKGIFgW1hB4h3v+XIPZb7yXjJWM9AgYOmUA 8BJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h43si16386901ede.142.2019.10.16.09.01.39; Wed, 16 Oct 2019 09:02:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393469AbfJPNKb (ORCPT + 99 others); Wed, 16 Oct 2019 09:10:31 -0400 Received: from www62.your-server.de ([213.133.104.62]:51438 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727080AbfJPNKb (ORCPT ); Wed, 16 Oct 2019 09:10:31 -0400 Received: from [2a02:120b:2c12:c120:71a0:62dd:894c:fd0e] (helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1iKj4H-0002aC-34; Wed, 16 Oct 2019 15:10:21 +0200 Date: Wed, 16 Oct 2019 15:10:20 +0200 From: Daniel Borkmann To: Ben Dooks Cc: linux-kernel@lists.codethink.co.uk, Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: bpf: add static in net/core/filter.c Message-ID: <20191016131020.GE21367@pc-63.home> References: <20191016110446.24622-1-ben.dooks@codethink.co.uk> <20191016122605.GC21367@pc-63.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25604/Wed Oct 16 10:53:05 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 16, 2019 at 02:02:31PM +0100, Ben Dooks wrote: > On 16/10/2019 13:26, Daniel Borkmann wrote: > > On Wed, Oct 16, 2019 at 12:04:46PM +0100, Ben Dooks (Codethink) wrote: > > > There are a number of structs in net/core/filter.c > > > that are not exported or declared outside of the > > > file. Fix the following warnings by making these > > > all static: > > > > > > net/core/filter.c:8465:31: warning: symbol 'sk_filter_verifier_ops' was not declared. Should it be static? > > > net/core/filter.c:8472:27: warning: symbol 'sk_filter_prog_ops' was not declared. Should it be static? > > [...] > > > net/core/filter.c:8935:27: warning: symbol 'sk_reuseport_prog_ops' was not declared. Should it be static? > > > > > > Signed-off-by: Ben Dooks > > > --- > > > Cc: Alexei Starovoitov > > > Cc: Daniel Borkmann > > > Cc: Martin KaFai Lau > > > Cc: Song Liu > > > Cc: Yonghong Song > > > Cc: "David S. Miller" > > > Cc: Jakub Kicinski > > > Cc: Jesper Dangaard Brouer > > > Cc: John Fastabend > > > Cc: netdev@vger.kernel.org > > > Cc: bpf@vger.kernel.org > > > Cc: linux-kernel@vger.kernel.org > > > --- > > > net/core/filter.c | 60 +++++++++++++++++++++++------------------------ > > > 1 file changed, 30 insertions(+), 30 deletions(-) > > > > > > diff --git a/net/core/filter.c b/net/core/filter.c > > > index ed6563622ce3..f7338fee41f8 100644 > > > --- a/net/core/filter.c > > > +++ b/net/core/filter.c > > > @@ -8462,18 +8462,18 @@ static u32 sk_msg_convert_ctx_access(enum bpf_access_type type, > > > return insn - insn_buf; > > > } > > > -const struct bpf_verifier_ops sk_filter_verifier_ops = { > > > +static const struct bpf_verifier_ops sk_filter_verifier_ops = { > > > .get_func_proto = sk_filter_func_proto, > > > .is_valid_access = sk_filter_is_valid_access, > > > .convert_ctx_access = bpf_convert_ctx_access, > > > .gen_ld_abs = bpf_gen_ld_abs, > > > }; > > > > Big obvious NAK. I'm puzzled that you try to fix a compile warning, but without > > even bothering to compile the result after your patch ... > > builds fine. maybe some effort to stop this happening again should be made. It doesn't build, because they are used/needed outside: [...] CC net/core/dev_ioctl.o CC net/core/tso.o net/core/filter.c:8467:38: error: static declaration of ‘sk_filter_verifier_ops’ follows non-static declaration 8467 | static const struct bpf_verifier_ops sk_filter_verifier_ops = { | ^~~~~~~~~~~~~~~~~~~~~~ In file included from ./include/linux/bpf-cgroup.h:5, from ./include/linux/cgroup-defs.h:22, from ./include/linux/cgroup.h:28, from ./include/net/netprio_cgroup.h:11, from ./include/linux/netdevice.h:42, from ./include/net/sock.h:46, from ./include/linux/sock_diag.h:8, from net/core/filter.c:25: ./include/linux/bpf_types.h:5:44: note: previous declaration of ‘sk_filter_verifier_ops’ was here 5 | BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter) | ^~~~~~~~~ ./include/linux/bpf.h:625:39: note: in definition of macro ‘BPF_PROG_TYPE’ 625 | extern const struct bpf_verifier_ops _name ## _verifier_ops; | ^~~~~ [...] ( and more of the same errors ... )