Messages in this thread | | | Date | Fri, 11 Mar 2022 20:09:58 +0800 | From | kernel test robot <> | Subject | [toke:xdp-queueing-03 7/9] net/core/filter.c:9727:5: warning: no previous prototype for 'dequeue_btf_struct_access' |
| |
tree: https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git xdp-queueing-03 head: 91c92d46077f70b03fd162128dd3373663d529d4 commit: 9bae1dad48ccbee1a035d242a407ea54a29ae2c9 [7/9] bpf: Enable direct packet access for dequeue packets config: arc-buildonly-randconfig-r002-20220310 (https://download.01.org/0day-ci/archive/20220311/202203112035.kNSbLE5J-lkp@intel.com/config) compiler: arceb-elf-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=9bae1dad48ccbee1a035d242a407ea54a29ae2c9 git remote add toke https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git git fetch --no-tags toke xdp-queueing-03 git checkout 9bae1dad48ccbee1a035d242a407ea54a29ae2c9 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash net/core/
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> net/core/filter.c:9727:5: warning: no previous prototype for 'dequeue_btf_struct_access' [-Wmissing-prototypes] 9727 | int dequeue_btf_struct_access(struct bpf_verifier_log *log, | ^~~~~~~~~~~~~~~~~~~~~~~~~ net/core/filter.c: In function 'dequeue_btf_struct_access': net/core/filter.c:9736:14: error: implicit declaration of function 'bpf_get_btf_vmlinux' [-Werror=implicit-function-declaration] 9736 | if (!bpf_get_btf_vmlinux() || btf != bpf_get_btf_vmlinux()) | ^~~~~~~~~~~~~~~~~~~ >> net/core/filter.c:9736:43: warning: comparison between pointer and integer 9736 | if (!bpf_get_btf_vmlinux() || btf != bpf_get_btf_vmlinux()) | ^~ >> net/core/filter.c:9744:35: warning: passing argument 1 of 'btf_type_by_id' makes pointer from integer without a cast [-Wint-conversion] 9744 | pkt_type = btf_type_by_id(bpf_get_btf_vmlinux(), xdp_md_btf_ids[0]); | ^~~~~~~~~~~~~~~~~~~~~ | | | int In file included from net/core/filter.c:50: include/linux/btf.h:348:71: note: expected 'const struct btf *' but argument is of type 'int' 348 | static inline const struct btf_type *btf_type_by_id(const struct btf *btf, | ~~~~~~~~~~~~~~~~~~^~~ net/core/filter.c:9748:24: error: implicit declaration of function 'btf_struct_access'; did you mean 'dequeue_btf_struct_access'? [-Werror=implicit-function-declaration] 9748 | return btf_struct_access(log, btf, t, off, size, atype, | ^~~~~~~~~~~~~~~~~ | dequeue_btf_struct_access net/core/filter.c: In function 'dequeue_get_convert_ctx_access': net/core/filter.c:9861:43: warning: comparison between pointer and integer 9861 | if (!bpf_get_btf_vmlinux() || btf != bpf_get_btf_vmlinux()) | ^~ cc1: some warnings being treated as errors
vim +/dequeue_btf_struct_access +9727 net/core/filter.c
9726 > 9727 int dequeue_btf_struct_access(struct bpf_verifier_log *log, 9728 const struct btf *btf, 9729 const struct btf_type *t, int off, int size, 9730 enum bpf_access_type atype, 9731 u32 *next_btf_id, enum bpf_type_flag *flag) 9732 { 9733 const struct btf_type *pkt_type; 9734 enum bpf_reg_type reg_type; 9735 > 9736 if (!bpf_get_btf_vmlinux() || btf != bpf_get_btf_vmlinux()) 9737 return -EINVAL; 9738 9739 if (atype != BPF_READ) { 9740 bpf_log(log, "only read is supported\n"); 9741 return -EACCES; 9742 } 9743 > 9744 pkt_type = btf_type_by_id(bpf_get_btf_vmlinux(), xdp_md_btf_ids[0]); 9745 if (!pkt_type) 9746 return -EINVAL; 9747 if (t != pkt_type) 9748 return btf_struct_access(log, btf, t, off, size, atype, 9749 next_btf_id, flag); 9750 9751 switch (off) { 9752 case offsetof(struct xdp_md, data): 9753 reg_type = PTR_TO_PACKET; 9754 break; 9755 case offsetof(struct xdp_md, data_meta): 9756 reg_type = PTR_TO_PACKET_META; 9757 break; 9758 case offsetof(struct xdp_md, data_end): 9759 reg_type = PTR_TO_PACKET_END; 9760 break; 9761 default: 9762 bpf_log(log, "only access to data, data_meta, and data_end allowed for xdp_md\n"); 9763 return -EACCES; 9764 } 9765 9766 if (!__is_valid_xdp_access(off, size)) { 9767 bpf_log(log, "invalid xdp_md access off=%d size=%d\n", off, size); 9768 return -EINVAL; 9769 } 9770 return reg_type; 9771 } 9772
--- 0-DAY CI Kernel Test Service https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
| |