Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2505355rwb; Fri, 11 Nov 2022 10:12:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MADVF+gPpMcxPekor2ZtIlkVPxMKnY3+aMGOYW95lAGdgPFsPEYIQUagEjPGWPGiGItM4 X-Received: by 2002:a17:902:b10b:b0:186:fb90:5774 with SMTP id q11-20020a170902b10b00b00186fb905774mr3531048plr.137.1668190321186; Fri, 11 Nov 2022 10:12:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668190321; cv=none; d=google.com; s=arc-20160816; b=cbpIPfngTCGg84xhj31sZrAc9RdkfOIzMFYyAE9HnLzn/8Sm+0MBkqRAXxuCSosDhn HaGePII164x5Z9TTxLHQ2iSjcR+1JSGvdgUs6dHiyAeml1I12wTNjFRiTcMoEBcNe4b6 WKFrfK4eDdJL7jhrny8XrvHtUPFZiLrTVY47CF3luZiwTCMP+ljzjUYhzXvETdLPFO1Y wCZGFpoSP7fWcPn13TBZjRK0Y+trV1RqFZlX6Ppn9QkL5N2fvvdjDgzO3zfSBvHBzSAt 8+2TY1AZqqGKHOdF3JoJkXvpMEaBPVbPMlszKE95DBYQZm1lDunjG5+YiMHbrKpHKm/4 grGg== 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=qm1KugBB8vQ7RxIWRqzqfo1O+lG3f9UIS7VrPG5kGak=; b=DdOLK8Bm9sIFI+gOmDYVUn6fSFiAxr7ilSLYReaG2YtofGITRNQwc6AMLVl9nMt+m5 yRxURnHXKmnp/t1pfh/mndbE54O+5s9PM1BAYUUkU6MS90qVXWQeSaNEI/xGzlgK4B7y YUs3ZatnD72KjjphGzh2tbytBHsqGLo8aD1HmTM8oS4joX7PeruR565fVOcs7QpNed4U jDbYJq0CJ3D9IoLvcD3cq77I4SZKWAEA6g+JwZeMI6KrcNVCsTZD7sZdgGvserx29gFI tnm+YcDmGnK2ZEqsQdjdQhphsomEgeq+UqiyLpbViuTmmf25lLD9ABOQ1RWBxYzLgNm5 k/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ayj0kwZT; 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 bd9-20020a056a00278900b0056e2b0193bdsi3209750pfb.141.2022.11.11.10.11.48; Fri, 11 Nov 2022 10:12:01 -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=ayj0kwZT; 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 S233907AbiKKRy0 (ORCPT + 90 others); Fri, 11 Nov 2022 12:54:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbiKKRyZ (ORCPT ); Fri, 11 Nov 2022 12:54:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11628DE90; Fri, 11 Nov 2022 09:54:23 -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 752B7B826AA; Fri, 11 Nov 2022 17:54:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8536CC433D6; Fri, 11 Nov 2022 17:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668189261; bh=PKJPaIOgDW5uqG2gedKa2Ua6yA1OebpqOraZ3Ok0JaA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ayj0kwZTRWcDBKsLXLi7CimQafyMHSGNuL/1WTYX4Rdh34Y4+6Ghhys7g162ogurE UzVezODXJuCq5jby0sWZjjg5TSwvglEVjkyIZr33EyAA2IpEfmyNjyzFAbnDMTTYsc wbZ2i8DkidmDfl07LsAVIsvvi005e5YTmmjRcAvhxZ2XBdOppih9TzfLVY64kIwIkl 51MA+kECriuSr19m0fNiQqTHOP6HOcZyzL1RMJ3XUCw8GW8YUSb2KV7t3Pol/HbctQ /CbjEmPYRu/+l40FqtiGMmebGaeHW6C1gaB9Cd9aEAZ0vMWew115wB+pFtW3nwlTVK Muplud1IdO+oQ== Date: Fri, 11 Nov 2022 18:54:17 +0100 From: Lorenzo Bianconi To: sdf@google.com 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="spvS383o4CqWiEAy" 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 --spvS383o4CqWiEAy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On 11/11, Rong Tao wrote: > > From: Rong Tao >=20 > > commit 472caa69183f("netfilter: nat: un-export nf_nat_used_tuple") > > introduce NF_NAT_MANIP_SRC/DST enum in include/net/netfilter/nf_nat.h, > > and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_nat_in= fo > > 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. >=20 > > How to reproduce the error: >=20 > > $ 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_SRC); > > ^ > > error: use of undeclared identifier 'NF_NAT_MANIP_DST' > > bpf_ct_set_nat_info(ct, &daddr, dport, NF_NAT_MANIP_DST); > > ^ > > 2 errors generated. >=20 > $ grep NF_NAT_MANIP_SRC > ./tools/testing/selftests/bpf/tools/include/vmlinux.h > NF_NAT_MANIP_SRC =3D 0, >=20 > Doesn't look like your kernel config compiles netfilter nat modules? yes, in bpf kself-test config (tools/testing/selftests/bpf/config) nf_nat is compiled as built-in. This issue occurs just if it is compiled as module. Regards, Lorenzo >=20 > > 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(+) >=20 > > 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 >=20 > > +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 >=20 --spvS383o4CqWiEAy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY26MSQAKCRA6cBh0uS2t rLElAP9pPBWUXclDPJGbSNpyrM4V88sp2TfBB253Ro32lDa5iQD9FgiwFywB44z3 TxNXrDkcdn1g8qBiTzEx2EeRDXP04Ao= =Q86U -----END PGP SIGNATURE----- --spvS383o4CqWiEAy--