Skip to content

Commit

Permalink
Merge pull request ceph#18409 from liu-chunmei/fix_dpdk_assert
Browse files Browse the repository at this point in the history
Fix two dpdk assert happened in dpdk library.

Reviewed-by: Haomai Wang <[email protected]>
  • Loading branch information
yuyuyu101 authored Oct 24, 2017
2 parents bc139f0 + 857b58d commit 9f5b368
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/msg/async/dpdk/DPDK.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,17 @@ static constexpr uint16_t rx_gc_thresh = 64;
static constexpr uint16_t mbufs_per_queue_tx = 2 * default_ring_size;

static constexpr uint16_t mbuf_cache_size = 512;
//
// Size of the data buffer in the non-inline case.
//
// We may want to change (increase) this value in future, while the
// inline_mbuf_data_size value will unlikely change due to reasons described
// above.
//
static constexpr size_t mbuf_data_size = 4096;

static constexpr uint16_t mbuf_overhead =
sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM;
sizeof(struct rte_mbuf) + mbuf_data_size + RTE_PKTMBUF_HEADROOM;
//
// We'll allocate 2K data buffers for an inline case because this would require
// a single page per mbuf. If we used 4K data buffers here it would require 2
Expand All @@ -98,14 +107,6 @@ sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM;
//
static constexpr size_t inline_mbuf_data_size = 2048;

//
// Size of the data buffer in the non-inline case.
//
// We may want to change (increase) this value in future, while the
// inline_mbuf_data_size value will unlikely change due to reasons described
// above.
//
static constexpr size_t mbuf_data_size = 4096;

// (INLINE_MBUF_DATA_SIZE(2K)*32 = 64K = Max TSO/LRO size) + 1 mbuf for headers
static constexpr uint8_t max_frags = 32 + 1;
Expand Down Expand Up @@ -531,6 +532,7 @@ bool DPDKQueuePair::init_rx_mbuf_pool()
for (int i = 0; i < mbufs_per_queue_rx; i++) {
rte_mbuf* m = rte_pktmbuf_alloc(_pktmbuf_pool_rx);
assert(m);
rte_mbuf_refcnt_update(m, -1);
_rx_free_bufs.push_back(m);
}

Expand Down

0 comments on commit 9f5b368

Please sign in to comment.