Re: [PATCH bpf-next v4 2/8] bpf: Introduce css_task open-coded iterator kfuncs

From: kernel test robot
Date: Sat Oct 07 2023 - 10:41:13 EST


Hi Chuyi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url: https://github.com/intel-lab-lkp/linux/commits/Chuyi-Zhou/cgroup-Prepare-for-using-css_task_iter_-in-BPF/20231007-204750
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20231007124522.34834-3-zhouchuyi%40bytedance.com
patch subject: [PATCH bpf-next v4 2/8] bpf: Introduce css_task open-coded iterator kfuncs
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231007/202310072246.OfAldQpf-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231007/202310072246.OfAldQpf-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/202310072246.OfAldQpf-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> kernel/bpf/task_iter.c:815:17: warning: no previous prototype for 'bpf_iter_css_task_new' [-Wmissing-prototypes]
815 | __bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
| ^~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/task_iter.c:840:33: warning: no previous prototype for 'bpf_iter_css_task_next' [-Wmissing-prototypes]
840 | __bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
| ^~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/task_iter.c:849:18: warning: no previous prototype for 'bpf_iter_css_task_destroy' [-Wmissing-prototypes]
849 | __bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
| ^~~~~~~~~~~~~~~~~~~~~~~~~


vim +/bpf_iter_css_task_new +815 kernel/bpf/task_iter.c

814
> 815 __bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
816 struct cgroup_subsys_state *css, unsigned int flags)
817 {
818 struct bpf_iter_css_task_kern *kit = (void *)it;
819
820 BUILD_BUG_ON(sizeof(struct bpf_iter_css_task_kern) != sizeof(struct bpf_iter_css_task));
821 BUILD_BUG_ON(__alignof__(struct bpf_iter_css_task_kern) !=
822 __alignof__(struct bpf_iter_css_task));
823 kit->css_it = NULL;
824 switch (flags) {
825 case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
826 case CSS_TASK_ITER_PROCS:
827 case 0:
828 break;
829 default:
830 return -EINVAL;
831 }
832
833 kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
834 if (!kit->css_it)
835 return -ENOMEM;
836 css_task_iter_start(css, flags, kit->css_it);
837 return 0;
838 }
839
> 840 __bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
841 {
842 struct bpf_iter_css_task_kern *kit = (void *)it;
843
844 if (!kit->css_it)
845 return NULL;
846 return css_task_iter_next(kit->css_it);
847 }
848
> 849 __bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
850 {
851 struct bpf_iter_css_task_kern *kit = (void *)it;
852
853 if (!kit->css_it)
854 return;
855 css_task_iter_end(kit->css_it);
856 bpf_mem_free(&bpf_global_ma, kit->css_it);
857 }
858

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