Fix two dpdk assert happened in dpdk library. #18409
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix two assert happened in dpdk library.
1.RTE_ASSERT(mp->elt_size >= sizeof(struct rte_mbuf) +
user_mbp_priv->mbuf_data_room_size +
user_mbp_priv->mbuf_priv_size); in rte_pktmbuf_pool_init
2.RTE_ASSERT(rte_mbuf_refcnt_read(m) == 0) in rte_mbuf_raw_alloc
in DPDKQueuePair::init_rx_mbuf_pool,
_pktmbuf_pool_rx = rte_mempool_create(
name.c_str(),
mbufs_per_queue_rx, mbuf_overhead,
mbuf_cache_size,
sizeof(struct rte_pktmbuf_pool_private),
rte_pktmbuf_pool_init, as_cookie(roomsz),
rte_pktmbuf_init, nullptr,
rte_socket_id(), 0);
the mbuf_overhead(elt_size) is smaller than roomsz, so cause the first assert in dpdk library.
in DPDKQueuePair::init_rx_mbuf_pool when put _rx_free_bufs back to mempool, not clear refcnt, so when next allocate_rx_queue_mbufs cause rte_mbuf_raw_alloc assert happen.
Signed-off-by: chunmei chunmei.liu@intel.com