Re: [PATCH resend] trace/xdp: fix compile warning: 'struct bpf_map' declared inside parameter list

From: Daniel Borkmann
Date: Wed Nov 29 2017 - 21:01:17 EST


On 11/30/2017 02:41 AM, Xie XiuQi wrote:
> 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 <huangdaode@xxxxxxxxxxxxx>
> Cc: Hanjun Guo <guohanjun@xxxxxxxxxx>
> Fixes: 8d3b778ff544 ("xdp: tracepoint xdp_redirect also need a map argument")
> Signed-off-by: Xie XiuQi <xiexiuqi@xxxxxxxxxx>
> Acked-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
> Acked-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

Applied to bpf tree, thanks Xie!