xdp: tracepoint xdp_redirect also need a map argument
authorJesper Dangaard Brouer <brouer@redhat.com>
Tue, 29 Aug 2017 14:37:45 +0000 (16:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Aug 2017 17:51:28 +0000 (10:51 -0700)
commit8d3b778ff544b369f0847e6c15f3e73057298aa4
tree00875e87fc2c16d05dd4892593a4c4586a51a414
parentc31e5a4876cdfbfcc28c4fb201ad872c65671067
xdp: tracepoint xdp_redirect also need a map argument

To make sense of the map index, the tracepoint user also need to know
that map we are talking about.  Supply the map pointer but only expose
the map->id.

The 'to_index' is renamed 'to_ifindex'.  In the xdp_redirect_map case,
this is the result of the devmap lookup. The map lookup key is exposed
as map_index, which is needed to troubleshoot in case the lookup failed.
The 'to_ifindex' is placed after 'err' to keep TP_STRUCT as common as
possible.

This also keeps the TP_STRUCT similar enough, that userspace can write
a monitor program, that doesn't need to care about whether
bpf_redirect or bpf_redirect_map were used.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/xdp.h
net/core/filter.c