aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-10-10 18:18:07 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-10 17:04:16 +0000
commit1f36a93d3d68f5ba6dcda08809394ce757cefd72 (patch)
tree1c1a091112bd8121d788bfcb38fb4b46e5aac8ac /src/plugins/dpdk
parentdf2b980dafe3912267536a8ec5198978702cea4a (diff)
dpdk: fix mempool size calculation
Change-Id: I5b48310c46ca8a2143b2132110240d7e9a52c25d Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk')
-rw-r--r--src/plugins/dpdk/buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/dpdk/buffer.c b/src/plugins/dpdk/buffer.c
index c23a42070b1..484492cb4d4 100644
--- a/src/plugins/dpdk/buffer.c
+++ b/src/plugins/dpdk/buffer.c
@@ -427,7 +427,7 @@ dpdk_buffer_pool_create (vlib_main_t * vm, unsigned num_mbufs,
vlib_physmem_region_index_t pri;
u8 *pool_name;
unsigned elt_size;
- u32 size;
+ u32 size, obj_size;
i32 i, ret;
vec_validate_aligned (dm->pktmbuf_pools, socket_id, CLIB_CACHE_LINE_BYTES);
@@ -442,7 +442,8 @@ dpdk_buffer_pool_create (vlib_main_t * vm, unsigned num_mbufs,
VLIB_BUFFER_HDR_SIZE /* priv size */ +
VLIB_BUFFER_PRE_DATA_SIZE + VLIB_BUFFER_DATA_SIZE; /*data room size */
- size = rte_mempool_xmem_size (num_mbufs, elt_size, 21);
+ obj_size = rte_mempool_calc_obj_size (elt_size, 0, 0);
+ size = rte_mempool_xmem_size (num_mbufs, obj_size, 21);
clib_error_t *error = 0;
error =