apps: use helper to create mbuf pools
[dpdk.git] / examples / dpdk_qat / main.c
index 127ee40..053be91 100644 (file)
@@ -47,7 +47,6 @@
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
 #include <rte_ip.h>
 #include <rte_string_fns.h>
 
-#include "main.h"
 #include "crypto.h"
 
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
 #define NB_MBUF   (32 * 1024)
 
 #define MAX_PKT_BURST 32
@@ -600,7 +598,6 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
 static int
 init_mem(void)
 {
-       const unsigned flags = 0;
        int socketid;
        unsigned lcoreid;
        char s[64];
@@ -615,11 +612,8 @@ init_mem(void)
                if (pktmbuf_pool[socketid] == NULL) {
                        snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
                        pktmbuf_pool[socketid] =
-                               rte_mempool_create(s, NB_MBUF, MBUF_SIZE, 32,
-                                       sizeof(struct rte_pktmbuf_pool_private),
-                                       rte_pktmbuf_pool_init, NULL,
-                                       rte_pktmbuf_init, NULL,
-                                       socketid, flags);
+                               rte_pktmbuf_pool_create(s, NB_MBUF, 32, 0,
+                                       MBUF_DATA_SIZE, socketid);
                        if (pktmbuf_pool[socketid] == NULL) {
                                printf("Cannot init mbuf pool on socket %d\n", socketid);
                                return -1;
@@ -631,7 +625,7 @@ init_mem(void)
 }
 
 int
-MAIN(int argc, char **argv)
+main(int argc, char **argv)
 {
        struct lcore_conf *qconf;
        struct rte_eth_link link;