Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2473308rwb; Fri, 11 Nov 2022 09:45:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jhtDjZdf3xAebV5MVzps+aNPArJyXON9M81BNFHqQaXioj2ej99qu9m7f6NM37LBzwBKc X-Received: by 2002:a05:6402:3458:b0:458:b9f9:9fba with SMTP id l24-20020a056402345800b00458b9f99fbamr2502628edc.305.1668188725472; Fri, 11 Nov 2022 09:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668188725; cv=none; d=google.com; s=arc-20160816; b=WL0LAvWOpPF5G2RtZHTSkd4WdnsQR1mUUiCISN8OSOas9IuoBNlBNgHf2mlbeID5lR NX6m81AbZPT+8tCFCrJ5AmWufsQl7PWaoxfnhFT7IUk/N+u3wFCGzdTPGTyrCjtkExFq cNm0hEzz6hw/yAHHr9Ka54/Z5/iCRVyKc8zU/3LQl8Yv20bRGLv9iRPA+2tzguFxDn+P Cka9i6k6YZ5LAmdSnVzyKMFxc2IE0PA0V+pHCcTtnEjo8HxMJ6nlVjtBhGgRrIN7eJtA /Dl+7VUtMhimiaH/W3uvVNnpi3ctRwBNuC3hi6BDQYrrfUSkmm4gzexK6xp1RfcFXu+s 4MgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=imvO8YpZD2ZcmET02WP0sV4ZEd9lENVaToBwFuzRa9k=; b=u+R3dECzLKoNz5omf7YAsATN3QDfyuQ/yU+eaD0DltJfdZ+rt9xlAkbMvKK9cePdgC NixShOeu8n8A5XcdKUlzl51Ir0OGW2+kdd+nwnOJliLSUOLhL5nJ1ww7dyXCzZmwwnHQ Il/bNsJsSAbpqPFQou+B6Q/CtQyTuFOSNDVQjpSuZ16CoKO+bcpOx/pNWcmBuewkjakw 0qMEPMUvdTt2u0YbRl06TVfu4QDrU8B8sKyZeTVl+VwU61z/jDcZWnzzDn64Pzw/LKoI E0STiC6IE/3MkUZfUNd+CH75FeY/InL0CHU1KzJG0GlINN4PSz8PrVlpvLNqqrDwyxSj ZjJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pac3wqeY; 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 i9-20020a50d749000000b0045ccd2c9944si559936edj.233.2022.11.11.09.45.02; Fri, 11 Nov 2022 09:45:25 -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=pac3wqeY; 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 S233651AbiKKRZ1 (ORCPT + 91 others); Fri, 11 Nov 2022 12:25:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbiKKRZZ (ORCPT ); Fri, 11 Nov 2022 12:25:25 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1588510FCD for ; Fri, 11 Nov 2022 09:25:23 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id x16-20020a63b210000000b0045f5c1e18d0so2886915pge.0 for ; Fri, 11 Nov 2022 09:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=imvO8YpZD2ZcmET02WP0sV4ZEd9lENVaToBwFuzRa9k=; b=pac3wqeY16mNG6biNSvoWZoA1M2mFFakQ1O2/aHt7Lg9ZdYW7R5DwwInFCqa/x9aEg 5AxgSlU9fIeA4u/yD5TH728ZdaghJP+K2CBkJ2uFvkU+pc+nC4eip/uILhuD4ijLNyAw gB61YeQRpvaWUJe9189Sju54A6XpF2YQdnrDZPCb4K/86dMeHJCz2ElmtA/oC8OXELE0 1CziUg4hBDvc74U7yi6bMlVkJnbUCxTOkmEBGX0imwXn2GdXLFDTEbfvfeuUj/kVMu9+ 95fRaGLnL6/SRguRJhLXdT9Wwk2bb4DM3fkkZdcmOJ2JawfliBIdmkZKIVD1n0o2nBnB HwqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=imvO8YpZD2ZcmET02WP0sV4ZEd9lENVaToBwFuzRa9k=; b=LZqySk7uJNZS18mCLlZDhOqoATqUFoAFOa/4Ul0ifpS0JJMhjWy0Hip5mXJCIOydeI EJAjgwej0n9IBkgd5L8c4SHSrTqns7YHiPUEzrvzt+QQKPk6OR6+QLRFW99DIa6qzrDq nLoV4/6h8A2ktihiG8AhuFZkcV++c907EF0nZ5IrmZfslIU0Zm9t8gY0LTjxL/QimC/Y LEEfTmhvMoyyKsZlsAlgTpUUjk6Weyyrkx4gMkrLOPdacm7MC9LAwLxBuJ7DOkVXfk7r 3mK0dfyhL0hVzMhlCiB1IfbDMCR6Ufw9IpL4g6RXwzCQREsWayuNaCx9WcN7p9icVpyY 0d+g== X-Gm-Message-State: ANoB5plG6LIyDgkfEOJRyTYZ7gM6YyFSr1IJkmT0NNfn+zOSPvxwQ4rB D8IQYqV4SjAftut32dqUhPEnuBE= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a17:90a:4503:b0:200:2069:7702 with SMTP id u3-20020a17090a450300b0020020697702mr2956946pjg.239.1668187522509; Fri, 11 Nov 2022 09:25:22 -0800 (PST) Date: Fri, 11 Nov 2022 09:25:20 -0800 In-Reply-To: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC' From: sdf@google.com To: Rong Tao Cc: 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 , Lorenzo Bianconi , 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"; format=flowed; delsp=yes X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 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? > 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