From: Neale Ranns Date: Wed, 10 Jul 2019 08:48:55 +0000 (+0000) Subject: ip: Trace the packet from the punt node X-Git-Tag: v20.01-rc0~191 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=43ba29267b1f1db04cba0af1f994a5c8477ca870;hp=deb582734773958a8fab888c98c2a5501d9bc819;p=vpp.git ip: Trace the packet from the punt node Type: feature Change-Id: I01f1cc53efc93b0a7bb588ea6db89a53c971a3f5 Signed-off-by: Neale Ranns --- diff --git a/src/vnet/ip/punt_node.c b/src/vnet/ip/punt_node.c index 65237aaaa0e..8a39d118a81 100644 --- a/src/vnet/ip/punt_node.c +++ b/src/vnet/ip/punt_node.c @@ -223,6 +223,7 @@ typedef struct { punt_client_t client; u8 is_midchain; + u8 packet_data[64]; } udp_punt_trace_t; static u8 * @@ -238,6 +239,9 @@ format_udp_punt_trace (u8 * s, va_list * args) s = format (s, "\n%U(buffer is part of chain)", format_white_space, indent); } + s = format (s, "\n%U%U", format_white_space, indent, + format_hex_bytes, t->packet_data, sizeof (t->packet_data)); + return s; } @@ -327,13 +331,6 @@ punt_socket_inline (vlib_main_t * vm, struct sockaddr_un *caddr = &c->caddr; - if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED)) - { - udp_punt_trace_t *t; - t = vlib_add_trace (vm, node, b, sizeof (t[0])); - clib_memcpy_fast (&t->client, c, sizeof (t->client)); - } - /* Re-set iovecs */ vec_reset_length (ptd->iovecs); @@ -350,6 +347,16 @@ punt_socket_inline (vlib_main_t * vm, iov->iov_base = b->data + b->current_data; iov->iov_len = l = b->current_length; + if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED)) + { + udp_punt_trace_t *t; + t = vlib_add_trace (vm, node, b, sizeof (t[0])); + clib_memcpy_fast (&t->client, c, sizeof (t->client)); + clib_memcpy_fast (t->packet_data, + vlib_buffer_get_current (b), + sizeof (t->packet_data)); + } + if (PREDICT_FALSE (b->flags & VLIB_BUFFER_NEXT_PRESENT)) { do