From: kernel test robot <lkp@intel.com>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
andrii@kernel.org, kernel-team@meta.com,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH v4 bpf-next 4/8] bpf: implement number iterator
Date: Wed, 8 Mar 2023 23:52:47 +0800 [thread overview]
Message-ID: <202303082315.foifky6G-lkp@intel.com> (raw)
In-Reply-To: <20230308035416.2591326-5-andrii@kernel.org>
Hi Andrii,
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/Andrii-Nakryiko/bpf-factor-out-fetching-basic-kfunc-metadata/20230308-115539
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20230308035416.2591326-5-andrii%40kernel.org
patch subject: [PATCH v4 bpf-next 4/8] bpf: implement number iterator
config: i386-randconfig-a015-20230306 (https://download.01.org/0day-ci/archive/20230308/202303082315.foifky6G-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/19acf9ca01e2927a29d3235b3aa73598430dcb70
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andrii-Nakryiko/bpf-factor-out-fetching-basic-kfunc-metadata/20230308-115539
git checkout 19acf9ca01e2927a29d3235b3aa73598430dcb70
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash kernel/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303082315.foifky6G-lkp@intel.com/
All errors (new ones prefixed by >>):
>> kernel/bpf/bpf_iter.c:794:2: error: call to __compiletime_assert_395 declared with 'error' attribute: BUILD_BUG_ON failed: __alignof__(struct bpf_iter_num_kern) != __alignof__(struct bpf_iter_num)
BUILD_BUG_ON(__alignof__(struct bpf_iter_num_kern) != __alignof__(struct bpf_iter_num));
^
include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:399:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:387:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:380:4: note: expanded from macro '__compiletime_assert'
prefix ## suffix(); \
^
<scratch space>:74:1: note: expanded from here
__compiletime_assert_395
^
1 error generated.
vim +/error +794 kernel/bpf/bpf_iter.c
784
785 __diag_push();
786 __diag_ignore_all("-Wmissing-prototypes",
787 "Global functions as their definitions will be in vmlinux BTF");
788
789 __bpf_kfunc int bpf_iter_num_new(struct bpf_iter_num *it, int start, int end)
790 {
791 struct bpf_iter_num_kern *s = (void *)it;
792
793 BUILD_BUG_ON(sizeof(struct bpf_iter_num_kern) != sizeof(struct bpf_iter_num));
> 794 BUILD_BUG_ON(__alignof__(struct bpf_iter_num_kern) != __alignof__(struct bpf_iter_num));
795
796 BTF_TYPE_EMIT(struct btf_iter_num);
797
798 /* start == end is legit, it's an empty range and we'll just get NULL
799 * on first (and any subsequent) bpf_iter_num_next() call
800 */
801 if (start > end) {
802 s->cur = s->end = 0;
803 return -EINVAL;
804 }
805
806 /* avoid overflows, e.g., if start == INT_MIN and end == INT_MAX */
807 if ((s64)end - (s64)start > BPF_MAX_LOOPS) {
808 s->cur = s->end = 0;
809 return -E2BIG;
810 }
811
812 /* user will call bpf_iter_num_next() first,
813 * which will set s->cur to exactly start value;
814 * underflow shouldn't matter
815 */
816 s->cur = start - 1;
817 s->end = end;
818
819 return 0;
820 }
821
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-03-08 15:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 3:54 [PATCH v4 bpf-next 0/8] BPF open-coded iterators Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 1/8] bpf: factor out fetching basic kfunc metadata Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 2/8] bpf: add iterator kfuncs registration and validation logic Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 3/8] bpf: add support for open-coded iterator loops Andrii Nakryiko
2023-03-08 15:01 ` kernel test robot
2023-03-08 17:05 ` Andrii Nakryiko
2023-03-09 4:35 ` Dan Carpenter
2023-03-09 5:19 ` Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 4/8] bpf: implement number iterator Andrii Nakryiko
2023-03-08 14:30 ` kernel test robot
2023-03-08 14:57 ` Andrii Nakryiko
2023-03-08 15:52 ` kernel test robot [this message]
2023-03-08 3:54 ` [PATCH v4 bpf-next 5/8] selftests/bpf: add bpf_for_each(), bpf_for(), and bpf_repeat() macros Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 6/8] selftests/bpf: add iterators tests Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 7/8] selftests/bpf: add number iterator tests Andrii Nakryiko
2023-03-08 3:54 ` [PATCH v4 bpf-next 8/8] selftests/bpf: implement and test custom testmod_seq iterator Andrii Nakryiko
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=202303082315.foifky6G-lkp@intel.com \
--to=lkp@intel.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tj@kernel.org \
/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