[alobakin:xdp_hints 5/52] net/bpf/prog_ops.c:693:6: error: redefinition of 'bpf_xdp_sock_is_valid_access'

From: kernel test robot
Date: Mon Jun 27 2022 - 19:01:05 EST


tree: https://github.com/alobakin/linux xdp_hints
head: bb2e21053c861694b01175cc7057b0ab05db75a9
commit: 9d29d62a53069847d538390eab0b7c8fcefdd178 [5/52] net, xdp: decouple XDP code from the core networking code
config: xtensa-randconfig-r024-20220627 (https://download.01.org/0day-ci/archive/20220628/202206280654.HfCop1BC-lkp@xxxxxxxxx/config)
compiler: xtensa-linux-gcc (GCC) 11.3.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://github.com/alobakin/linux/commit/9d29d62a53069847d538390eab0b7c8fcefdd178
git remote add alobakin https://github.com/alobakin/linux
git fetch --no-tags alobakin xdp_hints
git checkout 9d29d62a53069847d538390eab0b7c8fcefdd178
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=xtensa SHELL=/bin/bash net/bpf/

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

All errors (new ones prefixed by >>):

>> net/bpf/prog_ops.c:693:6: error: redefinition of 'bpf_xdp_sock_is_valid_access'
693 | bool bpf_xdp_sock_is_valid_access(int off, int size, enum bpf_access_type type,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/net/xdp_sock.h:9,
from net/bpf/prog_ops.c:5:
include/linux/bpf.h:2459:20: note: previous definition of 'bpf_xdp_sock_is_valid_access' with type 'bool(int, int, enum bpf_access_type, struct bpf_insn_access_aux *)' {aka '_Bool(int, int, enum bpf_access_type, struct bpf_insn_access_aux *)'}
2459 | static inline bool bpf_xdp_sock_is_valid_access(int off, int size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/bpf/prog_ops.c:708:5: error: redefinition of 'bpf_xdp_sock_convert_ctx_access'
708 | u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/net/xdp_sock.h:9,
from net/bpf/prog_ops.c:5:
include/linux/bpf.h:2466:19: note: previous definition of 'bpf_xdp_sock_convert_ctx_access' with type 'u32(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog *, u32 *)' {aka 'unsigned int(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog *, unsigned int *)'}
2466 | static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/bpf_xdp_sock_is_valid_access +693 net/bpf/prog_ops.c

692
> 693 bool bpf_xdp_sock_is_valid_access(int off, int size, enum bpf_access_type type,
694 struct bpf_insn_access_aux *info)
695 {
696 if (off < 0 || off >= offsetofend(struct bpf_xdp_sock, queue_id))
697 return false;
698
699 if (off % size != 0)
700 return false;
701
702 switch (off) {
703 default:
704 return size == sizeof(__u32);
705 }
706 }
707
> 708 u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
709 const struct bpf_insn *si,
710 struct bpf_insn *insn_buf,
711 struct bpf_prog *prog, u32 *target_size)
712 {
713 struct bpf_insn *insn = insn_buf;
714

--
0-DAY CI Kernel Test Service
https://01.org/lkp