public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@meta.com>
To: kernel test robot <lkp@intel.com>, Yonghong Song <yhs@fb.com>,
	bpf@vger.kernel.org
Cc: kbuild-all@lists.01.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, KP Singh <kpsingh@kernel.org>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH bpf-next v2 2/6] bpf: Implement cgroup storage available to non-cgroup-attached bpf progs
Date: Fri, 21 Oct 2022 09:51:00 -0700	[thread overview]
Message-ID: <b31025c9-80da-86c6-ee2c-0c4acf5f2bff@meta.com> (raw)
In-Reply-To: <202210210932.nHqTyTmx-lkp@intel.com>



On 10/20/22 6:29 PM, kernel test robot wrote:
> Hi Yonghong,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on bpf-next/master]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Yonghong-Song/bpf-Implement-cgroup-local-storage-available-to-non-cgroup-attached-bpf-progs/20221021-061520
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> patch link:    https://lore.kernel.org/r/20221020221306.3554250-1-yhs%40fb.com
> patch subject: [PATCH bpf-next v2 2/6] bpf: Implement cgroup storage available to non-cgroup-attached bpf progs
> config: mips-randconfig-r021-20221019
> compiler: mipsel-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/444d94c5601ec8650f49598c284571e1bc81a43d
>          git remote add linux-review https://github.com/intel-lab-lkp/linux
>          git fetch --no-tags linux-review Yonghong-Song/bpf-Implement-cgroup-local-storage-available-to-non-cgroup-attached-bpf-progs/20221021-061520
>          git checkout 444d94c5601ec8650f49598c284571e1bc81a43d
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash kernel/bpf/
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>     kernel/bpf/bpf_cgrp_storage.c: In function 'cgroup_storage_ptr':
>>> kernel/bpf/bpf_cgrp_storage.c:43:19: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        43 |         return &cg->bpf_cgrp_storage;

I used CONFIG_CGROUP_BPF to guard this field in cgroup-defs.h.
But it is possible that CONFIG_CGROUPS=y and CONFIG_BPF_SYSCALL=y, but
CONFIG_CGROUP_BPF=n.
I will change to guard the bpf_cgrp_storage field in cgroup-defs.h
with CONFIG_BPF_SYSCALL=y and it should fix the issue.

