apps: use helper to create mbuf pools
[dpdk.git] / app / test / test_distributor_perf.c
index 48ee344..f04cb15 100644 (file)
@@ -73,7 +73,7 @@ static void
 time_cache_line_switch(void)
 {
        /* allocate a full cache line for data, we use only first byte of it */
-       uint64_t data[CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
+       uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
 
        unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
        volatile uint64_t *pdata = &data[0];
@@ -209,7 +209,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p)
        worker_idx = 0;
 }
 
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
 
 static int
 test_distributor_perf(void)
@@ -240,12 +240,8 @@ test_distributor_perf(void)
        const unsigned nb_bufs = (511 * rte_lcore_count()) < BIG_BATCH ?
                        (BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());
        if (p == NULL) {
-               p = rte_mempool_create("DPT_MBUF_POOL", nb_bufs,
-                               MBUF_SIZE, BURST,
-                               sizeof(struct rte_pktmbuf_pool_private),
-                               rte_pktmbuf_pool_init, NULL,
-                               rte_pktmbuf_init, NULL,
-                               rte_socket_id(), 0);
+               p = rte_pktmbuf_pool_create("DPT_MBUF_POOL", nb_bufs, BURST,
+                       0, MBUF_DATA_SIZE, rte_socket_id());
                if (p == NULL) {
                        printf("Error creating mempool\n");
                        return -1;