Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2892512rwb; Mon, 19 Sep 2022 11:33:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7G0nbZi+2X7jX6FLvM0rdxtF3lqwxynv859Rt2K+MQO5CRG8dwX1Y8T7gl3I8t0XqXG7P6 X-Received: by 2002:a17:906:ef8c:b0:77c:7b35:8b04 with SMTP id ze12-20020a170906ef8c00b0077c7b358b04mr13140152ejb.573.1663612397203; Mon, 19 Sep 2022 11:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663612397; cv=none; d=google.com; s=arc-20160816; b=cpdBRbgf73F85tflHz8Cj9Srgh/F/GxJyESV85T6FArNOxE2Q/su6pMLNz94Ag0oCz 83KhCAFlKUKq5pzpbcpfnkD81r22jq5r5r2O71KE5EBpFz9QoKJmYfEBSL+7tTy3ebJq xOjZ29dDcLF1rqLKFstESmEwz+OulytpjL61SKM6GKthU2W2AA9SaLR8cMYwSVBWtU4p faMKg2d9TWMuaprsgmutA/G1W5tPHJboCNLIIkE+5t0uFRFCTzSP2a+x77ayhehC7vfn rJnR0LhKWeHUqXlU2BVotJQMIhKQRSQzIJeZjYfQKwkf/xX4jnzy/lXrh/SQiSxcSUzu EF0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=987LUrc4zQPtHVau80T7pZjc6IgipyocTtu77bLG6/g=; b=dN+1+/V1WHa31G2Q6qgJ5xVd6J3rUU/mB2WIyiq++9m3p98Eq5GAorQsfXDrIhd1Ol jS2xgbLqvwOsNMraDsJJIcn4dxrdwekfzNl7pvn5tjaOede4vJq6CqawXihQOeLpJZ6F KfUp06Ll2KaxLJv7/C6PaY8nSNE12ueumnzoWkJ1oENPk9vgHqe+Btv3Xxgyx4dsA6FP DeHXb06QycMMT2YeLGpZxaggWQEvy3U6t95NTcbGHmJ0GDmr8Cxc5EptmrMNvxaS4nIt X6BeSL5gQN0WVAS8Fw3OmEfBHOHLSf9pf1xa66hevrZdnMsN6r82aXJqlGgvqYlCesX6 p1Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=k34h2mW1; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=1Gm41UVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a056402500d00b00453f51948e6si4515287eda.153.2022.09.19.11.32.52; Mon, 19 Sep 2022 11:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=k34h2mW1; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=1Gm41UVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbiISSD0 (ORCPT + 99 others); Mon, 19 Sep 2022 14:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiISSDX (ORCPT ); Mon, 19 Sep 2022 14:03:23 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A864599C; Mon, 19 Sep 2022 11:03:21 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EF2C25C03D7; Mon, 19 Sep 2022 14:03:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 19 Sep 2022 14:03:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663610598; x=1663696998; bh=987LUrc4zQ PtHVau80T7pZjc6IgipyocTtu77bLG6/g=; b=k34h2mW1ChpGJS7VPbcoR55SmX lI9JlZPaFyet4658/jWi7lDmrqxDoM/LYsDisT2Uk+9dVSjQ3J39nuXAr1rGzkw5 6vk/CvInT0MgoSm644jRZDGKF79IbutEcgBcfAd5ROcDQGhL+FJ1A/5Y+lY/l+Hm BDLT6FT8wv2ZDq5+FSyoTfT7UMyPSwpWfsBvyEtDU2YCCliqGhFGr1lorvu9NlJ1 uq6+XCyAwbNOvzXUAEZ+ykw3L9jL3NtEth9yfmVNONaAl0gRMfv7PkM/KLd359nM sFM64XXDuNo15oS3EO0kfXz0Nqb8SlQvZ1VJUecDMKSPxU5Fa33Mi+7OWcEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663610598; x=1663696998; bh=987LUrc4zQPtHVau80T7pZjc6Igi pyocTtu77bLG6/g=; b=1Gm41UVhoHKB9WKRlHghT1PulnDbf30g7hBJeRpHiAZw C+XzNMuVP5y6vnClJitGNl4eMEazhtALy3mIanSznSSIR5yh/ms6IrqMnmeqx0m6 Mra6zmIih+qGFvNz5fnRIZ7kGB9XQkQwcSVsTXODaNFf70LD1IlDSwHcs4R08sP+ D3pCUaOnu795mRpBa/wH0QocFBABr5BEsSxR4x5pjDZHZFA0rghvVboigzS/NZlE dV1BvBRXREG2MvDSq+/p7XCgaeH93Zv9jX3iMdqRqGT+sSadtHj44syWrCopEUDM DtRe4GjD1VJ7YjbNgcnncuUo7+NmLdQBS0SoSVaMkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvjedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredt tddtvdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpeevuddugeeihfdtffehgffgudeggeegheetgfevhfekkeei leeuieejleekiedvgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Sep 2022 14:03:17 -0400 (EDT) Date: Mon, 19 Sep 2022 12:03:15 -0600 From: Daniel Xu To: Kumar Kartikeya Dwivedi Cc: Martin KaFai Lau , pablo@netfilter.org, fw@strlen.de, toke@kernel.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org Subject: Re: [PATCH bpf-next] bpf: Move nf_conn extern declarations to filter.h Message-ID: <20220919180315.n565ugbvzlxqgezq@kashmir.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_PDS_OTHER_BAD_TLD autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 16, 2022 at 10:35:03PM +0200, Kumar Kartikeya Dwivedi wrote: > On Fri, 16 Sept 2022 at 22:20, Martin KaFai Lau wrote: > > > > On 9/11/22 11:19 AM, Daniel Xu wrote: > > > We're seeing the following new warnings on netdev/build_32bit and > > > netdev/build_allmodconfig_warn CI jobs: > > > > > > ../net/core/filter.c:8608:1: warning: symbol > > > 'nf_conn_btf_access_lock' was not declared. Should it be static? > > > ../net/core/filter.c:8611:5: warning: symbol 'nfct_bsa' was not > > > declared. Should it be static? > > > > > > Fix by ensuring extern declaration is present while compiling filter.o. > > > > > > Signed-off-by: Daniel Xu > > > --- > > > include/linux/filter.h | 6 ++++++ > > > include/net/netfilter/nf_conntrack_bpf.h | 7 +------ > > > 2 files changed, 7 insertions(+), 6 deletions(-) > > > > > > diff --git a/include/linux/filter.h b/include/linux/filter.h > > > index 527ae1d64e27..96de256b2c8d 100644 > > > --- a/include/linux/filter.h > > > +++ b/include/linux/filter.h > > > @@ -567,6 +567,12 @@ struct sk_filter { > > > > > > DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key); > > > > > > +extern struct mutex nf_conn_btf_access_lock; > > > +extern int (*nfct_bsa)(struct bpf_verifier_log *log, const struct btf *btf, > > > + const struct btf_type *t, int off, int size, > > > + enum bpf_access_type atype, u32 *next_btf_id, > > > + enum bpf_type_flag *flag); > > > > Can it avoid leaking the nfct specific details like > > 'nf_conn_btf_access_lock' and the null checking on 'nfct_bsa' to > > filter.c? In particular, this code snippet in filter.c: > > > > mutex_lock(&nf_conn_btf_access_lock); > > if (nfct_bsa) > > ret = nfct_bsa(log, btf, ....); > > mutex_unlock(&nf_conn_btf_access_lock); > > > > > > Can the lock and null check be done as one function (eg. > > nfct_btf_struct_access()) in nf_conntrack_bpf.c and use it in filter.c > > instead? > > Don't think so, no. Because we want nf_conntrack to work as a module as well. > I was the one who suggested nf_conn specific names for now. There is > no other user of such module supplied > btf_struct_access callbacks yet, when one appears, we should instead > make registration of such callbacks properly generic (i.e. also > enforce it is only for module BTF ID etc.). > But that would be a lot of code without any users right now. > > > > > btw, 'bsa' stands for btf_struct_access? It is a bit too short to guess ;) > > > > Also, please add a Fixes tag. > > > > Agreed. Daniel, can you address the remaining two points from Martin and respin? Yes, will do. Thanks, Daniel