[toke:xdp-queueing-01 1/9] net/core/filter.c:3992:31: error: implicit declaration of function 'pifo_map_enqueue'; did you mean 'cpu_map_enqueue'?

From: kernel test robot
Date: Thu Nov 11 2021 - 14:53:59 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git xdp-queueing-01
head: 7cdc645073a59261514e56e1a4c6d0dac1b24b32
commit: 181bc9e4a64cc89cae2fe5b0091ed328383ad40c [1/9] Add a PIFO map type for queueing packets
config: sparc-defconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git/commit/?id=181bc9e4a64cc89cae2fe5b0091ed328383ad40c
git remote add toke https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git
git fetch --no-tags toke xdp-queueing-01
git checkout 181bc9e4a64cc89cae2fe5b0091ed328383ad40c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

net/core/filter.c: In function 'xdp_do_redirect':
>> net/core/filter.c:3992:31: error: implicit declaration of function 'pifo_map_enqueue'; did you mean 'cpu_map_enqueue'? [-Werror=implicit-function-declaration]
3992 | err = pifo_map_enqueue(map, xdp, ri->tgt_index);
| ^~~~~~~~~~~~~~~~
| cpu_map_enqueue
cc1: some warnings being treated as errors


vim +3992 net/core/filter.c

3960
3961 int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
3962 struct bpf_prog *xdp_prog)
3963 {
3964 struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info);
3965 enum bpf_map_type map_type = ri->map_type;
3966 void *fwd = ri->tgt_value;
3967 u32 map_id = ri->map_id;
3968 struct bpf_map *map;
3969 int err;
3970
3971 ri->map_id = 0; /* Valid map id idr range: [1,INT_MAX[ */
3972 ri->map_type = BPF_MAP_TYPE_UNSPEC;
3973
3974 switch (map_type) {
3975 case BPF_MAP_TYPE_DEVMAP:
3976 fallthrough;
3977 case BPF_MAP_TYPE_DEVMAP_HASH:
3978 map = READ_ONCE(ri->map);
3979 if (unlikely(map)) {
3980 WRITE_ONCE(ri->map, NULL);
3981 err = dev_map_enqueue_multi(xdp, dev, map,
3982 ri->flags & BPF_F_EXCLUDE_INGRESS);
3983 } else {
3984 err = dev_map_enqueue(fwd, xdp, dev);
3985 }
3986 break;
3987 case BPF_MAP_TYPE_PIFO:
3988 map = READ_ONCE(ri->map);
3989 if (unlikely(!map))
3990 err = -EINVAL;
3991 else
> 3992 err = pifo_map_enqueue(map, xdp, ri->tgt_index);
3993 break;
3994 case BPF_MAP_TYPE_CPUMAP:
3995 err = cpu_map_enqueue(fwd, xdp, dev);
3996 break;
3997 case BPF_MAP_TYPE_XSKMAP:
3998 err = __xsk_map_redirect(fwd, xdp);
3999 break;
4000 case BPF_MAP_TYPE_UNSPEC:
4001 if (map_id == INT_MAX) {
4002 fwd = dev_get_by_index_rcu(dev_net(dev), ri->tgt_index);
4003 if (unlikely(!fwd)) {
4004 err = -EINVAL;
4005 break;
4006 }
4007 err = dev_xdp_enqueue(fwd, xdp, dev);
4008 break;
4009 }
4010 fallthrough;
4011 default:
4012 err = -EBADRQC;
4013 }
4014
4015 if (unlikely(err))
4016 goto err;
4017
4018 _trace_xdp_redirect_map(dev, xdp_prog, fwd, map_type, map_id, ri->tgt_index);
4019 return 0;
4020 err:
4021 _trace_xdp_redirect_map_err(dev, xdp_prog, fwd, map_type, map_id, ri->tgt_index, err);
4022 return err;
4023 }
4024 EXPORT_SYMBOL_GPL(xdp_do_redirect);
4025

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip