diff options
-rw-r--r-- | vlib/vlib/dpdk_buffer.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vlib/vlib/dpdk_buffer.c b/vlib/vlib/dpdk_buffer.c index 43612a86d1c..9db84a16d38 100644 --- a/vlib/vlib/dpdk_buffer.c +++ b/vlib/vlib/dpdk_buffer.c @@ -724,10 +724,13 @@ 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); - } + if (PREDICT_TRUE (b->clone_count == 0)) + { + mb = ((struct rte_mbuf *)b)-1; + ASSERT(rte_mbuf_refcnt_read(mb) == 1); + rte_pktmbuf_free (mb); + } + } } if (vec_len(bm->announce_list)) { |