aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/pg/stream.c')
-rw-r--r--src/vnet/pg/stream.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/pg/stream.c b/src/vnet/pg/stream.c
index 1ed7189ffc9..c46875e11ad 100644
--- a/src/vnet/pg/stream.c
+++ b/src/vnet/pg/stream.c
@@ -95,6 +95,25 @@ pg_stream_enable_disable (pg_main_t * pg, pg_stream_t * s, int want_enabled)
}
static u8 *
+format_pg_output_trace (u8 * s, va_list * va)
+{
+ CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
+ CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
+ pg_output_trace_t *t = va_arg (*va, pg_output_trace_t *);
+ uword indent = format_get_indent (s);
+
+ s = format (s, "%Ubuffer 0x%x: %U",
+ format_white_space, indent,
+ t->buffer_index, format_vlib_buffer, &t->buffer);
+
+ s = format (s, "\n%U%U", format_white_space, indent,
+ format_ethernet_header_with_length, t->buffer.pre_data,
+ sizeof (t->buffer.pre_data));
+
+ return s;
+}
+
+static u8 *
format_pg_interface_name (u8 * s, va_list * args)
{
pg_main_t *pg = &pg_main;
@@ -125,6 +144,7 @@ VNET_DEVICE_CLASS (pg_dev_class) = {
.name = "pg",
.tx_function = pg_output,
.format_device_name = format_pg_interface_name,
+ .format_tx_trace = format_pg_output_trace,
.admin_up_down_function = pg_interface_admin_up_down,
};
/* *INDENT-ON* */