From: kernel test robot <lkp@intel.com>
To: Hou Tao <houtao1@huawei.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [RFC PATCH bpf-next 1/3] bpf: Add support for qp-trie map
Date: Fri, 29 Jul 2022 18:04:39 +0800 [thread overview]
Message-ID: <202207291741.AfRRtqqg-lkp@intel.com> (raw)
In-Reply-To: <20220726130005.3102470-2-houtao1@huawei.com>
Hi Hou,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Hou-Tao/Add-support-for-qp-trie-map/20220726-204347
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: hexagon-randconfig-r041-20220724 (https://download.01.org/0day-ci/archive/20220729/202207291741.AfRRtqqg-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 83882606dbd7ffb0bdd3460356202d97705809c8)
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/74890023aaa2d8ffed54d96d4999f10bf14ccfef
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Hou-Tao/Add-support-for-qp-trie-map/20220726-204347
git checkout 74890023aaa2d8ffed54d96d4999f10bf14ccfef
# 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=hexagon 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 warnings (new ones prefixed by >>):
>> kernel/bpf/bpf_qp_trie.c:622:24: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
if (!(attr->map_flags | BPF_F_NO_PREALLOC) ||
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
>> kernel/bpf/bpf_qp_trie.c:648:18: warning: division by zero is undefined [-Wdivision-by-zero]
for (i = 0; i < ARRAY_SIZE(trie->locks); i++)
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:55:38: note: expanded from macro 'ARRAY_SIZE'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^ ~~~~~~~~~~~~~~~~
2 warnings generated.
vim +622 kernel/bpf/bpf_qp_trie.c
616
617 static int qp_trie_alloc_check(union bpf_attr *attr)
618 {
619 if (!bpf_capable())
620 return -EPERM;
621
> 622 if (!(attr->map_flags | BPF_F_NO_PREALLOC) ||
623 attr->map_flags & ~QP_TRIE_CREATE_FLAG_MASK ||
624 !bpf_map_flags_access_ok(attr->map_flags))
625 return -EINVAL;
626
627 if (!attr->max_entries || attr->key_size < QP_TRIE_MIN_KEY_SIZE ||
628 !attr->value_size)
629 return -EINVAL;
630
631 if (attr->key_size > QP_TRIE_MAX_KEY_SIZE ||
632 !is_valid_k_v_size(attr->key_size, attr->value_size))
633 return -E2BIG;
634
635 return 0;
636 }
637
638 static struct bpf_map *qp_trie_alloc(union bpf_attr *attr)
639 {
640 struct qp_trie *trie;
641 unsigned int i;
642
643 trie = bpf_map_area_alloc(sizeof(*trie), bpf_map_attr_numa_node(attr));
644 if (!trie)
645 return ERR_PTR(-ENOMEM);
646
647 /* roots are zeroed by bpf_map_area_alloc() */
> 648 for (i = 0; i < ARRAY_SIZE(trie->locks); i++)
649 spin_lock_init(&trie->locks[i]);
650
651 atomic_set(&trie->entries, 0);
652 bpf_map_init_from_attr(&trie->map, attr);
653
654 return &trie->map;
655 }
656
--
0-DAY CI Kernel Test Service
https://01.org/lkp
prev parent reply other threads:[~2022-07-29 10:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220726130005.3102470-2-houtao1@huawei.com>
2022-07-26 20:20 ` [RFC PATCH bpf-next 1/3] bpf: Add support for qp-trie map kernel test robot
2022-07-29 10:04 ` kernel test robot [this message]
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=202207291741.AfRRtqqg-lkp@intel.com \
--to=lkp@intel.com \
--cc=houtao1@huawei.com \
--cc=kbuild-all@lists.01.org \
--cc=llvm@lists.linux.dev \
/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