diff options
author | Kevin Paul Herbert <kph@cisco.com> | 2015-12-15 16:56:50 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-02-04 12:42:30 +0000 |
commit | 9de836c71531afe2443b55f34c9400d7cc889f5d (patch) | |
tree | 5c84a5ad61084e20fa26a1ad52f003c7ef4bc3ed | |
parent | 078bc5676e2ea6f7af888bb019d8b963f49b4e31 (diff) |
dpdk_buffer.c: Honor clone_count even when there isn't a freelist handler
The DPDK glue did not support cloned packets which do not
have a freelist handler. Add support for this case.
Change-Id: I8f17cd4952df97989d90d3f3e39792bc3739705c
Signed-off-by: Kevin Paul Herbert <kph@cisco.com>
-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 43612a86..9db84a16 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)) { |