[dpdk-dev] [PktGen] remove mbuf refcnt verification
Xueming Li
xuemingl at mellanox.com
Wed Oct 18 09:19:22 CEST 2017
To improve performance, dpdk drivers are using raw mbuf apis w/o refcnt
reset when returning packet to pool.
This patch remove refcnt validation when allocating mbufs from pool.
Signed-off-by: Xueming Li <xuemingl at mellanox.com>
---
lib/common/mbuf.h | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/lib/common/mbuf.h b/lib/common/mbuf.h
index 706ff3f..4c86502 100644
--- a/lib/common/mbuf.h
+++ b/lib/common/mbuf.h
@@ -81,41 +81,21 @@ pg_pktmbuf_alloc_bulk(struct rte_mempool *pool,
switch (count % 4) {
case 0:
while (idx != count) {
-#ifdef RTE_ASSERT
- RTE_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#else
- RTE_VERIFY(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#endif
rte_mbuf_refcnt_set(mbufs[idx], 1);
pktmbuf_reset(mbufs[idx]);
idx++;
/* fall-through */
case 3:
-#ifdef RTE_ASSERT
- RTE_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#else
- RTE_VERIFY(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#endif
rte_mbuf_refcnt_set(mbufs[idx], 1);
pktmbuf_reset(mbufs[idx]);
idx++;
/* fall-through */
case 2:
-#ifdef RTE_ASSERT
- RTE_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#else
- RTE_VERIFY(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#endif
rte_mbuf_refcnt_set(mbufs[idx], 1);
pktmbuf_reset(mbufs[idx]);
idx++;
/* fall-through */
case 1:
-#ifdef RTE_ASSERT
- RTE_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#else
- RTE_VERIFY(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
-#endif
rte_mbuf_refcnt_set(mbufs[idx], 1);
pktmbuf_reset(mbufs[idx]);
idx++;
--
2.13.3
More information about the dev
mailing list