bpf: Fix compile warnings when !CONFIG_BPF_SYSCALL
Subsystems (5)
PATCH 1/1 bpf: Fix compile warnings when !CONFIG_BPF_SYSCALL
Such as:
In file included from ./include/trace/events/xdp.h:10:0,
from ./include/linux/bpf_trace.h:6,
from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29:./include/trace/events/xdp.h:94:17: warning: ‘struct bpf_map’ declared inside parameter list
const struct bpf_map *map, u32 map_index),
^
By adding a forward declaration for struct bpf_map. In the CONFIG_BPF_SYSCALL case the declaration comes in via trace/events/bpf.h
--- include/trace/events/xdp.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/xdp.h +2 -0
@@ -9,6 +9,8 @@#include <linux/filter.h> #include <linux/tracepoint.h> +struct bpf_map ; +#define __XDP_ACT_MAP (FN ) \ FN(ABORTED) \ FN(DROP) \
Signature · 1 line
2.7.4
Daniel Borkmann
maintainerQuoted 9 lines · Jason Gunthorpe
Such as:
In file included from
./include/trace/events/xdp.h:10:0,from ./include/linux/bpf_trace.h:6, from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29:
./include/trace/events/xdp.h:94:17: warning: ‘struct bpf_map’ declared inside parameter list
const structbpf_map*map, u32map_index),
^
Quoted 6 lines
By adding a forward declaration for struct
bpf_map. In theCONFIG_BPF_SYSCALLcase the declaration comes in viatrace/events/bpf.hFixes 59a308967589 ("xdp: separate xdp_redirect tracepoint in map case")Signed-off-by Jason Gunthorpe <[email protected]>
Thanks! Fixed here already in the bpf tree:
Quoted 17 lines
include/trace/events/xdp.h | 2 ++ 1 file changed, 2 insertions(+)include/trace/events/xdp.h +2
-0@@ -9,6 +9,8 @@#include <linux/filter.h> #include <linux/tracepoint.h> +struct bpf_map ; +#define __XDP_ACT_MAP (FN ) \ FN(ABORTED) \ FN(DROP) \
Steven Rostedt
maintainerQuoted 5 lines · On Fri, 1 Dec 2017 12:06:05 -0700 Jason Gunthorpe <[email protected]> wrote:
Such as:
In file included from
./include/trace/events/xdp.h:10:0,from ./include/linux/bpf_trace.h:6, from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29:
Quoted 7 lines
./include/trace/events/xdp.h:94:17: warning: ‘struct bpf_map’ declared inside parameter list
const structbpf_map*map, u32map_index),
^By adding a forward declaration for struct
bpf_map. In theCONFIG_BPF_SYSCALLcase the declaration comes in viatrace/events/bpf.h
This was already fixed:
http://lkml.kernel.org/r/[email protected]
-- Steve
Quoted 20 lines
Fixes 59a308967589 ("xdp: separate xdp_redirect tracepoint in map case")Signed-off-by Jason Gunthorpe <[email protected]>--- include/trace/events/xdp.h | 2 ++ 1 file changed, 2 insertions(+)include/trace/events/xdp.h +2
-0@@ -9,6 +9,8 @@#include <linux/filter.h> #include <linux/tracepoint.h> +struct bpf_map ; +#define __XDP_ACT_MAP (FN ) \ FN(ABORTED) \ FN(DROP) \