Re: [PATCH net-next 15/24] net: Use nested-BH locking for XDP redirect.

From: kernel test robot
Date: Fri Dec 15 2023 - 23:13:23 EST


Hi Sebastian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/Sebastian-Andrzej-Siewior/locking-local_lock-Introduce-guard-definition-for-local_lock/20231216-011911
base: net-next/main
patch link: https://lore.kernel.org/r/20231215171020.687342-16-bigeasy%40linutronix.de
patch subject: [PATCH net-next 15/24] net: Use nested-BH locking for XDP redirect.
config: x86_64-randconfig-122-20231216 (https://download.01.org/0day-ci/archive/20231216/202312161103.iKeGoacH-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231216/202312161103.iKeGoacH-lkp@xxxxxxxxx/reproduce)

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312161103.iKeGoacH-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
net/sched/cls_api.c:391:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] protocol @@ got unsigned int [usertype] protocol @@
net/sched/cls_api.c:391:22: sparse: expected restricted __be16 [usertype] protocol
net/sched/cls_api.c:391:22: sparse: got unsigned int [usertype] protocol
net/sched/cls_api.c:1862:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/cls_api.c:1862:16: sparse: struct tcf_proto *
net/sched/cls_api.c:1862:16: sparse: struct tcf_proto [noderef] __rcu *
net/sched/cls_api.c:1962:20: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/cls_api.c:1962:20: sparse: struct tcf_proto [noderef] __rcu *
net/sched/cls_api.c:1962:20: sparse: struct tcf_proto *
net/sched/cls_api.c:1924:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/cls_api.c:1924:25: sparse: struct tcf_proto [noderef] __rcu *
net/sched/cls_api.c:1924:25: sparse: struct tcf_proto *
net/sched/cls_api.c:1944:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/cls_api.c:1944:16: sparse: struct tcf_proto *
net/sched/cls_api.c:1944:16: sparse: struct tcf_proto [noderef] __rcu *
net/sched/cls_api.c:2010:25: sparse: sparse: restricted __be16 degrades to integer
net/sched/cls_api.c:2697:50: sparse: sparse: restricted __be16 degrades to integer
>> net/sched/cls_api.c:3933:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct local_lock_t [usertype] *l @@ got struct local_lock_t [noderef] __percpu * @@
net/sched/cls_api.c:3933:38: sparse: expected struct local_lock_t [usertype] *l
net/sched/cls_api.c:3933:38: sparse: got struct local_lock_t [noderef] __percpu *
net/sched/cls_api.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...):
include/linux/local_lock.h:71:1: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct local_lock_t [usertype] * @@
include/linux/local_lock.h:71:1: sparse: expected void const [noderef] __percpu *__vpp_verify
include/linux/local_lock.h:71:1: sparse: got struct local_lock_t [usertype] *

vim +3933 net/sched/cls_api.c

3921
3922 struct sk_buff *tcf_qevent_handle(struct tcf_qevent *qe, struct Qdisc *sch, struct sk_buff *skb,
3923 struct sk_buff **to_free, int *ret)
3924 {
3925 struct tcf_result cl_res;
3926 struct tcf_proto *fl;
3927
3928 if (!qe->info.block_index)
3929 return skb;
3930
3931 fl = rcu_dereference_bh(qe->filter_chain);
3932
> 3933 guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock);
3934 switch (tcf_classify(skb, NULL, fl, &cl_res, false)) {
3935 case TC_ACT_SHOT:
3936 qdisc_qstats_drop(sch);
3937 __qdisc_drop(skb, to_free);
3938 *ret = __NET_XMIT_BYPASS;
3939 return NULL;
3940 case TC_ACT_STOLEN:
3941 case TC_ACT_QUEUED:
3942 case TC_ACT_TRAP:
3943 __qdisc_drop(skb, to_free);
3944 *ret = __NET_XMIT_STOLEN;
3945 return NULL;
3946 case TC_ACT_REDIRECT:
3947 skb_do_redirect(skb);
3948 *ret = __NET_XMIT_STOLEN;
3949 return NULL;
3950 }
3951
3952 return skb;
3953 }
3954 EXPORT_SYMBOL(tcf_qevent_handle);
3955

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki