From: kbuild test robot <lkp@intel.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: kbuild-all@lists.01.org, bpf@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
David Miller <davem@davemloft.net>,
kernel-team@fb.com, netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 07/11] bpf: tcp: Support tcp_congestion_ops in bpf
Date: Tue, 24 Dec 2019 21:06:30 +0800 [thread overview]
Message-ID: <201912242100.dN5ncLYq%lkp@intel.com> (raw)
In-Reply-To: <20191221062611.1183363-1-kafai@fb.com>
[-- Attachment #1: Type: text/plain, Size: 11414 bytes --]
Hi Martin,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
[cannot apply to bpf/master net/master v5.5-rc3 next-20191219]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Martin-KaFai-Lau/Introduce-BPF-STRUCT_OPS/20191224-085617
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
kernel/bpf/bpf_struct_ops.c: In function 'bpf_struct_ops_init':
kernel/bpf/bpf_struct_ops.c:176:8: error: implicit declaration of function 'btf_distill_func_proto'; did you mean 'btf_type_is_func_proto'? [-Werror=implicit-function-declaration]
btf_distill_func_proto(&log, _btf_vmlinux,
^~~~~~~~~~~~~~~~~~~~~~
btf_type_is_func_proto
kernel/bpf/bpf_struct_ops.c: In function 'bpf_struct_ops_map_update_elem':
kernel/bpf/bpf_struct_ops.c:408:2: error: implicit declaration of function 'bpf_map_inc'; did you mean 'bpf_map_put'? [-Werror=implicit-function-declaration]
bpf_map_inc(map);
^~~~~~~~~~~
bpf_map_put
kernel/bpf/bpf_struct_ops.c: In function 'bpf_struct_ops_map_free':
kernel/bpf/bpf_struct_ops.c:468:2: error: implicit declaration of function 'bpf_map_area_free'; did you mean 'bpf_prog_free'? [-Werror=implicit-function-declaration]
bpf_map_area_free(st_map->progs);
^~~~~~~~~~~~~~~~~
bpf_prog_free
kernel/bpf/bpf_struct_ops.c: In function 'bpf_struct_ops_map_alloc':
>> kernel/bpf/bpf_struct_ops.c:515:8: error: implicit declaration of function 'bpf_map_charge_init'; did you mean 'ip_misc_proc_init'? [-Werror=implicit-function-declaration]
err = bpf_map_charge_init(&mem, map_total_size);
^~~~~~~~~~~~~~~~~~~
ip_misc_proc_init
kernel/bpf/bpf_struct_ops.c:519:11: error: implicit declaration of function 'bpf_map_area_alloc'; did you mean 'bpf_prog_alloc'? [-Werror=implicit-function-declaration]
st_map = bpf_map_area_alloc(st_map_size, NUMA_NO_NODE);
^~~~~~~~~~~~~~~~~~
bpf_prog_alloc
kernel/bpf/bpf_struct_ops.c:519:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
st_map = bpf_map_area_alloc(st_map_size, NUMA_NO_NODE);
^
kernel/bpf/bpf_struct_ops.c:521:3: error: implicit declaration of function 'bpf_map_charge_finish'; did you mean 'bpf_map_flags_to_cap'? [-Werror=implicit-function-declaration]
bpf_map_charge_finish(&mem);
^~~~~~~~~~~~~~~~~~~~~
bpf_map_flags_to_cap
kernel/bpf/bpf_struct_ops.c:527:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
st_map->uvalue = bpf_map_area_alloc(vt->size, NUMA_NO_NODE);
^
kernel/bpf/bpf_struct_ops.c:528:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
st_map->progs =
^
>> kernel/bpf/bpf_struct_ops.c:545:2: error: implicit declaration of function 'bpf_map_init_from_attr'; did you mean 'bioset_init_from_src'? [-Werror=implicit-function-declaration]
bpf_map_init_from_attr(map, attr);
^~~~~~~~~~~~~~~~~~~~~~
bioset_init_from_src
>> kernel/bpf/bpf_struct_ops.c:546:2: error: implicit declaration of function 'bpf_map_charge_move'; did you mean 'bio_map_user_iov'? [-Werror=implicit-function-declaration]
bpf_map_charge_move(&map->memory, &mem);
^~~~~~~~~~~~~~~~~~~
bio_map_user_iov
cc1: some warnings being treated as errors
vim +515 kernel/bpf/bpf_struct_ops.c
d69ac27055a81d Martin KaFai Lau 2019-12-20 461
d69ac27055a81d Martin KaFai Lau 2019-12-20 462 static void bpf_struct_ops_map_free(struct bpf_map *map)
d69ac27055a81d Martin KaFai Lau 2019-12-20 463 {
d69ac27055a81d Martin KaFai Lau 2019-12-20 464 struct bpf_struct_ops_map *st_map = (struct bpf_struct_ops_map *)map;
d69ac27055a81d Martin KaFai Lau 2019-12-20 465
d69ac27055a81d Martin KaFai Lau 2019-12-20 466 if (st_map->progs)
d69ac27055a81d Martin KaFai Lau 2019-12-20 467 bpf_struct_ops_map_put_progs(st_map);
d69ac27055a81d Martin KaFai Lau 2019-12-20 @468 bpf_map_area_free(st_map->progs);
d69ac27055a81d Martin KaFai Lau 2019-12-20 469 bpf_jit_free_exec(st_map->image);
d69ac27055a81d Martin KaFai Lau 2019-12-20 470 bpf_map_area_free(st_map->uvalue);
d69ac27055a81d Martin KaFai Lau 2019-12-20 471 bpf_map_area_free(st_map);
d69ac27055a81d Martin KaFai Lau 2019-12-20 472 }
d69ac27055a81d Martin KaFai Lau 2019-12-20 473
d69ac27055a81d Martin KaFai Lau 2019-12-20 474 static int bpf_struct_ops_map_alloc_check(union bpf_attr *attr)
d69ac27055a81d Martin KaFai Lau 2019-12-20 475 {
d69ac27055a81d Martin KaFai Lau 2019-12-20 476 if (attr->key_size != sizeof(unsigned int) || attr->max_entries != 1 ||
d69ac27055a81d Martin KaFai Lau 2019-12-20 477 attr->map_flags || !attr->btf_vmlinux_value_type_id)
d69ac27055a81d Martin KaFai Lau 2019-12-20 478 return -EINVAL;
d69ac27055a81d Martin KaFai Lau 2019-12-20 479 return 0;
d69ac27055a81d Martin KaFai Lau 2019-12-20 480 }
d69ac27055a81d Martin KaFai Lau 2019-12-20 481
d69ac27055a81d Martin KaFai Lau 2019-12-20 482 static struct bpf_map *bpf_struct_ops_map_alloc(union bpf_attr *attr)
d69ac27055a81d Martin KaFai Lau 2019-12-20 483 {
d69ac27055a81d Martin KaFai Lau 2019-12-20 484 const struct bpf_struct_ops *st_ops;
d69ac27055a81d Martin KaFai Lau 2019-12-20 485 size_t map_total_size, st_map_size;
d69ac27055a81d Martin KaFai Lau 2019-12-20 486 struct bpf_struct_ops_map *st_map;
d69ac27055a81d Martin KaFai Lau 2019-12-20 487 const struct btf_type *t, *vt;
d69ac27055a81d Martin KaFai Lau 2019-12-20 488 struct bpf_map_memory mem;
d69ac27055a81d Martin KaFai Lau 2019-12-20 489 struct bpf_map *map;
d69ac27055a81d Martin KaFai Lau 2019-12-20 490 int err;
d69ac27055a81d Martin KaFai Lau 2019-12-20 491
d69ac27055a81d Martin KaFai Lau 2019-12-20 492 if (!capable(CAP_SYS_ADMIN))
d69ac27055a81d Martin KaFai Lau 2019-12-20 493 return ERR_PTR(-EPERM);
d69ac27055a81d Martin KaFai Lau 2019-12-20 494
d69ac27055a81d Martin KaFai Lau 2019-12-20 495 st_ops = bpf_struct_ops_find_value(attr->btf_vmlinux_value_type_id);
d69ac27055a81d Martin KaFai Lau 2019-12-20 496 if (!st_ops)
d69ac27055a81d Martin KaFai Lau 2019-12-20 497 return ERR_PTR(-ENOTSUPP);
d69ac27055a81d Martin KaFai Lau 2019-12-20 498
d69ac27055a81d Martin KaFai Lau 2019-12-20 499 vt = st_ops->value_type;
d69ac27055a81d Martin KaFai Lau 2019-12-20 500 if (attr->value_size != vt->size)
d69ac27055a81d Martin KaFai Lau 2019-12-20 501 return ERR_PTR(-EINVAL);
d69ac27055a81d Martin KaFai Lau 2019-12-20 502
d69ac27055a81d Martin KaFai Lau 2019-12-20 503 t = st_ops->type;
d69ac27055a81d Martin KaFai Lau 2019-12-20 504
d69ac27055a81d Martin KaFai Lau 2019-12-20 505 st_map_size = sizeof(*st_map) +
d69ac27055a81d Martin KaFai Lau 2019-12-20 506 /* kvalue stores the
d69ac27055a81d Martin KaFai Lau 2019-12-20 507 * struct bpf_struct_ops_tcp_congestions_ops
d69ac27055a81d Martin KaFai Lau 2019-12-20 508 */
d69ac27055a81d Martin KaFai Lau 2019-12-20 509 (vt->size - sizeof(struct bpf_struct_ops_value));
d69ac27055a81d Martin KaFai Lau 2019-12-20 510 map_total_size = st_map_size +
d69ac27055a81d Martin KaFai Lau 2019-12-20 511 /* uvalue */
d69ac27055a81d Martin KaFai Lau 2019-12-20 512 sizeof(vt->size) +
d69ac27055a81d Martin KaFai Lau 2019-12-20 513 /* struct bpf_progs **progs */
d69ac27055a81d Martin KaFai Lau 2019-12-20 514 btf_type_vlen(t) * sizeof(struct bpf_prog *);
d69ac27055a81d Martin KaFai Lau 2019-12-20 @515 err = bpf_map_charge_init(&mem, map_total_size);
d69ac27055a81d Martin KaFai Lau 2019-12-20 516 if (err < 0)
d69ac27055a81d Martin KaFai Lau 2019-12-20 517 return ERR_PTR(err);
d69ac27055a81d Martin KaFai Lau 2019-12-20 518
d69ac27055a81d Martin KaFai Lau 2019-12-20 519 st_map = bpf_map_area_alloc(st_map_size, NUMA_NO_NODE);
d69ac27055a81d Martin KaFai Lau 2019-12-20 520 if (!st_map) {
d69ac27055a81d Martin KaFai Lau 2019-12-20 521 bpf_map_charge_finish(&mem);
d69ac27055a81d Martin KaFai Lau 2019-12-20 522 return ERR_PTR(-ENOMEM);
d69ac27055a81d Martin KaFai Lau 2019-12-20 523 }
d69ac27055a81d Martin KaFai Lau 2019-12-20 524 st_map->st_ops = st_ops;
d69ac27055a81d Martin KaFai Lau 2019-12-20 525 map = &st_map->map;
d69ac27055a81d Martin KaFai Lau 2019-12-20 526
d69ac27055a81d Martin KaFai Lau 2019-12-20 @527 st_map->uvalue = bpf_map_area_alloc(vt->size, NUMA_NO_NODE);
d69ac27055a81d Martin KaFai Lau 2019-12-20 @528 st_map->progs =
d69ac27055a81d Martin KaFai Lau 2019-12-20 529 bpf_map_area_alloc(btf_type_vlen(t) * sizeof(struct bpf_prog *),
d69ac27055a81d Martin KaFai Lau 2019-12-20 530 NUMA_NO_NODE);
d69ac27055a81d Martin KaFai Lau 2019-12-20 531 /* Each trampoline costs < 64 bytes. Ensure one page
d69ac27055a81d Martin KaFai Lau 2019-12-20 532 * is enough for max number of func ptrs.
d69ac27055a81d Martin KaFai Lau 2019-12-20 533 */
d69ac27055a81d Martin KaFai Lau 2019-12-20 534 BUILD_BUG_ON(PAGE_SIZE / 64 < BPF_STRUCT_OPS_MAX_NR_MEMBERS);
d69ac27055a81d Martin KaFai Lau 2019-12-20 535 st_map->image = bpf_jit_alloc_exec(PAGE_SIZE);
d69ac27055a81d Martin KaFai Lau 2019-12-20 536 if (!st_map->uvalue || !st_map->progs || !st_map->image) {
d69ac27055a81d Martin KaFai Lau 2019-12-20 537 bpf_struct_ops_map_free(map);
d69ac27055a81d Martin KaFai Lau 2019-12-20 538 bpf_map_charge_finish(&mem);
d69ac27055a81d Martin KaFai Lau 2019-12-20 539 return ERR_PTR(-ENOMEM);
d69ac27055a81d Martin KaFai Lau 2019-12-20 540 }
d69ac27055a81d Martin KaFai Lau 2019-12-20 541
d69ac27055a81d Martin KaFai Lau 2019-12-20 542 spin_lock_init(&st_map->lock);
d69ac27055a81d Martin KaFai Lau 2019-12-20 543 set_vm_flush_reset_perms(st_map->image);
d69ac27055a81d Martin KaFai Lau 2019-12-20 544 set_memory_x((long)st_map->image, 1);
d69ac27055a81d Martin KaFai Lau 2019-12-20 @545 bpf_map_init_from_attr(map, attr);
d69ac27055a81d Martin KaFai Lau 2019-12-20 @546 bpf_map_charge_move(&map->memory, &mem);
d69ac27055a81d Martin KaFai Lau 2019-12-20 547
d69ac27055a81d Martin KaFai Lau 2019-12-20 548 return map;
d69ac27055a81d Martin KaFai Lau 2019-12-20 549 }
d69ac27055a81d Martin KaFai Lau 2019-12-20 550
:::::: The code at line 515 was first introduced by commit
:::::: d69ac27055a81d26ee1bfe54b9655cf81ebd5ac9 bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS
:::::: TO: Martin KaFai Lau <kafai@fb.com>
:::::: CC: 0day robot <lkp@intel.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46481 bytes --]
next prev parent reply other threads:[~2019-12-24 13:07 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-21 6:25 [PATCH bpf-next v2 00/11] Introduce BPF STRUCT_OPS Martin KaFai Lau
2019-12-21 6:25 ` [PATCH bpf-next v2 01/11] bpf: Save PTR_TO_BTF_ID register state when spilling to stack Martin KaFai Lau
2019-12-21 6:25 ` [PATCH bpf-next v2 02/11] bpf: Avoid storing modifier to info->btf_id Martin KaFai Lau
2019-12-21 6:26 ` [PATCH bpf-next v2 03/11] bpf: Add enum support to btf_ctx_access() Martin KaFai Lau
2019-12-21 6:26 ` [PATCH bpf-next v2 04/11] bpf: Support bitfield read access in btf_struct_access Martin KaFai Lau
2019-12-23 7:49 ` Yonghong Song
2019-12-23 20:05 ` Andrii Nakryiko
2019-12-23 21:21 ` Yonghong Song
2019-12-21 6:26 ` [PATCH bpf-next v2 05/11] bpf: Introduce BPF_PROG_TYPE_STRUCT_OPS Martin KaFai Lau
2019-12-23 19:33 ` Yonghong Song
2019-12-23 20:29 ` Andrii Nakryiko
2019-12-23 22:29 ` Martin Lau
2019-12-23 22:55 ` Andrii Nakryiko
2019-12-24 11:46 ` kbuild test robot
2019-12-21 6:26 ` [PATCH bpf-next v2 06/11] bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS Martin KaFai Lau
2019-12-23 19:57 ` Yonghong Song
2019-12-23 21:44 ` Andrii Nakryiko
2019-12-23 22:15 ` Martin Lau
2019-12-27 6:16 ` Martin Lau
2019-12-23 23:05 ` Andrii Nakryiko
2019-12-28 1:47 ` Martin Lau
2019-12-28 2:24 ` Andrii Nakryiko
2019-12-28 5:16 ` Martin Lau
2019-12-24 12:28 ` kbuild test robot
2019-12-21 6:26 ` [PATCH bpf-next v2 07/11] bpf: tcp: Support tcp_congestion_ops in bpf Martin KaFai Lau
2019-12-23 20:18 ` Yonghong Song
2019-12-23 23:20 ` Andrii Nakryiko
2019-12-24 7:16 ` kbuild test robot
2019-12-24 13:06 ` kbuild test robot [this message]
2019-12-21 6:26 ` [PATCH bpf-next v2 08/11] bpf: Add BPF_FUNC_tcp_send_ack helper Martin KaFai Lau
2019-12-21 6:26 ` [PATCH bpf-next v2 09/11] bpf: Synch uapi bpf.h to tools/ Martin KaFai Lau
2019-12-21 6:26 ` [PATCH bpf-next v2 10/11] bpf: libbpf: Add STRUCT_OPS support Martin KaFai Lau
2019-12-23 19:54 ` Andrii Nakryiko
2019-12-26 22:47 ` Martin Lau
2019-12-21 6:26 ` [PATCH bpf-next v2 11/11] bpf: Add bpf_dctcp example Martin KaFai Lau
2019-12-23 23:26 ` Andrii Nakryiko
2019-12-24 1:31 ` Martin Lau
2019-12-24 7:01 ` Andrii Nakryiko
2019-12-24 7:32 ` Martin Lau
2019-12-24 16:50 ` Martin Lau
2019-12-26 19:02 ` Andrii Nakryiko
2019-12-26 20:25 ` Martin Lau
2019-12-26 20:48 ` Andrii Nakryiko
2019-12-26 22:20 ` Martin Lau
2019-12-26 22:25 ` 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=201912242100.dN5ncLYq%lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kafai@fb.com \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@fb.com \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).