Skip to content

Commit

Permalink
xdp: Add tracepoint for bulk XDP_TX
Browse files Browse the repository at this point in the history
This is introduced for admins to check what is happening on XDP_TX when
bulk XDP_TX is in use, which will be first introduced in veth in next
commit.

v3:
- Add act field to be in line with other XDP tracepoints.

Signed-off-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Toshiaki Makita authored and Daniel Borkmann committed Jun 25, 2019
1 parent 88091ff commit e7d4798
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions include/trace/events/xdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ TRACE_EVENT(xdp_exception,
__entry->ifindex)
);

TRACE_EVENT(xdp_bulk_tx,

TP_PROTO(const struct net_device *dev,
int sent, int drops, int err),

TP_ARGS(dev, sent, drops, err),

TP_STRUCT__entry(
__field(int, ifindex)
__field(u32, act)
__field(int, drops)
__field(int, sent)
__field(int, err)
),

TP_fast_assign(
__entry->ifindex = dev->ifindex;
__entry->act = XDP_TX;
__entry->drops = drops;
__entry->sent = sent;
__entry->err = err;
),

TP_printk("ifindex=%d action=%s sent=%d drops=%d err=%d",
__entry->ifindex,
__print_symbolic(__entry->act, __XDP_ACT_SYM_TAB),
__entry->sent, __entry->drops, __entry->err)
);

DECLARE_EVENT_CLASS(xdp_redirect_template,

TP_PROTO(const struct net_device *dev,
Expand Down
1 change: 1 addition & 0 deletions kernel/bpf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,3 +2101,4 @@ EXPORT_SYMBOL(bpf_stats_enabled_key);
#include <linux/bpf_trace.h>

EXPORT_TRACEPOINT_SYMBOL_GPL(xdp_exception);
EXPORT_TRACEPOINT_SYMBOL_GPL(xdp_bulk_tx);

0 comments on commit e7d4798

Please sign in to comment.