Messages in this thread | | | Date | Fri, 27 May 2022 16:35:41 +0800 | From | kernel test robot <> | Subject | [congwang:sch_bpf 4/4] net/sched/sch_api.c:369:20: warning: assignment to 'struct tcf_chain *' from 'int' makes pointer from integer without a cast |
| |
tree: https://github.com/congwang/linux.git sch_bpf head: d7144f4291a2882e698a6d9d83f7e614d97be9c8 commit: d7144f4291a2882e698a6d9d83f7e614d97be9c8 [4/4] net_sched: introduce helper bpf_skb_tc_classify() config: mips-xway_defconfig (https://download.01.org/0day-ci/archive/20220527/202205271641.Dn0NkZ82-lkp@intel.com/config) compiler: mips-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/congwang/linux/commit/d7144f4291a2882e698a6d9d83f7e614d97be9c8 git remote add congwang https://github.com/congwang/linux.git git fetch --no-tags congwang sch_bpf git checkout d7144f4291a2882e698a6d9d83f7e614d97be9c8 # 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=mips SHELL=/bin/bash net/sched/
If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
net/sched/sch_api.c: In function '____bpf_skb_tc_classify': net/sched/sch_api.c:369:22: error: implicit declaration of function 'tcf_get_next_chain' [-Werror=implicit-function-declaration] 369 | for (chain = tcf_get_next_chain(block, NULL); | ^~~~~~~~~~~~~~~~~~ >> net/sched/sch_api.c:369:20: warning: assignment to 'struct tcf_chain *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 369 | for (chain = tcf_get_next_chain(block, NULL); | ^ net/sched/sch_api.c:371:20: warning: assignment to 'struct tcf_chain *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 371 | chain = tcf_get_next_chain(block, chain)) { | ^ cc1: some warnings being treated as errors
vim +369 net/sched/sch_api.c
334 335 BPF_CALL_3(bpf_skb_tc_classify, struct sk_buff *, skb, int, ifindex, u32, handle) 336 { 337 struct net *net = dev_net(skb->dev); 338 const struct Qdisc_class_ops *cops; 339 struct tcf_result res = {}; 340 struct tcf_block *block; 341 struct tcf_chain *chain; 342 struct net_device *dev; 343 unsigned long cl = 0; 344 struct Qdisc *q; 345 int result; 346 347 rcu_read_lock(); 348 dev = dev_get_by_index_rcu(net, ifindex); 349 if (!dev) 350 goto out; 351 q = qdisc_lookup_rcu(dev, handle); 352 if (!q) 353 goto out; 354 355 cops = q->ops->cl_ops; 356 if (!cops) 357 goto out; 358 if (!cops->tcf_block) 359 goto out; 360 if (TC_H_MIN(handle)) { 361 cl = cops->find(q, handle); 362 if (cl == 0) 363 goto out; 364 } 365 block = cops->tcf_block(q, cl, NULL); 366 if (!block) 367 goto out; 368 > 369 for (chain = tcf_get_next_chain(block, NULL); 370 chain; 371 chain = tcf_get_next_chain(block, chain)) { 372 struct tcf_proto *tp; 373 374 result = tcf_classify(skb, NULL, tp, &res, false); 375 if (result >= 0) { 376 #ifdef CONFIG_NET_CLS_ACT 377 switch (result) { 378 case TC_ACT_QUEUED: 379 case TC_ACT_STOLEN: 380 case TC_ACT_TRAP: 381 fallthrough; 382 case TC_ACT_SHOT: 383 rcu_read_unlock(); 384 return 0; 385 } 386 #endif 387 } 388 } 389 out: 390 rcu_read_unlock(); 391 return res.class; 392 } 393
-- 0-DAY CI Kernel Test Service https://01.org/lkp
| |