linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 10527/16121] kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared
@ 2023-10-30 16:23 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-10-30 16:23 UTC (permalink / raw)
  To: Chuyi Zhou
  Cc: oe-kbuild-all, Linux Memory Management List, Alexei Starovoitov

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c503e3eec382ac708ee7adf874add37b77c5d312
commit: 9c66dc94b62aef23300f05f63404afb8990920b4 [10527/16121] bpf: Introduce css_task open-coded iterator kfuncs
config: xtensa-randconfig-001-20231030 (https://download.01.org/0day-ci/archive/20231031/202310310055.RDWloNPr-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231031/202310310055.RDWloNPr-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310310055.RDWloNPr-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new':
   kernel/bpf/task_iter.c:919:14: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function)
     919 |         case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
         |              ^~~~~~~~~~~~~~~~~~~
   kernel/bpf/task_iter.c:919:14: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function)
     919 |         case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
         |                                    ^~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/task_iter.c:927:60: error: invalid application of 'sizeof' to incomplete type 'struct css_task_iter'
     927 |         kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
         |                                                            ^~~~~~
>> kernel/bpf/task_iter.c:930:9: error: implicit declaration of function 'css_task_iter_start'; did you mean 'task_seq_start'? [-Werror=implicit-function-declaration]
     930 |         css_task_iter_start(css, flags, kit->css_it);
         |         ^~~~~~~~~~~~~~~~~~~
         |         task_seq_start
   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_next':
>> kernel/bpf/task_iter.c:940:16: error: implicit declaration of function 'css_task_iter_next'; did you mean 'class_dev_iter_next'? [-Werror=implicit-function-declaration]
     940 |         return css_task_iter_next(kit->css_it);
         |                ^~~~~~~~~~~~~~~~~~
         |                class_dev_iter_next
   kernel/bpf/task_iter.c:940:16: warning: returning 'int' from a function with return type 'struct task_struct *' makes pointer from integer without a cast [-Wint-conversion]
     940 |         return css_task_iter_next(kit->css_it);
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_destroy':
>> kernel/bpf/task_iter.c:949:9: error: implicit declaration of function 'css_task_iter_end' [-Werror=implicit-function-declaration]
     949 |         css_task_iter_end(kit->css_it);
         |         ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/CSS_TASK_ITER_THREADED +919 kernel/bpf/task_iter.c

   904	
   905	__diag_push();
   906	__diag_ignore_all("-Wmissing-prototypes",
   907			  "Global functions as their definitions will be in vmlinux BTF");
   908	
   909	__bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
   910			struct cgroup_subsys_state *css, unsigned int flags)
   911	{
   912		struct bpf_iter_css_task_kern *kit = (void *)it;
   913	
   914		BUILD_BUG_ON(sizeof(struct bpf_iter_css_task_kern) != sizeof(struct bpf_iter_css_task));
   915		BUILD_BUG_ON(__alignof__(struct bpf_iter_css_task_kern) !=
   916						__alignof__(struct bpf_iter_css_task));
   917		kit->css_it = NULL;
   918		switch (flags) {
 > 919		case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
   920		case CSS_TASK_ITER_PROCS:
   921		case 0:
   922			break;
   923		default:
   924			return -EINVAL;
   925		}
   926	
 > 927		kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
   928		if (!kit->css_it)
   929			return -ENOMEM;
 > 930		css_task_iter_start(css, flags, kit->css_it);
   931		return 0;
   932	}
   933	
   934	__bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
   935	{
   936		struct bpf_iter_css_task_kern *kit = (void *)it;
   937	
   938		if (!kit->css_it)
   939			return NULL;
 > 940		return css_task_iter_next(kit->css_it);
   941	}
   942	
   943	__bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
   944	{
   945		struct bpf_iter_css_task_kern *kit = (void *)it;
   946	
   947		if (!kit->css_it)
   948			return;
 > 949		css_task_iter_end(kit->css_it);
   950		bpf_mem_free(&bpf_global_ma, kit->css_it);
   951	}
   952	

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-30 16:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-30 16:23 [linux-next:master 10527/16121] kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox