]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4747aca7387d7a2eae7e6c69d69afed4462caec4
tree00875e87fc2c16d05dd4892593a4c4586a51a414
parent862005b35c5a9c9ecfcb6cf97ecd2bfad06d6850
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