Skip to content

Commit 23721a7

Browse files
Xie XiuQiborkmann
authored andcommitted
trace/xdp: fix compile warning: 'struct bpf_map' declared inside parameter list
We meet this compile warning, which caused by missing bpf.h in xdp.h. 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:93:17: warning: ‘struct bpf_map’ declared inside parameter list will not be visible outside of this definition or declaration const struct bpf_map *map, u32 map_index), ^ ./include/linux/tracepoint.h:187:34: note: in definition of macro ‘__DECLARE_TRACE’ static inline void trace_##name(proto) \ ^~~~~ ./include/linux/tracepoint.h:352:24: note: in expansion of macro ‘PARAMS’ __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ ^~~~~~ ./include/linux/tracepoint.h:477:2: note: in expansion of macro ‘DECLARE_TRACE’ DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^~~~~~~~~~~~~ ./include/linux/tracepoint.h:477:22: note: in expansion of macro ‘PARAMS’ DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^~~~~~ ./include/trace/events/xdp.h:89:1: note: in expansion of macro ‘DEFINE_EVENT’ DEFINE_EVENT(xdp_redirect_template, xdp_redirect, ^~~~~~~~~~~~ ./include/trace/events/xdp.h:90:2: note: in expansion of macro ‘TP_PROTO’ TP_PROTO(const struct net_device *dev, ^~~~~~~~ ./include/trace/events/xdp.h:93:17: warning: ‘struct bpf_map’ declared inside parameter list will not be visible outside of this definition or declaration const struct bpf_map *map, u32 map_index), ^ ./include/linux/tracepoint.h:203:38: note: in definition of macro ‘__DECLARE_TRACE’ register_trace_##name(void (*probe)(data_proto), void *data) \ ^~~~~~~~~~ ./include/linux/tracepoint.h:354:4: note: in expansion of macro ‘PARAMS’ PARAMS(void *__data, proto), \ ^~~~~~ Reported-by: Huang Daode <[email protected]> Cc: Hanjun Guo <[email protected]> Fixes: 8d3b778 ("xdp: tracepoint xdp_redirect also need a map argument") Signed-off-by: Xie XiuQi <[email protected]> Acked-by: Jesper Dangaard Brouer <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent d775a41 commit 23721a7

File tree

1 file changed

+1
-0
lines changed
  • include/trace/events

1 file changed

+1
-0
lines changed

include/trace/events/xdp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/netdevice.h>
99
#include <linux/filter.h>
1010
#include <linux/tracepoint.h>
11+
#include <linux/bpf.h>
1112

1213
#define __XDP_ACT_MAP(FN) \
1314
FN(ABORTED) \

0 commit comments

Comments
 (0)