summaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorKevin Paul Herbert <kph@cisco.com>2015-12-15 16:33:13 -0800
committerGerrit Code Review <gerrit@fd.io>2016-01-27 18:58:26 +0000
commitda8d4450553ef09aff64eeecb774cb6abecabdb0 (patch)
tree40d4b096b27de61d781f5ec40e99df355bf59c0c /vlib
parentcf121e3d5135c1c06ccca35372126baf5559e144 (diff)
dpdk_buffer.c: Ensure that the mbuf reference count is as expected
Add some more ASSERTs to track down improper frees. Change-Id: I2bd4b69fb14f522c82e6006131b6ad982f6f7e6b Signed-off-by: Kevin Paul Herbert <kph@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/dpdk_buffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vlib/vlib/dpdk_buffer.c b/vlib/vlib/dpdk_buffer.c
index 68c1fcdb4b6..43612a86d1c 100644
--- a/vlib/vlib/dpdk_buffer.c
+++ b/vlib/vlib/dpdk_buffer.c
@@ -401,11 +401,13 @@ del_free_list (vlib_main_t * vm, vlib_buffer_free_list_t * f)
for (i = 0; i < vec_len (f->unaligned_buffers); i++) {
b = vlib_get_buffer (vm, f->unaligned_buffers[i]);
mb = ((struct rte_mbuf *)b)-1;
+ ASSERT(rte_mbuf_refcnt_read(mb) == 1);
rte_pktmbuf_free (mb);
}
for (i = 0; i < vec_len (f->aligned_buffers); i++) {
b = vlib_get_buffer (vm, f->aligned_buffers[i]);
mb = ((struct rte_mbuf *)b)-1;
+ ASSERT(rte_mbuf_refcnt_read(mb) == 1);
rte_pktmbuf_free (mb);
}
vec_free (f->name);
@@ -723,6 +725,7 @@ vlib_buffer_free_inline (vlib_main_t * vm,
else
{
mb = ((struct rte_mbuf *)b)-1;
+ ASSERT(rte_mbuf_refcnt_read(mb) == 1);
rte_pktmbuf_free (mb);
}
}