>           |                   ^~
>     In file included from include/linux/workqueue.h:16,
>                      from include/linux/bpf.h:10,
>                      from kernel/bpf/bpf_cgrp_storage.c:7:
>     kernel/bpf/bpf_cgrp_storage.c: In function 'bpf_cgrp_storage_free':
>     kernel/bpf/bpf_cgrp_storage.c:55:47: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                                               ^~
>     include/linux/rcupdate.h:439:17: note: in definition of macro '__rcu_dereference_check'
>       439 |         typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>           |                 ^
>     include/linux/rcupdate.h:659:28: note: in expansion of macro 'rcu_dereference_check'
>       659 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
>           |                            ^~~~~~~~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:25: note: in expansion of macro 'rcu_dereference'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                         ^~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:47: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                                               ^~
>     include/linux/rcupdate.h:439:38: note: in definition of macro '__rcu_dereference_check'
>       439 |         typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>           |                                      ^
>     include/linux/rcupdate.h:659:28: note: in expansion of macro 'rcu_dereference_check'
>       659 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
>           |                            ^~~~~~~~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:25: note: in expansion of macro 'rcu_dereference'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                         ^~~~~~~~~~~~~~~
>     In file included from <command-line>:
>     kernel/bpf/bpf_cgrp_storage.c:55:47: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                                               ^~
>     include/linux/compiler_types.h:337:23: note: in definition of macro '__compiletime_assert'
>       337 |                 if (!(condition))                                       \
>           |                       ^~~~~~~~~
>     include/linux/compiler_types.h:357:9: note: in expansion of macro '_compiletime_assert'
>       357 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>           |         ^~~~~~~~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
>        36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
>           |         ^~~~~~~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
>        36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
>           |                            ^~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
>        49 |         compiletime_assert_rwonce_type(x);                              \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/rcupdate.h:439:50: note: in expansion of macro 'READ_ONCE'
>       439 |         typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>           |                                                  ^~~~~~~~~
>     include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_check'
>       587 |         __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/rcupdate.h:659:28: note: in expansion of macro 'rcu_dereference_check'
>       659 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
>           |                            ^~~~~~~~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:25: note: in expansion of macro 'rcu_dereference'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                         ^~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:47: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                                               ^~
>     include/linux/compiler_types.h:337:23: note: in definition of macro '__compiletime_assert'
>       337 |                 if (!(condition))                                       \
>           |                       ^~~~~~~~~
>     include/linux/compiler_types.h:357:9: note: in expansion of macro '_compiletime_assert'
>       357 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>           |         ^~~~~~~~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
>        36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
>           |         ^~~~~~~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
>        36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
>           |                            ^~~~~~~~~~~~~
>     include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
>        49 |         compiletime_assert_rwonce_type(x);                              \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/rcupdate.h:439:50: note: in expansion of macro 'READ_ONCE'
>       439 |         typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>           |                                                  ^~~~~~~~~
>     include/linux/rcupdate.h:587:9: note: in expansion of macro '__rcu_dereference_check'
>       587 |         __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
>           |         ^~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/rcupdate.h:659:28: note: in expansion of macro 'rcu_dereference_check'
>       659 | #define rcu_dereference(p) rcu_dereference_check(p, 0)
>           |                            ^~~~~~~~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:25: note: in expansion of macro 'rcu_dereference'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                         ^~~~~~~~~~~~~~~
>     kernel/bpf/bpf_cgrp_storage.c:55:47: error: 'struct cgroup' has no member named 'bpf_cgrp_storage'
>        55 |         local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
>           |                                               ^~
>     include/linux/compiler_types.h:337:23: note: in definition of macro '__compiletime_assert'
>       337 |                 if (!(condition))                                       \
>           |                       ^~~~~~~~~
>     include/linux/compiler_types.h:357:9: note: in expansion of macro '_compiletime_assert'
>       357 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>           |         ^~~~~~~~~~~~~~~~~~~
> 
> 
> vim +43 kernel/bpf/bpf_cgrp_storage.c
> 
>      38	
>      39	static struct bpf_local_storage __rcu **cgroup_storage_ptr(void *owner)
>      40	{
>      41		struct cgroup *cg = owner;
>      42	
>    > 43		return &cg->bpf_cgrp_storage;
>      44	}
>      45	
> 

  parent reply	other threads:[~2022-10-21 16:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 22:12 [PATCH bpf-next v2 0/6] bpf: Implement cgroup local storage available to non-cgroup-attached bpf progs Yonghong Song
2022-10-20 22:13 ` [PATCH bpf-next v2 1/6] bpf: Make struct cgroup btf id global Yonghong Song
2022-10-20 22:13 ` [PATCH bpf-next v2 2/6] bpf: Implement cgroup storage available to non-cgroup-attached bpf progs Yonghong Song
2022-10-21  5:22   ` David Vernet
2022-10-21  5:26     ` David Vernet
2022-10-21 17:33     ` Yonghong Song
2022-10-21 19:57       ` David Vernet
2022-10-21 22:57         ` Yonghong Song
2022-10-22  3:02           ` David Vernet
2022-10-23 16:45             ` Yonghong Song
2022-10-23 21:14               ` David Vernet
     [not found]   ` <202210210932.nHqTyTmx-lkp@intel.com>
2022-10-21 16:51     ` Yonghong Song [this message]
2022-10-21 19:29   ` Yosry Ahmed
2022-10-21 21:05     ` Yonghong Song
2022-10-20 22:13 ` [PATCH bpf-next v2 3/6] libbpf: Support new cgroup local storage Yonghong Song
2022-10-21 23:10   ` Andrii Nakryiko
2022-10-22  0:32     ` Yonghong Song
2022-10-22  1:05       ` Tejun Heo
2022-10-20 22:13 ` [PATCH bpf-next v2 4/6] bpftool: " Yonghong Song
2022-10-20 22:13 ` [PATCH bpf-next v2 5/6] selftests/bpf: Add selftests for " Yonghong Song
2022-10-20 22:13 ` [PATCH bpf-next v2 6/6] docs/bpf: Add documentation for map type BPF_MAP_TYPE_CGRP_STROAGE Yonghong Song
2022-10-21  7:12   ` David Vernet
2022-10-21 17:46     ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b31025c9-80da-86c6-ee2c-0c4acf5f2bff@meta.com \
    --to=yhs@meta.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=lkp@intel.com \
    --cc=martin.lau@kernel.org \
    --cc=tj@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox