[openeuler:OLK-6.6 3083/3083] net/core/filter.c:12101:17: sparse: sparse: symbol 'bpf_xdp_change_dev' was not declared. Should it be static?
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 5394cae209c4a4990d81be436ba17ae56fb09d16 commit: 94ac90c1b608e26cfd82703606d5e13667983b96 [3083/3083] bpf: Add bpf_*_change_dev kfunc config: x86_64-randconfig-123-20251103 (https://download.01.org/0day-ci/archive/20251103/202511030954.SJ0Hsr2z-lkp@i...) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251103/202511030954.SJ0Hsr2z-lkp@i...) 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/202511030954.SJ0Hsr2z-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) net/core/filter.c:1416: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:1416:39: sparse: expected struct sock_filter const *filter net/core/filter.c:1416:39: sparse: got struct sock_filter [noderef] __user *filter net/core/filter.c:1494: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:1494:39: sparse: expected struct sock_filter const *filter net/core/filter.c:1494:39: sparse: got struct sock_filter [noderef] __user *filter net/core/filter.c:2325:45: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be32 [usertype] daddr @@ got unsigned int [usertype] ipv4_nh @@ net/core/filter.c:2325:45: sparse: expected restricted __be32 [usertype] daddr net/core/filter.c:2325:45: sparse: got unsigned int [usertype] ipv4_nh
net/core/filter.c:12101:17: sparse: sparse: symbol 'bpf_xdp_change_dev' was not declared. Should it be static? net/core/filter.c:1931: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:1931:43: sparse: expected restricted __wsum [usertype] diff net/core/filter.c:1931:43: sparse: got unsigned long long [usertype] to net/core/filter.c:1934: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:1934:36: sparse: expected restricted __be16 [usertype] old net/core/filter.c:1934:36: sparse: got unsigned long long [usertype] from net/core/filter.c:1934: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:1934:42: sparse: expected restricted __be16 [usertype] new net/core/filter.c:1934:42: sparse: got unsigned long long [usertype] to net/core/filter.c:1937: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:1937:36: sparse: expected restricted __be32 [usertype] from net/core/filter.c:1937:36: sparse: got unsigned long long [usertype] from net/core/filter.c:1937: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:1937:42: sparse: expected restricted __be32 [usertype] to net/core/filter.c:1937:42: sparse: got unsigned long long [usertype] to net/core/filter.c:1982: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:1982:59: sparse: expected restricted __wsum [usertype] diff net/core/filter.c:1982:59: sparse: got unsigned long long [usertype] to net/core/filter.c:1985: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:1985:52: sparse: expected restricted __be16 [usertype] from net/core/filter.c:1985:52: sparse: got unsigned long long [usertype] from net/core/filter.c:1985: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:1985:58: sparse: expected restricted __be16 [usertype] to net/core/filter.c:1985:58: sparse: got unsigned long long [usertype] to net/core/filter.c:1988: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:1988:52: sparse: expected restricted __be32 [usertype] from net/core/filter.c:1988:52: sparse: got unsigned long long [usertype] from net/core/filter.c:1988: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:1988:58: sparse: expected restricted __be32 [usertype] to net/core/filter.c:1988:58: sparse: got unsigned long long [usertype] to net/core/filter.c:2034:28: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned long long @@ got restricted __wsum @@ net/core/filter.c:2034:28: sparse: expected unsigned long long net/core/filter.c:2034:28: sparse: got restricted __wsum net/core/filter.c:2056:35: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned long long @@ got restricted __wsum [usertype] csum @@ net/core/filter.c:2056:35: sparse: expected unsigned long long net/core/filter.c:2056:35: sparse: got restricted __wsum [usertype] csum net/core/filter.c:5895:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] spi @@ got restricted __be32 const [usertype] spi @@ net/core/filter.c:5895:17: sparse: expected unsigned int [usertype] spi net/core/filter.c:5895:17: sparse: got restricted __be32 const [usertype] spi net/core/filter.c:5903:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] remote_ipv4 @@ got restricted __be32 const [usertype] a4 @@ net/core/filter.c:5903:33: sparse: expected unsigned int [usertype] remote_ipv4 net/core/filter.c:5903:33: sparse: got restricted __be32 const [usertype] a4
vim +/bpf_xdp_change_dev +12101 net/core/filter.c 12100 12101 __bpf_kfunc int bpf_xdp_change_dev(struct xdp_md *xdp_ctx, u32 ifindex) 12102 { 12103 struct xdp_buff *xdp = (struct xdp_buff *)xdp_ctx; 12104 struct hisock_xdp_buff *hxdp = (void *)xdp; 12105 struct net_device *dev; 12106 12107 WARN_ON_ONCE(!rcu_read_lock_held()); 12108 12109 if (!hxdp->skb) 12110 return -EOPNOTSUPP; 12111 12112 dev = dev_get_by_index_rcu(&init_net, ifindex); 12113 if (!dev) 12114 return -ENODEV; 12115 12116 hxdp->skb->dev = dev; 12117 return 0; 12118 } 12119 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot