Skip to contentSkip to conversation

drivers/nvme/host/tcp.c:4464:2: error: implicit declaration of function 'bpf_struct_ops_for_each_prog'

PATCH kernel test robot 1 participant 1 message Nov 29

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://github.com/kkdwivedi/linux fermata
head:   71012f36d1d04ec653daeebbce8dccf19aeb205d
commit: c694ea706b13a2ae779cf45a14ae9bdf18c42296 [410/441] nvme-tcp: Let a struct_ops hold a request, its frame in the request
config: arc-randconfig-2200-20261129 (https://download.01.org/0day-ci/archive/20261129/[email protected]/config)
compiler: arc-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261129/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/nvme/host/tcp.c: In function 'bpf_nvme_tcp_ops_reg':

>> drivers/nvme/host/tcp.c:4464:2: error: implicit declaration of function 'bpf_struct_ops_for_each_prog' [-Werror=implicit-function-declaration]
    4464 |  bpf_struct_ops_for_each_prog(kdata, nvme_tcp_ext_first_prog, &prog);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/security.h:35,
                    from include/net/scm.h:9,
                    from include/linux/netlink.h:9,
                    from include/uapi/linux/neighbour.h:6,
                    from include/linux/netdevice.h:44,
                    from include/net/sock.h:46,
                    from drivers/nvme/host/tcp.c:16:
   drivers/nvme/host/tcp.c: In function 'nvme_tcp_exec_init':
   include/linux/bpf.h:2569:50: warning: statement with no effect [-Wunused-value]
    2569 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
         |                                                  ^~~~~~~~~~~~~~~~
   drivers/nvme/host/tcp.c:4802:6: note: in expansion of macro 'register_bpf_struct_ops'
    4802 |      register_bpf_struct_ops(&bpf_bpf_nvme_tcp_ops, bpf_nvme_tcp_ops))
         |      ^~~~~~~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/bpf_struct_ops_for_each_prog +4464 drivers/nvme/host/tcp.c

4453
4454 static int bpf_nvme_tcp_ops_reg(void *kdata, struct bpf_link *link)
4455 {
4456 struct nvme_tcp_ctrl *tctrl, *ctrl = NULL;
4457 struct bpf_nvme_tcp_ops *ops = kdata;
4458 const struct bpf_prog *prog = NULL;
4459 struct nvme_tcp_exec *exec;
4460 struct nvme_tcp_ext *ext;
4461 unsigned long index;
4462 int err = 0;
4463

> 4464		bpf_struct_ops_for_each_prog(kdata, nvme_tcp_ext_first_prog, &prog);

4465 if (!prog)
4466 return -EINVAL;
4467 mutex_lock(&nvme_tcp_ctrl_mutex);
4468 list_for_each_entry(tctrl, &nvme_tcp_ctrl_list, list) {
4469 if (tctrl->ctrl.instance == ops->ctrl &&
4470 nvme_ctrl_state(&tctrl->ctrl) < NVME_CTRL_DELETING) {
4471 ctrl = tctrl;
4472 break;
4473 }
4474 }
4475 if (!ctrl) {
4476 err = -ENODEV;
4477 goto unlock;
4478 }
4479 ext = kzalloc(struct_size(ext, execs, ctrl->nr_allocated_queues), GFP_KERNEL);
4480 if (!ext) {
4481 err = -ENOMEM;
4482 goto unlock;
4483 }
4484 ext->ops = ops;
4485 ext->ctrl = ctrl;
4486 ext->prog = prog;
4487 ext->held_max = ops->held_max ?: NVME_TCP_HELD_MAX;
4488 ext->held_bound = msecs_to_jiffies(ops->held_ms ?: NVME_TCP_HELD_MS);
4489 ext->nr_queues = ctrl->nr_allocated_queues;
4490
4491 mutex_lock(&nvme_tcp_exec_mutex);
4492 if (nvme_tcp_ext_locked()) {
4493 err = -EBUSY;
4494 } else {
4495 nvme_get_ctrl(&ctrl->ctrl);
4496 xa_for_each(&nvme_tcp_execs, index, exec)
4497 if (exec->queue->ctrl == ctrl)
4498 nvme_tcp_held_open(ext, exec);
4499 static_call_update(nvme_tcp_ext_arrive_call, prog->bpf_func);
4500 static_branch_inc(&nvme_tcp_ext_key);
4501 rcu_assign_pointer(nvme_tcp_ext, ext);
4502 }
4503 mutex_unlock(&nvme_tcp_exec_mutex);
4504 if (err)
4505 kfree(ext);
4506 unlock:
4507 mutex_unlock(&nvme_tcp_ctrl_mutex);
4508 return err;
4509 }
4510

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