Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2605131rwb; Fri, 11 Nov 2022 11:47:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5KRU+LymD6T3ZmjzrlZF+JFlGvTaJOO8pDEeKN6Jz7S0UBRupB2qSULGFeWuepXliTEqJl X-Received: by 2002:a17:90a:9742:b0:213:2a:34c8 with SMTP id i2-20020a17090a974200b00213002a34c8mr3447447pjw.96.1668196032631; Fri, 11 Nov 2022 11:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668196032; cv=none; d=google.com; s=arc-20160816; b=XDH+oGgno62riJozBjIfRuX1cMGquyvffcqyu57KzfobpNK6aNUAnLNiNKh7mnuuh8 gZ372pw/NmTMiIYmIBJZ8NHhiEt6j7Mxbugpw9vQHoA9VsR508GEQ1RHgaWUAFy3DXTf fowWUq6YjYccBhd9RQNhNSujWvj83AXWsZQrcOZpWkSsCYCu6BcV3iVU4VV8Cxzhioic CMSjr/1RyKC8B8I4wTlE48Bbh1mEvYtjG3yWISg95R/XiCp4FzweDLA6klEvuad4kM4l sNlCOvuEQgRpyJeMPp6bfOfXxVw3Qjsqf7+yezEbsrowB+HiZxG7BJ6SXkW8bgupaC0B N07A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=g9eX0z58SKZAsOdWY7m+4OycDcrautiSe0xtp5Jr/YA=; b=k2R64J+HGH1gLEYyIg8cUf9Ods+9H5WcgH+0cjeoFdVhP9yG0ZVzqesNGC6Vh+8hiO oTDeCrYpsQJEtSyH3uNrg+2BlgTGq1EdiaSYjaBj065OZ2t/GRlS373kKz/yGQtUDePw qFon+g1rnFGRhh2EeWYIsCLnYqS28mh39WyQf+jkycfzfQk3J4T3MMTy3gcpRVub2N+8 4TqVIyTfb0P/OfcTeymhO2sNmXZ5QdfpNIOJHtb9YJ8F74/lMO6cUFCYwba6CxxdX/nE kB4USLiF8erObfKC1tq5FdLUwoscUzXJwzaA57SYtyDm6y/ME4SNBHz+vsKRfofgp/lW AveQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oBkyoNti; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a631c43000000b0045beac6749csi3182671pgm.633.2022.11.11.11.47.00; Fri, 11 Nov 2022 11:47:12 -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=@google.com header.s=20210112 header.b=oBkyoNti; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233225AbiKKSz2 (ORCPT + 91 others); Fri, 11 Nov 2022 13:55:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiKKSz0 (ORCPT ); Fri, 11 Nov 2022 13:55:26 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCAAA71F22 for ; Fri, 11 Nov 2022 10:55:25 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id g7so1288465ile.0 for ; Fri, 11 Nov 2022 10:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=g9eX0z58SKZAsOdWY7m+4OycDcrautiSe0xtp5Jr/YA=; b=oBkyoNti/n1H5DmNo5si5qEcD97KnH26ULsAv7/mh/gPF0I34K0iSx2MPU9UD9msZm OGWU3y4E2vepo7LW/uixh9h+9a92AbtaGcYsE1/LjAjOXmzCpzvh3pmBPWttCVExH/yf feeD9w1lk1m/pbK2qonPx/ctIIAYxGBHzYU6udBvP0y03PWol2GJBNV1HgVh6+oZjGEK SNJqvAdzsOZnmzyY/CR8tGtwXuJHbnVwSHCM4QqJRXM4ocObhIWDmVZZwsRl/gLI3mso +yKkXrnYTky4dY+fCjs0mZjcSZGlgSgVsw6+uxDkLuRJP5GQWH63URM3rN3hWmdNpy2d nO0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g9eX0z58SKZAsOdWY7m+4OycDcrautiSe0xtp5Jr/YA=; b=R5Cfi1dgGEjfm4N3bySKdmFuo2G6YYd42xdhlEgjjxVxxfZoSfADsHGvUETMqumvRa dVdqWnJq01N2nKzi7dPpFBl9EYLO/ptz800uZuMI1gBUL3o2hS3aqHPm/KOlfzdfRNsV CcnHKG3ejHA5dQAivDuYeBdzTOifJuTiV3q1X3dp3NNKKZbdf/DSjJl/Csi0BhQvnjiV dk7GBQrgYAMZgkGXC4UjRcY80MHGBtC8PGteC6PJLZ0E/YBoOfvh9xTTx2cbLeq42QEs OydTe9wjiY/TwDHzwoGcSr2eLCIgx6g/Lj+tjXaX86vVp6MZcO9Ov+qIpQsWfaQGg3CN C3iQ== X-Gm-Message-State: ANoB5pkUhUO1feILiWJF9408kpX45zJpgswAsJBKn8ARhlPuD4n16NjP Dow+Vc7QaIpyRQDsP8MSXiMwhOnj1BTPsMiboHP+5Q== X-Received: by 2002:a92:de41:0:b0:2ff:9e9f:6604 with SMTP id e1-20020a92de41000000b002ff9e9f6604mr1734778ilr.20.1668192925093; Fri, 11 Nov 2022 10:55:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Stanislav Fomichev Date: Fri, 11 Nov 2022 10:55:14 -0800 Message-ID: Subject: Re: [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC' To: Lorenzo Bianconi 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Nov 11, 2022 at 10:12 AM Lorenzo Bianconi wrote: > > > On Fri, Nov 11, 2022 at 9:54 AM Lorenzo Bianconi wrote: > > > > > > > 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.h, > > > > > and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_nat_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_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. > > > > > > > > $ grep NF_NAT_MANIP_SRC > > > > ./tools/testing/selftests/bpf/tools/include/vmlinux.h > > > > NF_NAT_MANIP_SRC = 0, > > > > > > > > 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. > > > > 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. And it will break the CI: $ grep NETFILTER tools/testing/selftests/bpf/config CONFIG_NETFILTER=y So yeah, not sure what to do here. The selftests expect "sane" configs (see that bpf/config above) which is not what the bot seems to be doing... > > > 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 > > > >