Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2518860rwb; Fri, 11 Nov 2022 10:23:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fxLME+3WcKIJp1kgy+rXdpy28T7ft/ll9U4sqBbqL4jBr4rNx0VCbyljfHG+3S0GaAniV X-Received: by 2002:a63:5206:0:b0:41a:5a80:5f20 with SMTP id g6-20020a635206000000b0041a5a805f20mr2646595pgb.442.1668191011062; Fri, 11 Nov 2022 10:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668191011; cv=none; d=google.com; s=arc-20160816; b=jnfVDhMaVy0ianN5/U2mc/A+Y23+rVsqyJkuNzmTydHJbL06W8GaY9sDTZxwjIfk7K teqE+sp8XpJPPSw5Ll+Jx99k/bRqEb93rSxd5d1u4vRpDmLrqR/xVKpSILQs2ShbdhbZ F/DIdx/3x7qWI3q3pZNaCrZXOzf8SRfsxlbxl6qqU7s+0jz8mFAVcmKux3FxiQfRCcuw glHuA5JElttmF40LLV5WO+n87NUCvaj07R/eIxJIwd2sBi23ha1uDbdy6e8IOAuCwxD+ 3+sX18NCEqpybzL5+iBnjqmArA15OKmQHMDA68ufOe0zP0Gm9mvpak/gVKZ+UluS5XcD UOUA== 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:dkim-signature; bh=nomBkpUC8JnTlcwCIe3dPFRI27hnu1eZHTsHFcnnBJU=; b=IEmlPUo961IwyJXmkiBfih7ua55/uDLtlOl88GHv4ZF3jU6H7Clc9jphjTzmuDoyCv L0EgF8yAYRkHHozbULyzFD0JVoICxVQSWAjFPcFBVYcUHLY+OUHskGRi1S95i16nedRS HOMYcT+8Ns+GNi21f8YgG58rji5yTrEFMHVhMe7q7OklJE+Ao9MaYKdXw7NlwDANACZ5 2QtFtxZz53yJjYeP0bgE4BM+fdJAZKywQ8YEZPOP79U1P4qGl0VU219/VjwGhy8M2Eah m0RVj7OTelCsBpFNkauIMSBHfQdf+oBoKpqM9aNe/nWd/QWxY+YRdwI8AWZkAme3bfaR FHIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d3XWKd6t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a170902654500b00186c5eb0d7esi2850403pln.212.2022.11.11.10.23.19; Fri, 11 Nov 2022 10:23:31 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=d3XWKd6t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233980AbiKKSMt (ORCPT + 90 others); Fri, 11 Nov 2022 13:12:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231625AbiKKSMi (ORCPT ); Fri, 11 Nov 2022 13:12:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281AE63BAD; Fri, 11 Nov 2022 10:12:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D5B51B826C7; Fri, 11 Nov 2022 18:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6BABC433C1; Fri, 11 Nov 2022 18:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668190354; bh=8e/RTvJUsWMsttv0bdTCoFlXV86DjbvOcbtUwMf1f7k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d3XWKd6thOjnst/9+wq/TS2jqhP2vcPa/JozNYyKQogRn3AdbikTAKpCsXE/FeUJX gHh/skBHCQWafH0rJ63En89BRIbccbJWozf6NUdRe+luQ49pO4GNfw3iwDxfsoL4vH Gk85xDygOnofj2Fe8jVJs7DDQ0j8nlU4B32MzQC/brSNzQnUgRkjnxp/COsWVingWs J/1OiZgZBa+idXbvO0knhX5WFBYHlP/7tFXvRxpjyeAZZ5Nrf95bMxYX8fS/p7ZK9l m9I2ZClWXBgp6HnHCpdHumWTVSTTMOZi8+WUovsUMcb5o+1WbOOqfUnKNdxupWZKgs 8nEDGH6C405cA== Date: Fri, 11 Nov 2022 19:12:30 +0100 From: Lorenzo Bianconi To: Stanislav Fomichev Cc: Rong Tao , ast@kernel.org, Rong Tao , kernel test robot , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Kumar Kartikeya Dwivedi , Daniel Xu , "open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)" , "open list:KERNEL SELFTEST FRAMEWORK" , open list Subject: Re: [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC' Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RREGnsch0YAdzI4A" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 --RREGnsch0YAdzI4A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Fri, Nov 11, 2022 at 9:54 AM Lorenzo Bianconi wro= te: > > > > > On 11/11, Rong Tao wrote: > > > > From: Rong Tao > > > > > > > commit 472caa69183f("netfilter: nat: un-export nf_nat_used_tuple") > > > > introduce NF_NAT_MANIP_SRC/DST enum in include/net/netfilter/nf_nat= =2Eh, > > > > and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_na= t_info > > > > kfunc") use NF_NAT_MANIP_SRC/DST in test_bpf_nf.c. We copy enum > > > > nf_nat_manip_type to test_bpf_nf.c fix this error. > > > > > > > How to reproduce the error: > > > > > > > $ make -C tools/testing/selftests/bpf/ > > > > ... > > > > CLNG-BPF [test_maps] test_bpf_nf.bpf.o > > > > error: use of undeclared identifier 'NF_NAT_MANIP_SRC' > > > > bpf_ct_set_nat_info(ct, &saddr, sport, NF_NAT_MANIP_SR= C); > > > > ^ > > > > error: use of undeclared identifier 'NF_NAT_MANIP_DST' > > > > bpf_ct_set_nat_info(ct, &daddr, dport, NF_NAT_MANIP_DS= T); > > > > ^ > > > > 2 errors generated. > > > > > > $ grep NF_NAT_MANIP_SRC > > > ./tools/testing/selftests/bpf/tools/include/vmlinux.h > > > NF_NAT_MANIP_SRC =3D 0, > > > > > > Doesn't look like your kernel config compiles netfilter nat modules? > > > > yes, in bpf kself-test config (tools/testing/selftests/bpf/config) nf_n= at > > is compiled as built-in. This issue occurs just if it is compiled as mo= dule. >=20 > Right, but if we unconditionally define this enum, I think you'll > break the case where it's compiled as a built-in? > Since at least in my vmlinux.h I have all the defines and this test > includes vmlinux.h... yes, it is correct. >=20 > > Regards, > > Lorenzo > > > > > > > > > Link: https://lore.kernel.org/lkml/202210280447.STsT1gvq-lkp@intel.= com/ > > > > Reported-by: kernel test robot > > > > Signed-off-by: Rong Tao > > > > --- > > > > tools/testing/selftests/bpf/progs/test_bpf_nf.c | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > diff --git a/tools/testing/selftests/bpf/progs/test_bpf_nf.c > > > > b/tools/testing/selftests/bpf/progs/test_bpf_nf.c > > > > index 227e85e85dda..307ca166ff34 100644 > > > > --- a/tools/testing/selftests/bpf/progs/test_bpf_nf.c > > > > +++ b/tools/testing/selftests/bpf/progs/test_bpf_nf.c > > > > @@ -3,6 +3,11 @@ > > > > #include > > > > #include > > > > > > > +enum nf_nat_manip_type { > > > > + NF_NAT_MANIP_SRC, > > > > + NF_NAT_MANIP_DST > > > > +}; > > > > + > > > > #define EAFNOSUPPORT 97 > > > > #define EPROTO 71 > > > > #define ENONET 64 > > > > -- > > > > 2.31.1 > > > --RREGnsch0YAdzI4A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY26QjgAKCRA6cBh0uS2t rHk5AP4qKv4HeJgc4FhLgnxgdpQCBOm8g3Mc5xObRZcWvlHFqAD7BNeUFMwaLLfl TxvON7agcBk0KFLjb/YFnU10Zk8+GwQ= =Hrtv -----END PGP SIGNATURE----- --RREGnsch0YAdzI4A--