From: kernel test robot <lkp@intel.com>
To: Xu Kuohai <xukuohai@huaweicloud.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
Jakub Sitnicki <jakub@cloudflare.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH bpf-next] bpf, sockmap: Rename sock_map_get_from_fd to sock_map_prog_attach
Date: Thu, 31 Aug 2023 19:10:07 +0800 [thread overview]
Message-ID: <202308311959.Snzn4Unt-lkp@intel.com> (raw)
In-Reply-To: <20230831014346.2931397-1-xukuohai@huaweicloud.com>
Hi Xu,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Xu-Kuohai/bpf-sockmap-Rename-sock_map_get_from_fd-to-sock_map_prog_attach/20230831-094551
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20230831014346.2931397-1-xukuohai%40huaweicloud.com
patch subject: [PATCH bpf-next] bpf, sockmap: Rename sock_map_get_from_fd to sock_map_prog_attach
config: parisc-randconfig-r012-20230831 (https://download.01.org/0day-ci/archive/20230831/202308311959.Snzn4Unt-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230831/202308311959.Snzn4Unt-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308311959.Snzn4Unt-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/bpf/syscall.c: In function 'bpf_prog_attach':
>> kernel/bpf/syscall.c:3825:23: error: implicit declaration of function 'sock_map_prog_attach'; did you mean 'sock_map_prog_detach'? [-Werror=implicit-function-declaration]
3825 | ret = sock_map_prog_attach(attr, prog);
| ^~~~~~~~~~~~~~~~~~~~
| sock_map_prog_detach
cc1: some warnings being treated as errors
vim +3825 kernel/bpf/syscall.c
3782
3783 #define BPF_F_ATTACH_MASK_BASE \
3784 (BPF_F_ALLOW_OVERRIDE | \
3785 BPF_F_ALLOW_MULTI | \
3786 BPF_F_REPLACE)
3787
3788 #define BPF_F_ATTACH_MASK_MPROG \
3789 (BPF_F_REPLACE | \
3790 BPF_F_BEFORE | \
3791 BPF_F_AFTER | \
3792 BPF_F_ID | \
3793 BPF_F_LINK)
3794
3795 static int bpf_prog_attach(const union bpf_attr *attr)
3796 {
3797 enum bpf_prog_type ptype;
3798 struct bpf_prog *prog;
3799 u32 mask;
3800 int ret;
3801
3802 if (CHECK_ATTR(BPF_PROG_ATTACH))
3803 return -EINVAL;
3804
3805 ptype = attach_type_to_prog_type(attr->attach_type);
3806 if (ptype == BPF_PROG_TYPE_UNSPEC)
3807 return -EINVAL;
3808 mask = bpf_mprog_supported(ptype) ?
3809 BPF_F_ATTACH_MASK_MPROG : BPF_F_ATTACH_MASK_BASE;
3810 if (attr->attach_flags & ~mask)
3811 return -EINVAL;
3812
3813 prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype);
3814 if (IS_ERR(prog))
3815 return PTR_ERR(prog);
3816
3817 if (bpf_prog_attach_check_attach_type(prog, attr->attach_type)) {
3818 bpf_prog_put(prog);
3819 return -EINVAL;
3820 }
3821
3822 switch (ptype) {
3823 case BPF_PROG_TYPE_SK_SKB:
3824 case BPF_PROG_TYPE_SK_MSG:
> 3825 ret = sock_map_prog_attach(attr, prog);
3826 break;
3827 case BPF_PROG_TYPE_LIRC_MODE2:
3828 ret = lirc_prog_attach(attr, prog);
3829 break;
3830 case BPF_PROG_TYPE_FLOW_DISSECTOR:
3831 ret = netns_bpf_prog_attach(attr, prog);
3832 break;
3833 case BPF_PROG_TYPE_CGROUP_DEVICE:
3834 case BPF_PROG_TYPE_CGROUP_SKB:
3835 case BPF_PROG_TYPE_CGROUP_SOCK:
3836 case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
3837 case BPF_PROG_TYPE_CGROUP_SOCKOPT:
3838 case BPF_PROG_TYPE_CGROUP_SYSCTL:
3839 case BPF_PROG_TYPE_SOCK_OPS:
3840 case BPF_PROG_TYPE_LSM:
3841 if (ptype == BPF_PROG_TYPE_LSM &&
3842 prog->expected_attach_type != BPF_LSM_CGROUP)
3843 ret = -EINVAL;
3844 else
3845 ret = cgroup_bpf_prog_attach(attr, ptype, prog);
3846 break;
3847 case BPF_PROG_TYPE_SCHED_CLS:
3848 ret = tcx_prog_attach(attr, prog);
3849 break;
3850 default:
3851 ret = -EINVAL;
3852 }
3853
3854 if (ret)
3855 bpf_prog_put(prog);
3856 return ret;
3857 }
3858
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2023-08-31 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 1:43 [PATCH bpf-next] bpf, sockmap: Rename sock_map_get_from_fd to sock_map_prog_attach Xu Kuohai
2023-08-31 2:09 ` John Fastabend
2023-08-31 2:21 ` Xu Kuohai
2023-08-31 11:10 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308311959.Snzn4Unt-lkp@intel.com \
--to=lkp@intel.com \
--cc=bpf@vger.kernel.org \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=xukuohai@huaweicloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.