From: Mohsin Kazmi Date: Tue, 11 Jan 2022 11:34:56 +0000 (+0000) Subject: vlib: fix the total len not including first buffer formating X-Git-Tag: v22.06-rc0~34 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=30d46e7455b20c46d97ad04f72afce3995e4a2c4;p=vpp.git vlib: fix the total len not including first buffer formating Type: fix total len not including first buffer is in vlib_buffer_t second cacheline. It is not reset after the buffer has been consumed. It leads to printing garbage in packet trace for subsequent use of this buffer. This patch fixes the issue to only print when VLIB_BUFFER_NEXT_PRESENT flag is set. Signed-off-by: Mohsin Kazmi Change-Id: Ied72308bdb907a5e1ca16d181f2add062807e968 --- diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index 71f84d377af..7a70a8abdd3 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -107,7 +107,7 @@ format_vlib_buffer_no_chain (u8 * s, va_list * args) "ref-count %u", b->current_data, b->current_length, b->buffer_pool_index, b->ref_count); - if (b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID) + if (b->flags & VLIB_BUFFER_NEXT_PRESENT) s = format (s, ", totlen-nifb %d", b->total_length_not_including_first_buffer);