[congwang:sch_bpf 6/7] net/core/filter.c:10694:31: sparse: sparse: symbol 'tc_qdisc_verifier_ops' was not declared. Should it be static?

From: kernel test robot
Date: Sun Jul 24 2022 - 19:39:47 EST


tree: https://github.com/congwang/linux.git sch_bpf
head: 0be7ca64fe67b71e74518da3e635ccd8d67e01ac
commit: 0bec1c7a1a13130703df8fdaf637f22901b0a99e [6/7] net_sched: introduce eBPF based Qdisc
config: arm64-randconfig-s032-20220724 (https://download.01.org/0day-ci/archive/20220725/202207250703.q4wpPOoI-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/congwang/linux/commit/0bec1c7a1a13130703df8fdaf637f22901b0a99e
git remote add congwang https://github.com/congwang/linux.git
git fetch --no-tags congwang sch_bpf
git checkout 0bec1c7a1a13130703df8fdaf637f22901b0a99e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash net/core/

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

sparse warnings: (new ones prefixed by >>)
net/core/filter.c:5980:9: sparse: sparse: switch with no cases
net/core/filter.c:6021:9: sparse: sparse: switch with no cases
net/core/filter.c:1411:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sock_filter const *filter @@ got struct sock_filter [noderef] __user *filter @@
net/core/filter.c:1411:39: sparse: expected struct sock_filter const *filter
net/core/filter.c:1411:39: sparse: got struct sock_filter [noderef] __user *filter
net/core/filter.c:1489:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sock_filter const *filter @@ got struct sock_filter [noderef] __user *filter @@
net/core/filter.c:1489:39: sparse: expected struct sock_filter const *filter
net/core/filter.c:1489:39: sparse: got struct sock_filter [noderef] __user *filter
net/core/filter.c:10671:31: sparse: sparse: symbol 'sk_filter_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10678:27: sparse: sparse: symbol 'sk_filter_prog_ops' was not declared. Should it be static?
net/core/filter.c:10682:31: sparse: sparse: symbol 'tc_cls_act_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10690:27: sparse: sparse: symbol 'tc_cls_act_prog_ops' was not declared. Should it be static?
>> net/core/filter.c:10694:31: sparse: sparse: symbol 'tc_qdisc_verifier_ops' was not declared. Should it be static?
>> net/core/filter.c:10702:27: sparse: sparse: symbol 'tc_qdisc_prog_ops' was not declared. Should it be static?
net/core/filter.c:10706:31: sparse: sparse: symbol 'xdp_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10717:31: sparse: sparse: symbol 'cg_skb_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10723:27: sparse: sparse: symbol 'cg_skb_prog_ops' was not declared. Should it be static?
net/core/filter.c:10727:31: sparse: sparse: symbol 'lwt_in_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10733:27: sparse: sparse: symbol 'lwt_in_prog_ops' was not declared. Should it be static?
net/core/filter.c:10737:31: sparse: sparse: symbol 'lwt_out_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10743:27: sparse: sparse: symbol 'lwt_out_prog_ops' was not declared. Should it be static?
net/core/filter.c:10747:31: sparse: sparse: symbol 'lwt_xmit_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10754:27: sparse: sparse: symbol 'lwt_xmit_prog_ops' was not declared. Should it be static?
net/core/filter.c:10758:31: sparse: sparse: symbol 'lwt_seg6local_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10764:27: sparse: sparse: symbol 'lwt_seg6local_prog_ops' was not declared. Should it be static?
net/core/filter.c:10768:31: sparse: sparse: symbol 'cg_sock_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10774:27: sparse: sparse: symbol 'cg_sock_prog_ops' was not declared. Should it be static?
net/core/filter.c:10777:31: sparse: sparse: symbol 'cg_sock_addr_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10783:27: sparse: sparse: symbol 'cg_sock_addr_prog_ops' was not declared. Should it be static?
net/core/filter.c:10786:31: sparse: sparse: symbol 'sock_ops_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10792:27: sparse: sparse: symbol 'sock_ops_prog_ops' was not declared. Should it be static?
net/core/filter.c:10795:31: sparse: sparse: symbol 'sk_skb_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10802:27: sparse: sparse: symbol 'sk_skb_prog_ops' was not declared. Should it be static?
net/core/filter.c:10805:31: sparse: sparse: symbol 'sk_msg_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10812:27: sparse: sparse: symbol 'sk_msg_prog_ops' was not declared. Should it be static?
net/core/filter.c:10815:31: sparse: sparse: symbol 'flow_dissector_verifier_ops' was not declared. Should it be static?
net/core/filter.c:10821:27: sparse: sparse: symbol 'flow_dissector_prog_ops' was not declared. Should it be static?
net/core/filter.c:1910:43: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __wsum [usertype] diff @@ got unsigned long long [usertype] to @@
net/core/filter.c:1910:43: sparse: expected restricted __wsum [usertype] diff
net/core/filter.c:1910:43: sparse: got unsigned long long [usertype] to
net/core/filter.c:1913:36: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be16 [usertype] old @@ got unsigned long long [usertype] from @@
net/core/filter.c:1913:36: sparse: expected restricted __be16 [usertype] old
net/core/filter.c:1913:36: sparse: got unsigned long long [usertype] from
net/core/filter.c:1913:42: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be16 [usertype] new @@ got unsigned long long [usertype] to @@
net/core/filter.c:1913:42: sparse: expected restricted __be16 [usertype] new
net/core/filter.c:1913:42: sparse: got unsigned long long [usertype] to
net/core/filter.c:1916:36: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be32 [usertype] from @@ got unsigned long long [usertype] from @@
net/core/filter.c:1916:36: sparse: expected restricted __be32 [usertype] from
net/core/filter.c:1916:36: sparse: got unsigned long long [usertype] from
net/core/filter.c:1916:42: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be32 [usertype] to @@ got unsigned long long [usertype] to @@
net/core/filter.c:1916:42: sparse: expected restricted __be32 [usertype] to
net/core/filter.c:1916:42: sparse: got unsigned long long [usertype] to
net/core/filter.c:1961:59: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __wsum [usertype] diff @@ got unsigned long long [usertype] to @@
net/core/filter.c:1961:59: sparse: expected restricted __wsum [usertype] diff
net/core/filter.c:1961:59: sparse: got unsigned long long [usertype] to
net/core/filter.c:1964:52: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be16 [usertype] from @@ got unsigned long long [usertype] from @@
net/core/filter.c:1964:52: sparse: expected restricted __be16 [usertype] from
net/core/filter.c:1964:52: sparse: got unsigned long long [usertype] from
net/core/filter.c:1964:58: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected restricted __be16 [usertype] to @@ got unsigned long long [usertype] to @@
net/core/filter.c:1964:58: sparse: expected restricted __be16 [usertype] to
net/core/filter.c:1964:58: sparse: got unsigned long long [usertype] to
net/core/filter.c:1967:52: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be32 [usertype] from @@ got unsigned long long [usertype] from @@
net/core/filter.c:1967:52: sparse: expected restricted __be32 [usertype] from
net/core/filter.c:1967:52: sparse: got unsigned long long [usertype] from
net/core/filter.c:1967:58: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected restricted __be32 [usertype] to @@ got unsigned long long [usertype] to @@
net/core/filter.c:1967:58: sparse: expected restricted __be32 [usertype] to
net/core/filter.c:1967:58: sparse: got unsigned long long [usertype] to
net/core/filter.c:2013:28: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned long long @@ got restricted __wsum @@
net/core/filter.c:2013:28: sparse: expected unsigned long long
net/core/filter.c:2013:28: sparse: got restricted __wsum
net/core/filter.c:2035:35: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned long long @@ got restricted __wsum [usertype] csum @@
net/core/filter.c:2035:35: sparse: expected unsigned long long
net/core/filter.c:2035:35: sparse: got restricted __wsum [usertype] csum

vim +/tc_qdisc_verifier_ops +10694 net/core/filter.c

10693
10694 const struct bpf_verifier_ops tc_qdisc_verifier_ops = {
10695 .get_func_proto = tc_qdisc_func_proto,
10696 .is_valid_access = tc_cls_act_is_valid_access,
10697 .convert_ctx_access = tc_cls_act_convert_ctx_access,
10698 .gen_prologue = tc_cls_act_prologue,
10699 .gen_ld_abs = bpf_gen_ld_abs,
10700 };
10701
10702 const struct bpf_prog_ops tc_qdisc_prog_ops = {
10703 .test_run = bpf_prog_test_run_skb,
10704 };
10705

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