summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-09-11 20:54:15 -0400
committerDave Barach <openvpp@barachs.net>2017-09-15 20:56:49 +0000
commit2f9b0c05fca7ca829ea438da1d87e2bf93969500 (patch)
treee426f427c1f5da45b3815cae4f1b0400897bd6de /src/vnet
parent3e233678f13bc175e652ac0ea4a038054771ee97 (diff)
dpdk: cli to check for buffer leakage
Use buffer pre_data and existing buffer trace trajectory code to find out dpdk buffer leakages. Change-Id: I26a5d8bd2f23d01cb6070ffc3ddcc6d3d863b575 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rwxr-xr-xsrc/vnet/ip/ip4_forward.c1
-rw-r--r--src/vnet/tcp/tcp_output.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index b3de1201abc..c526003c382 100755
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -2131,6 +2131,7 @@ ip4_arp_inline (vlib_main_t * vm,
vlib_buffer_copy_trace_flag (vm, p0, bi0);
b0 = vlib_get_buffer (vm, bi0);
+ VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
vnet_buffer (b0)->sw_if_index[VLIB_TX] = sw_if_index0;
vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes);
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 9cb3e77937e..b843c926afe 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -439,14 +439,16 @@ tcp_init_mss (tcp_connection_t * tc)
always_inline int
tcp_alloc_tx_buffers (tcp_main_t * tm, u8 thread_index, u32 n_free_buffers)
{
+ vlib_main_t *vm = vlib_get_main ();
u32 current_length = vec_len (tm->tx_buffers[thread_index]);
+ u32 n_allocated;
vec_validate (tm->tx_buffers[thread_index],
current_length + n_free_buffers - 1);
- _vec_len (tm->tx_buffers[thread_index]) = current_length
- + vlib_buffer_alloc (vlib_get_main (),
- &tm->tx_buffers[thread_index][current_length],
- n_free_buffers);
+ n_allocated =
+ vlib_buffer_alloc (vm, &tm->tx_buffers[thread_index][current_length],
+ n_free_buffers);
+ _vec_len (tm->tx_buffers[thread_index]) = current_length + n_allocated;
/* buffer shortage, report failure */
if (vec_len (tm->tx_buffers[thread_index]) == 0)
{