aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-11-16 14:14:57 +0100
committerChris Luke <chris_luke@comcast.com>2017-11-16 14:31:08 +0000
commitf11cbc4fc0a8b0dcfb02732999f6d9427138b709 (patch)
treee7eeca8f3710d50dca4400fce5e0a3a05003ea52 /src/plugins/dpdk/device
parent8419755d4c9a2b15b0f7ec12c24927aae5def405 (diff)
dpdk: add additional data to TX trace
Change-Id: I02b2b69db1e2afe62e3d3413034feb3bdcb3123e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/device.c1
-rw-r--r--src/plugins/dpdk/device/dpdk.h1
-rw-r--r--src/plugins/dpdk/device/format.c9
3 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 987596ead9b..c20a01b84eb 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -131,6 +131,7 @@ dpdk_tx_trace_buffer (dpdk_main_t * dm,
sizeof (buffer[0]) - sizeof (buffer->pre_data));
clib_memcpy (t0->buffer.pre_data, buffer->data + buffer->current_data,
sizeof (t0->buffer.pre_data));
+ clib_memcpy (&t0->data, mb->buf_addr + mb->data_off, sizeof (t0->data));
}
static_always_inline void
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index 2e17d635efb..669629293c0 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -405,6 +405,7 @@ typedef struct
struct rte_mbuf mb;
/* Copy of VLIB buffer; packet data stored in pre_data. */
vlib_buffer_t buffer;
+ u8 data[256]; /* First 256 data bytes, used for hexdump */
} dpdk_tx_dma_trace_t;
typedef struct
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index b3ccb352955..a2635c53ca4 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -587,6 +587,10 @@ format_dpdk_tx_dma_trace (u8 * s, va_list * va)
format_white_space, indent,
t->buffer_index, format_vlib_buffer, &t->buffer);
+ s = format (s, "\n%U%U",
+ format_white_space, indent,
+ format_dpdk_rte_mbuf, &t->mb, &t->data);
+
s = format (s, "\n%U%U", format_white_space, indent,
format_ethernet_header_with_length, t->buffer.pre_data,
sizeof (t->buffer.pre_data));
@@ -713,11 +717,12 @@ format_dpdk_rte_mbuf (u8 * s, va_list * va)
s = format (s, "PKT MBUF: port %d, nb_segs %d, pkt_len %d"
"\n%Ubuf_len %d, data_len %d, ol_flags 0x%x, data_off %d, phys_addr 0x%x"
- "\n%Upacket_type 0x%x",
+ "\n%Upacket_type 0x%x l2_len %u l3_len %u outer_l2_len %u outer_l3_len %u",
mb->port, mb->nb_segs, mb->pkt_len,
format_white_space, indent,
mb->buf_len, mb->data_len, mb->ol_flags, mb->data_off,
- mb->buf_physaddr, format_white_space, indent, mb->packet_type);
+ mb->buf_physaddr, format_white_space, indent, mb->packet_type,
+ mb->l2_len, mb->l3_len, mb->outer_l2_len, mb->outer_l3_len);
if (mb->ol_flags)
s = format (s, "\n%U%U", format_white_space, indent,