[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201809141407.0B321AUD%fengguang.wu@intel.com>
Date: Fri, 14 Sep 2018 14:57:13 +0800
From: kbuild test robot <lkp@...el.com>
To: Joe Stringer <joe@...d.net.nz>
Cc: kbuild-all@...org, daniel@...earbox.net, netdev@...r.kernel.org,
ast@...nel.org, john.fastabend@...il.com, tgraf@...g.ch,
kafai@...com, nitin.hande@...il.com, mauricio.vasquez@...ito.it
Subject: Re: [PATCH bpf-next 07/11] bpf: Add helper to retrieve socket in BPF
Hi Joe,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Joe-Stringer/Add-socket-lookup-support/20180914-134632
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: xtensa-common_defconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.1.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=8.1.0 make.cross ARCH=xtensa
All errors (new ones prefixed by >>):
net/core/filter.c:4930:1: note: in expansion of macro 'BPF_CALL_2'
BPF_CALL_2(bpf_sk_release, struct sock *, sk, u64, flags)
^~~~~~~~~~
net/core/filter.c: In function 'sk_lookup':
include/linux/filter.h:439:6: error: invalid storage class for function '____bpf_sk_release'
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__))
^~~~
include/linux/filter.h:443:31: note: in expansion of macro 'BPF_CALL_x'
#define BPF_CALL_2(name, ...) BPF_CALL_x(2, name, __VA_ARGS__)
^~~~~~~~~~
net/core/filter.c:4930:1: note: in expansion of macro 'BPF_CALL_2'
BPF_CALL_2(bpf_sk_release, struct sock *, sk, u64, flags)
^~~~~~~~~~
net/core/filter.c:4941:11: error: initializer element is not constant
.func = bpf_sk_release,
^~~~~~~~~~~~~~
net/core/filter.c:4941:11: note: (near initialization for 'bpf_sk_release_proto.func')
net/core/filter.c:4980:1: error: invalid storage class for function 'bpf_base_func_proto'
bpf_base_func_proto(enum bpf_func_id func_id)
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:5009:1: error: invalid storage class for function 'sock_filter_func_proto'
sock_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5025:1: error: invalid storage class for function 'sock_addr_func_proto'
sock_addr_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5051:1: error: invalid storage class for function 'sk_filter_func_proto'
sk_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5068:1: error: invalid storage class for function 'cg_skb_func_proto'
cg_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~
net/core/filter.c:5079:1: error: invalid storage class for function 'tc_cls_act_func_proto'
tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5166:1: error: invalid storage class for function 'xdp_func_proto'
xdp_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~
net/core/filter.c:5193:1: error: invalid storage class for function 'sock_ops_func_proto'
sock_ops_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:5216:1: error: invalid storage class for function 'sk_msg_func_proto'
sk_msg_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~
net/core/filter.c:5237:1: error: invalid storage class for function 'sk_skb_func_proto'
sk_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~
net/core/filter.c:5272:1: error: invalid storage class for function 'lwt_out_func_proto'
lwt_out_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~
net/core/filter.c:5299:1: error: invalid storage class for function 'lwt_in_func_proto'
lwt_in_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~
net/core/filter.c:5310:1: error: invalid storage class for function 'lwt_xmit_func_proto'
lwt_xmit_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:5345:1: error: invalid storage class for function 'lwt_seg6local_func_proto'
lwt_seg6local_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
^~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5361:13: error: invalid storage class for function 'bpf_skb_is_valid_access'
static bool bpf_skb_is_valid_access(int off, int size, enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5404:13: error: invalid storage class for function 'sk_filter_is_valid_access'
static bool sk_filter_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5430:13: error: invalid storage class for function 'lwt_is_valid_access'
static bool lwt_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:5466:13: error: invalid storage class for function '__sock_filter_check_attach_type'
static bool __sock_filter_check_attach_type(int off,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5509:13: error: invalid storage class for function '__sock_filter_check_size'
static bool __sock_filter_check_size(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5536:13: error: invalid storage class for function 'sock_filter_is_valid_access'
static bool sock_filter_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5547:12: error: invalid storage class for function 'bpf_unclone_prologue'
static int bpf_unclone_prologue(struct bpf_insn *insn_buf, bool direct_write,
^~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5586:12: error: invalid storage class for function 'bpf_gen_ld_abs'
static int bpf_gen_ld_abs(const struct bpf_insn *orig,
^~~~~~~~~~~~~~
net/core/filter.c:5621:12: error: invalid storage class for function 'tc_cls_act_prologue'
static int tc_cls_act_prologue(struct bpf_insn *insn_buf, bool direct_write,
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:5627:13: error: invalid storage class for function 'tc_cls_act_is_valid_access'
static bool tc_cls_act_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5662:13: error: invalid storage class for function '__is_valid_xdp_access'
static bool __is_valid_xdp_access(int off, int size)
^~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5674:13: error: invalid storage class for function 'xdp_is_valid_access'
static bool xdp_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from include/linux/list.h:9,
from include/linux/module.h:9,
from net/core/filter.c:24:
>> net/core/filter.c:5712:19: error: non-static declaration of 'bpf_warn_invalid_xdp_action' follows static declaration
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/export.h:79:21: note: in definition of macro '___EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
net/core/filter.c:5712:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
^~~~~~~~~~~~~~~~~
net/core/filter.c:5704:6: note: previous definition of 'bpf_warn_invalid_xdp_action' was here
void bpf_warn_invalid_xdp_action(u32 act)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5714:13: error: invalid storage class for function 'sock_addr_is_valid_access'
static bool sock_addr_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5801:13: error: invalid storage class for function 'sock_ops_is_valid_access'
static bool sock_ops_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5842:12: error: invalid storage class for function 'sk_skb_prologue'
static int sk_skb_prologue(struct bpf_insn *insn_buf, bool direct_write,
^~~~~~~~~~~~~~~
net/core/filter.c:5848:13: error: invalid storage class for function 'sk_skb_is_valid_access'
static bool sk_skb_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5883:13: error: invalid storage class for function 'sk_msg_is_valid_access'
static bool sk_msg_is_valid_access(int off, int size,
^~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:5915:12: error: invalid storage class for function 'bpf_convert_ctx_access'
static u32 bpf_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6318:12: error: invalid storage class for function 'tc_cls_act_convert_ctx_access'
static u32 tc_cls_act_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6342:12: error: invalid storage class for function 'xdp_convert_ctx_access'
static u32 xdp_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6462:12: error: invalid storage class for function 'sock_addr_convert_ctx_access'
static u32 sock_addr_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6551:12: error: invalid storage class for function 'sock_ops_convert_ctx_access'
static u32 sock_ops_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6890:12: error: invalid storage class for function 'sk_skb_convert_ctx_access'
static u32 sk_skb_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~~~
net/core/filter.c:6915:12: error: invalid storage class for function 'sk_msg_convert_ctx_access'
static u32 sk_msg_convert_ctx_access(enum bpf_access_type type,
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from include/linux/list.h:9,
from include/linux/module.h:9,
from net/core/filter.c:24:
>> net/core/filter.c:7190:19: error: non-static declaration of 'sk_detach_filter' follows static declaration
EXPORT_SYMBOL_GPL(sk_detach_filter);
^~~~~~~~~~~~~~~~
include/linux/export.h:79:21: note: in definition of macro '___EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
net/core/filter.c:7190:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(sk_detach_filter);
^~~~~~~~~~~~~~~~~
net/core/filter.c:7172:5: note: previous definition of 'sk_detach_filter' was here
int sk_detach_filter(struct sock *sk)
^~~~~~~~~~~~~~~~
net/core/filter.c:7247:13: error: invalid storage class for function 'bpf_init_reuseport_kern'
static void bpf_init_reuseport_kern(struct sk_reuseport_kern *reuse_kern,
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/net/sock.h:64,
from include/linux/sock_diag.h:8,
from net/core/filter.c:29:
include/linux/filter.h:432:6: error: invalid storage class for function '____sk_select_reuseport'
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
^~~~
include/linux/filter.h:445:31: note: in expansion of macro 'BPF_CALL_x'
#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__)
^~~~~~~~~~
net/core/filter.c:7277:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~
net/core/filter.c:7277:12: error: static declaration of 'sk_select_reuseport' follows non-static declaration
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~~~~~~~~~~
include/linux/filter.h:434:6: note: in definition of macro 'BPF_CALL_x'
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \
^~~~
net/core/filter.c:7277:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~
net/core/filter.c:7277:12: note: previous declaration of 'sk_select_reuseport' was here
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~~~~~~~~~~
include/linux/filter.h:433:6: note: in definition of macro 'BPF_CALL_x'
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \
^~~~
net/core/filter.c:7277:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~
net/core/filter.c: In function 'sk_select_reuseport':
include/linux/filter.h:436:10: error: implicit declaration of function '____sk_select_reuseport'; did you mean 'sk_select_reuseport'? [-Werror=implicit-function-declaration]
return ____##name(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\
^~~~
include/linux/filter.h:445:31: note: in expansion of macro 'BPF_CALL_x'
#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__)
^~~~~~~~~~
net/core/filter.c:7277:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~
net/core/filter.c: In function 'sk_lookup':
include/linux/filter.h:439:6: error: invalid storage class for function '____sk_select_reuseport'
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__))
^~~~
include/linux/filter.h:445:31: note: in expansion of macro 'BPF_CALL_x'
#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__)
^~~~~~~~~~
net/core/filter.c:7277:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
^~~~~~~~~~
net/core/filter.c:7323:20: error: initializer element is not constant
.func = sk_select_reuseport,
^~~~~~~~~~~~~~~~~~~
net/core/filter.c:7323:20: note: (near initialization for 'sk_select_reuseport_proto.func')
In file included from include/net/sock.h:64,
from include/linux/sock_diag.h:8,
from net/core/filter.c:29:
include/linux/filter.h:432:6: error: invalid storage class for function '____sk_reuseport_load_bytes'
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
^~~~
include/linux/filter.h:445:31: note: in expansion of macro 'BPF_CALL_x'
#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__)
^~~~~~~~~~
net/core/filter.c:7332:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_reuseport_load_bytes,
^~~~~~~~~~
net/core/filter.c:7332:12: error: static declaration of 'sk_reuseport_load_bytes' follows non-static declaration
BPF_CALL_4(sk_reuseport_load_bytes,
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/filter.h:434:6: note: in definition of macro 'BPF_CALL_x'
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \
^~~~
net/core/filter.c:7332:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_reuseport_load_bytes,
^~~~~~~~~~
net/core/filter.c:7332:12: note: previous declaration of 'sk_reuseport_load_bytes' was here
BPF_CALL_4(sk_reuseport_load_bytes,
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/filter.h:433:6: note: in definition of macro 'BPF_CALL_x'
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \
^~~~
net/core/filter.c:7332:1: note: in expansion of macro 'BPF_CALL_4'
BPF_CALL_4(sk_reuseport_load_bytes,
^~~~~~~~~~
net/core/filter.c: In function 'sk_reuseport_load_bytes':
include/linux/filter.h:436:10: error: implicit declaration of function '____sk_reuseport_load_bytes'; did you mean 'sk_reuseport_load_bytes'? [-Werror=implicit-function-declaration]
vim +/bpf_warn_invalid_xdp_action +5712 net/core/filter.c
6a773a15a Brenden Blanco 2016-07-19 5673
6a773a15a Brenden Blanco 2016-07-19 @5674 static bool xdp_is_valid_access(int off, int size,
6a773a15a Brenden Blanco 2016-07-19 5675 enum bpf_access_type type,
5e43f899b Andrey Ignatov 2018-03-30 5676 const struct bpf_prog *prog,
239946314 Yonghong Song 2017-06-22 5677 struct bpf_insn_access_aux *info)
6a773a15a Brenden Blanco 2016-07-19 5678 {
0d8300325 Jakub Kicinski 2018-05-08 5679 if (type == BPF_WRITE) {
0d8300325 Jakub Kicinski 2018-05-08 5680 if (bpf_prog_is_dev_bound(prog->aux)) {
0d8300325 Jakub Kicinski 2018-05-08 5681 switch (off) {
0d8300325 Jakub Kicinski 2018-05-08 5682 case offsetof(struct xdp_md, rx_queue_index):
0d8300325 Jakub Kicinski 2018-05-08 5683 return __is_valid_xdp_access(off, size);
0d8300325 Jakub Kicinski 2018-05-08 5684 }
0d8300325 Jakub Kicinski 2018-05-08 5685 }
6a773a15a Brenden Blanco 2016-07-19 5686 return false;
0d8300325 Jakub Kicinski 2018-05-08 5687 }
6a773a15a Brenden Blanco 2016-07-19 5688
6a773a15a Brenden Blanco 2016-07-19 5689 switch (off) {
6a773a15a Brenden Blanco 2016-07-19 5690 case offsetof(struct xdp_md, data):
239946314 Yonghong Song 2017-06-22 5691 info->reg_type = PTR_TO_PACKET;
6a773a15a Brenden Blanco 2016-07-19 5692 break;
de8f3a83b Daniel Borkmann 2017-09-25 5693 case offsetof(struct xdp_md, data_meta):
de8f3a83b Daniel Borkmann 2017-09-25 5694 info->reg_type = PTR_TO_PACKET_META;
de8f3a83b Daniel Borkmann 2017-09-25 5695 break;
6a773a15a Brenden Blanco 2016-07-19 5696 case offsetof(struct xdp_md, data_end):
239946314 Yonghong Song 2017-06-22 5697 info->reg_type = PTR_TO_PACKET_END;
6a773a15a Brenden Blanco 2016-07-19 5698 break;
6a773a15a Brenden Blanco 2016-07-19 5699 }
6a773a15a Brenden Blanco 2016-07-19 5700
1afaf661b Daniel Borkmann 2016-12-04 5701 return __is_valid_xdp_access(off, size);
6a773a15a Brenden Blanco 2016-07-19 5702 }
6a773a15a Brenden Blanco 2016-07-19 5703
6a773a15a Brenden Blanco 2016-07-19 5704 void bpf_warn_invalid_xdp_action(u32 act)
6a773a15a Brenden Blanco 2016-07-19 5705 {
9beb8bedb Daniel Borkmann 2017-09-09 5706 const u32 act_max = XDP_REDIRECT;
9beb8bedb Daniel Borkmann 2017-09-09 5707
9beb8bedb Daniel Borkmann 2017-09-09 5708 WARN_ONCE(1, "%s XDP return value %u, expect packet loss!\n",
9beb8bedb Daniel Borkmann 2017-09-09 5709 act > act_max ? "Illegal" : "Driver unsupported",
9beb8bedb Daniel Borkmann 2017-09-09 5710 act);
6a773a15a Brenden Blanco 2016-07-19 5711 }
6a773a15a Brenden Blanco 2016-07-19 @5712 EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
6a773a15a Brenden Blanco 2016-07-19 5713
:::::: The code at line 5712 was first introduced by commit
:::::: 6a773a15a1e8874e5eccd2f29190c31085912c95 bpf: add XDP prog type for early driver filter
:::::: TO: Brenden Blanco <bblanco@...mgrid.com>
:::::: CC: David S. Miller <davem@...emloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (10358 bytes)
Powered by blists - more mailing lists