diff options
author | Olivier Matz <olivier.matz@6wind.com> | 2015-04-22 11:57:24 +0200 |
---|---|---|
committer | Thomas Monjalon <thomas.monjalon@6wind.com> | 2015-04-28 11:34:10 +0200 |
commit | ea0c20ea95fd5d71a10757e6598ac66233ea1495 (patch) | |
tree | ba13c27a236d5c2bfa39543331c6f11007f2fed0 /examples/packet_ordering/main.c | |
parent | bbd778248985e542175e9b4ce560f2d379e78c4e (diff) |
apps: use helper to create mbuf pools
When it's possible, use the new helper to create the mbuf pools.
Most of the patch is trivial, except for the following files that
have some specifics (indirect mbufs):
- ip_fragmentation
- ip_pipeline
- ipv4_multicast
- vhost
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples/packet_ordering/main.c')
-rw-r--r-- | examples/packet_ordering/main.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index f0a1b5a645..5403c3303f 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -50,7 +50,7 @@ #define MAX_PKTS_BURST 32 #define REORDER_BUFFER_SIZE 8192 #define MBUF_PER_POOL 65535 -#define MBUF_SIZE (1600 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) +#define MBUF_DATA_SIZE (1600 + RTE_PKTMBUF_HEADROOM) #define MBUF_POOL_CACHE_SIZE 250 #define RING_SIZE 16384 @@ -622,12 +622,9 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Error: number of ports must be even, except " "when using a single port\n"); - mbuf_pool = rte_mempool_create("mbuf_pool", MBUF_PER_POOL, MBUF_SIZE, - MBUF_POOL_CACHE_SIZE, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, - rte_pktmbuf_init, NULL, - rte_socket_id(), 0); + mbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", MBUF_PER_POOL, + MBUF_POOL_CACHE_SIZE, 0, MBUF_DATA_SIZE, + rte_socket_id()); if (mbuf_pool == NULL) rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); |