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>
.ring_tx_size = 128,
/* Buffer pool */
- .pool_buffer_size = 2048 + sizeof(struct rte_mbuf) +
- RTE_PKTMBUF_HEADROOM,
+ .pool_buffer_size = 2048 + RTE_PKTMBUF_HEADROOM,
.pool_size = 32 * 1024,
.pool_cache_size = 256,
{
/* Init the buffer pool */
RTE_LOG(INFO, USER1, "Creating the mbuf pool ...\n");
- app.pool = rte_mempool_create(
- "mempool",
- app.pool_size,
- app.pool_buffer_size,
- app.pool_cache_size,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(),
- 0);
+ app.pool = rte_pktmbuf_pool_create("mempool", app.pool_size,
+ app.pool_cache_size, 0, app.pool_buffer_size, rte_socket_id());
if (app.pool == NULL)
rte_panic("Cannot create mbuf pool\n");
}
#ifdef RTE_LIBRTE_PMD_XENVIRT
rte_mp = rte_mempool_gntalloc_create(pool_name, nb_mbuf, mb_size,
- (unsigned) mb_mempool_cache,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socket_id, 0);
+ (unsigned) mb_mempool_cache,
+ sizeof(struct rte_pktmbuf_pool_private),
+ rte_pktmbuf_pool_init, NULL,
+ rte_pktmbuf_init, NULL,
+ socket_id, 0);
rte_pktmbuf_init, NULL,
socket_id, 0);
else
- rte_mp = rte_mempool_create(pool_name, nb_mbuf, mb_size,
- (unsigned) mb_mempool_cache,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socket_id, 0);
+ /* wrapper to rte_mempool_create() */
+ rte_mp = rte_pktmbuf_pool_create(pool_name, nb_mbuf,
+ mb_mempool_cache, 0, mbuf_seg_size, socket_id);
#endif
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(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("DT_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("DT_MBUF_POOL", nb_bufs, BURST,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (p == NULL) {
printf("Error creating mempool\n");
return -1;
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)
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;
#define NB_MBUF 8192
#define MAX_PACKET_SZ 2048
-#define MBUF_SZ \
- (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SZ (MAX_PACKET_SZ + RTE_PKTMBUF_HEADROOM)
#define PKT_BURST_SZ 32
#define MEMPOOL_CACHE_SZ PKT_BURST_SZ
#define SOCKET 0
mp = rte_mempool_lookup("kni_mempool");
if (!mp)
- mp = rte_mempool_create("kni_mempool",
+ mp = rte_pktmbuf_pool_create("kni_mempool",
NB_MBUF,
- MBUF_SZ,
- MEMPOOL_CACHE_SZ,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init,
- NULL,
- rte_pktmbuf_init,
- NULL,
- SOCKET,
- 0);
+ MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ,
+ SOCKET);
return mp;
}
ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
ETH_TXQ_FLAGS_NOXSUMTCP)
-#define MBUF_PAYLOAD_SIZE (2048)
-#define MBUF_SIZE (MBUF_PAYLOAD_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE (250)
#define BURST_SIZE (32)
nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + DEF_PKT_BURST +
RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST;
if (test_params->mbuf_pool == NULL) {
- test_params->mbuf_pool = rte_mempool_create("MBUF_POOL", nb_mbuf_per_pool,
- MBUF_SIZE, MBUF_CACHE_SIZE, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ test_params->mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
+ nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ rte_socket_id());
TEST_ASSERT_NOT_NULL(test_params->mbuf_pool,
"rte_mempool_create failed");
}
#define RX_RING_SIZE 128
#define TX_RING_SIZE 512
-#define MBUF_PAYLOAD_SIZE (2048)
-#define MBUF_SIZE (MBUF_PAYLOAD_SIZE + sizeof(struct rte_mbuf) + \
- RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE (250)
#define BURST_SIZE (32)
if (test_params.mbuf_pool == NULL) {
nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST +
TEST_TX_DESC_MAX + MAX_PKT_BURST;
- test_params.mbuf_pool = rte_mempool_create("TEST_MODE4",
- nb_mbuf_per_pool, MBUF_SIZE, MBUF_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- socket_id, 0);
+ test_params.mbuf_pool = rte_pktmbuf_pool_create("TEST_MODE4",
+ nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socket_id);
TEST_ASSERT(test_params.mbuf_pool != NULL,
"rte_mempool_create failed\n");
#include "test.h"
-#define MBUF_SIZE 2048
+#define MBUF_DATA_SIZE 2048
#define NB_MBUF 128
#define MBUF_TEST_DATA_LEN 1464
#define MBUF_TEST_DATA_LEN2 50
#define REFCNT_MAX_TIMEOUT 10
#define REFCNT_MAX_REF (RTE_MAX_LCORE)
#define REFCNT_MBUF_NUM 64
-#define REFCNT_MBUF_SIZE (sizeof (struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define REFCNT_RING_SIZE (REFCNT_MBUF_NUM * REFCNT_MAX_REF)
#define MAKE_STRING(x) # x
/* create refcnt pool & ring if they don't exist */
if (refcnt_pool == NULL &&
- (refcnt_pool = rte_mempool_create(
- MAKE_STRING(refcnt_pool),
- REFCNT_MBUF_NUM, REFCNT_MBUF_SIZE, 0,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- SOCKET_ID_ANY, 0)) == NULL) {
+ (refcnt_pool = rte_pktmbuf_pool_create(
+ MAKE_STRING(refcnt_pool),
+ REFCNT_MBUF_NUM, 0, 0, 0,
+ SOCKET_ID_ANY)) == NULL) {
printf("%s: cannot allocate " MAKE_STRING(refcnt_pool) "\n",
__func__);
return (-1);
/* create pktmbuf pool if it does not exist */
if (pktmbuf_pool == NULL) {
- pktmbuf_pool =
- rte_mempool_create("test_pktmbuf_pool", NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- SOCKET_ID_ANY, 0);
+ pktmbuf_pool = rte_pktmbuf_pool_create("test_pktmbuf_pool",
+ NB_MBUF, 32, 0, MBUF_DATA_SIZE, SOCKET_ID_ANY);
}
if (pktmbuf_pool == NULL) {
#define NB_ETHPORTS_USED (1)
#define NB_SOCKETS (2)
#define MEMPOOL_CACHE_SIZE 250
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MAX_PKT_BURST (32)
#define RTE_TEST_RX_DESC_DEFAULT (128)
#define RTE_TEST_TX_DESC_DEFAULT (512)
if (mbufpool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
mbufpool[socketid] =
- rte_mempool_create(s, nb_mbuf, MBUF_SIZE,
- MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socketid, 0);
+ rte_pktmbuf_pool_create(s, nb_mbuf,
+ MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socketid);
if (mbufpool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
#define RING_SIZE 256
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 512
static int
static int
test_pmd_ring(void)
{
- mp = rte_mempool_create("mbuf_pool", NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ mp = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (mp == NULL)
return -1;
#define REORDER_BUFFER_SIZE 16384
#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
#define REORDER_BUFFER_SIZE_INVALID 2049
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
struct reorder_unittest_params {
struct rte_mempool *p;
/* mempool creation */
if (test_params->p == NULL) {
- test_params->p = rte_mempool_create("RO_MBUF_POOL", NUM_MBUFS,
- MBUF_SIZE, BURST,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ test_params->p = rte_pktmbuf_pool_create("RO_MBUF_POOL",
+ NUM_MBUFS, BURST, 0, MBUF_DATA_SIZE, rte_socket_id());
if (test_params->p == NULL) {
printf("%s: Error creating mempool\n", __func__);
return -1;
};
#define NB_MBUF 32
-#define MAX_PACKET_SZ 2048
-#define MBUF_SZ (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SZ (2048 + RTE_PKTMBUF_HEADROOM)
#define PKT_BURST_SZ 32
#define MEMPOOL_CACHE_SZ PKT_BURST_SZ
#define SOCKET 0
mp = rte_mempool_lookup("test_sched");
if (!mp)
- mp = rte_mempool_create("test_sched",
- NB_MBUF,
- MBUF_SZ,
- MEMPOOL_CACHE_SZ,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init,
- NULL,
- rte_pktmbuf_init,
- NULL,
- SOCKET,
- 0);
+ mp = rte_pktmbuf_pool_create("test_sched", NB_MBUF,
+ MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, SOCKET);
return mp;
}
printf("Getting/Creating the mempool ...\n");
pool = rte_mempool_lookup("mempool");
if (!pool) {
- pool = rte_mempool_create(
+ pool = rte_pktmbuf_pool_create(
"mempool",
POOL_SIZE,
- POOL_BUFFER_SIZE,
- POOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- 0,
+ POOL_CACHE_SIZE, 0, POOL_BUFFER_SIZE,
0);
if (pool == NULL)
rte_panic("Cannot create mbuf pool\n");
#define PORT_TX_RING_SIZE 512
#define RING_RX_SIZE 128
#define RING_TX_SIZE 128
-#define POOL_BUFFER_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define POOL_BUFFER_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define POOL_SIZE (32 * 1024)
#define POOL_CACHE_SIZE 256
#define BURST_SIZE 8
#define MAX_DUMMY_PORTS 2
#define MP_NAME "dummy_port_mempool"
#define MBUF_COUNT (8000 * MAX_DUMMY_PORTS)
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define MP_CACHE_SZ 256
#define MP_SOCKET 0
#define MP_FLAGS 0
#define RTE_LOGTYPE_DCB RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF (1024*8)
#define MAX_PKT_BURST 32
else if (nb_ports > MAX_PORTS)
rte_exit(EXIT_FAILURE, "You can have max 4 ports\n");
- mbuf_pool = rte_mempool_create("MBUF_POOL", NB_MBUF,
- MBUF_SIZE, 32,
- 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", NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
#define RX_RING_SIZE 256
#define TX_RING_SIZE 512
#define NUM_MBUFS ((64*1024)-1)
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
#define RTE_RING_SZ 1024
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", NUM_MBUFS * nb_ports,
- MBUF_SIZE, MBUF_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",
+ NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
nb_ports_available = nb_ports;
#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
static int
init_mem(void)
{
- const unsigned flags = 0;
int socketid;
unsigned lcoreid;
char s[64];
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;
#define MAX_PORTS (RTE_MAX_LCORE / 2)
/* Max size of a single packet */
-#define MAX_PACKET_SZ 2048
+#define MAX_PACKET_SZ (2048)
-/* Number of bytes needed for each mbuf */
-#define MBUF_SZ \
- (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+/* Size of the data buffer in each mbuf */
+#define MBUF_DATA_SZ (MAX_PACKET_SZ + RTE_PKTMBUF_HEADROOM)
/* Number of mbufs in mempool that is created */
#define NB_MBUF 8192
parse_args(argc, argv);
/* Create the mbuf pool */
- pktmbuf_pool = rte_mempool_create("mbuf_pool", NB_MBUF, MBUF_SZ,
- MEMPOOL_CACHE_SZ,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF,
+ MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, rte_socket_id());
if (pktmbuf_pool == NULL) {
FATAL_ERROR("Could not initialise mbuf pool");
return -1;
#define RTE_LOGTYPE_IP_FRAG RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/* allow max jumbo frame 9.5 KB */
#define JUMBO_FRAME_MAX_SIZE 0x2600
socket);
snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
- mp = rte_mempool_create(buf, NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socket, 0);
+ mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, socket);
if (mp == NULL) {
RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
return -1;
socket);
snprintf(buf, sizeof(buf), "pool_indirect_%i", socket);
- mp = rte_mempool_create(buf, NB_MBUF,
- sizeof(struct rte_mbuf), 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socket, 0);
+ mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, 0,
+ socket);
if (mp == NULL) {
RTE_LOG(ERR, IP_FRAG, "Cannot create indirect mempool\n");
return -1;
.bsz_swq_wr = 64,
/* Buffer pool */
- .pool_buffer_size = 2048 + sizeof(struct rte_mbuf) +
- RTE_PKTMBUF_HEADROOM,
+ .pool_buffer_size = 2048 + RTE_PKTMBUF_HEADROOM,
.pool_size = 32 * 1024,
.pool_cache_size = 256,
static void
app_init_mbuf_pools(void)
{
- struct rte_pktmbuf_pool_private indirect_mbp_priv;
-
/* Init the buffer pool */
RTE_LOG(INFO, USER1, "Creating the mbuf pool ...\n");
- app.pool = rte_mempool_create(
- "mempool",
- app.pool_size,
- app.pool_buffer_size,
- app.pool_cache_size,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(),
- 0);
+ app.pool = rte_pktmbuf_pool_create("mempool", app.pool_size,
+ app.pool_cache_size, 0, app.pool_buffer_size, rte_socket_id());
if (app.pool == NULL)
rte_panic("Cannot create mbuf pool\n");
/* Init the indirect buffer pool */
RTE_LOG(INFO, USER1, "Creating the indirect mbuf pool ...\n");
- indirect_mbp_priv.mbuf_data_room_size = 0;
- indirect_mbp_priv.mbuf_priv_size = sizeof(struct app_pkt_metadata);
- app.indirect_pool = rte_mempool_create(
- "indirect mempool",
- app.pool_size,
- sizeof(struct rte_mbuf) + sizeof(struct app_pkt_metadata),
- app.pool_cache_size,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, &indirect_mbp_priv,
- rte_pktmbuf_init, NULL,
- rte_socket_id(),
- 0);
+ app.indirect_pool = rte_pktmbuf_pool_create("indirect mempool",
+ app.pool_size, app.pool_cache_size,
+ sizeof(struct app_pkt_metadata), 0, rte_socket_id());
if (app.indirect_pool == NULL)
rte_panic("Cannot create mbuf pool\n");
#define MCAST_CLONE_PORTS 2
#define MCAST_CLONE_SEGS 2
-#define PKT_MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define PKT_MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_PKT_MBUF 8192
-#define HDR_MBUF_SIZE (sizeof(struct rte_mbuf) + 2 * RTE_PKTMBUF_HEADROOM)
+#define HDR_MBUF_DATA_SIZE (2 * RTE_PKTMBUF_HEADROOM)
#define NB_HDR_MBUF (NB_PKT_MBUF * MAX_PORTS)
-#define CLONE_MBUF_SIZE (sizeof(struct rte_mbuf))
#define NB_CLONE_MBUF (NB_PKT_MBUF * MCAST_CLONE_PORTS * MCAST_CLONE_SEGS * 2)
/* allow max jumbo frame 9.5 KB */
rte_exit(EXIT_FAILURE, "Invalid IPV4_MULTICAST parameters\n");
/* create the mbuf pools */
- packet_pool = rte_mempool_create("packet_pool", NB_PKT_MBUF,
- PKT_MBUF_SIZE, 32, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ packet_pool = rte_pktmbuf_pool_create("packet_pool", NB_PKT_MBUF, 32,
+ 0, PKT_MBUF_DATA_SIZE, rte_socket_id());
if (packet_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init packet mbuf pool\n");
- header_pool = rte_mempool_create("header_pool", NB_HDR_MBUF,
- HDR_MBUF_SIZE, 32, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ header_pool = rte_pktmbuf_pool_create("header_pool", NB_HDR_MBUF, 32,
+ 0, HDR_MBUF_DATA_SIZE, rte_socket_id());
if (header_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init header mbuf pool\n");
- clone_pool = rte_mempool_create("clone_pool", NB_CLONE_MBUF,
- CLONE_MBUF_SIZE, 32, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ clone_pool = rte_pktmbuf_pool_create("clone_pool", NB_CLONE_MBUF, 32,
+ 0, 0, rte_socket_id());
if (clone_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n");
/* Max size of a single packet */
#define MAX_PACKET_SZ 2048
-/* Number of bytes needed for each mbuf */
-#define MBUF_SZ \
- (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+/* Size of the data buffer in each mbuf */
+#define MBUF_DATA_SZ (MAX_PACKET_SZ + RTE_PKTMBUF_HEADROOM)
/* Number of mbufs in mempool that is created */
#define NB_MBUF (8192 * 16)
rte_exit(EXIT_FAILURE, "Could not parse input parameters\n");
/* Create the mbuf pool */
- pktmbuf_pool = rte_mempool_create("mbuf_pool", NB_MBUF, MBUF_SZ,
- MEMPOOL_CACHE_SZ,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF,
+ MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, rte_socket_id());
if (pktmbuf_pool == NULL) {
rte_exit(EXIT_FAILURE, "Could not initialise mbuf pool\n");
return -1;
static struct ether_addr l2fwd_ivshmem_ports_eth_addr[RTE_MAX_ETHPORTS];
#define NB_MBUF 8192
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MAX_RX_QUEUE_PER_LCORE 16
#define MAX_TX_QUEUE_PER_PORT 16
/* create a shared mbuf pool */
l2fwd_ivshmem_pktmbuf_pool =
- rte_mempool_create(MBUF_MP_NAME, NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ rte_pktmbuf_pool_create(MBUF_MP_NAME, NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (l2fwd_ivshmem_pktmbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
/* create the mbuf pool */
l2fwd_pktmbuf_pool =
- rte_mempool_create("mbuf_pool", NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (l2fwd_pktmbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
/* create the mbuf pool */
- l2fwd_pktmbuf_pool =
- rte_mempool_create("mbuf_pool", NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (l2fwd_pktmbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* This expression is used to calculate the number of mbufs needed
if (pktmbuf_pool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
- rte_mempool_create(s, nb_mbuf, MBUF_SIZE,
- MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socketid, 0);
+ rte_pktmbuf_pool_create(s, nb_mbuf,
+ MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* This expression is used to calculate the number of mbufs needed depending on
if (pktmbuf_pool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
- rte_mempool_create(s, nb_mbuf,
- MBUF_SIZE, MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socketid, 0);
+ rte_pktmbuf_pool_create(s, nb_mbuf,
+ MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* This expression is used to calculate the number of mbufs needed depending on user input, taking
}
if (pktmbuf_pool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
- pktmbuf_pool[socketid] =
- rte_mempool_create(s, nb_mbuf, MBUF_SIZE,
- MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socketid, 0);
+ pktmbuf_pool[socketid] = rte_pktmbuf_pool_create(s,
+ nb_mbuf, MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool on socket %d\n", socketid);
else
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* This expression is used to calculate the number of mbufs needed depending on user input, taking
if (pktmbuf_pool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
- rte_mempool_create(s, nb_mbuf, MBUF_SIZE, MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socketid, 0);
+ rte_pktmbuf_pool_create(s, nb_mbuf,
+ MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n", socketid);
#define RTE_LOGTYPE_LSI RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
/* create the mbuf pool */
lsi_pktmbuf_pool =
- rte_mempool_create("mbuf_pool", NB_MBUF,
- MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32, 0,
+ MBUF_DATA_SIZE, rte_socket_id());
if (lsi_pktmbuf_pool == NULL)
rte_panic("Cannot init mbuf pool\n");
snprintf(name, sizeof(name), "mbuf_pool_%u", socket);
printf("Creating the mbuf pool for socket %u ...\n", socket);
- app.pools[socket] = rte_mempool_create(
- name,
- APP_DEFAULT_MEMPOOL_BUFFERS,
- APP_DEFAULT_MBUF_SIZE,
+ app.pools[socket] = rte_pktmbuf_pool_create(
+ name, APP_DEFAULT_MEMPOOL_BUFFERS,
APP_DEFAULT_MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- socket,
- 0);
+ 0, APP_DEFAULT_MBUF_DATA_SIZE, socket);
if (app.pools[socket] == NULL) {
rte_panic("Cannot create mbuf pool on socket %u\n", socket);
}
/* Mempools */
-#ifndef APP_DEFAULT_MBUF_SIZE
-#define APP_DEFAULT_MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#ifndef APP_DEFAULT_MBUF_DATA_SIZE
+#define APP_DEFAULT_MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#endif
#ifndef APP_DEFAULT_MEMPOOL_BUFFERS
#define MBUFS_PER_CLIENT 1536
#define MBUFS_PER_PORT 1536
#define MBUF_CACHE_SIZE 512
-#define MBUF_OVERHEAD (sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
-#define RX_MBUF_DATA_SIZE 2048
-#define MBUF_SIZE (RX_MBUF_DATA_SIZE + MBUF_OVERHEAD)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define RTE_MP_RX_DESC_DEFAULT 512
#define RTE_MP_TX_DESC_DEFAULT 512
* seems faster to use a cache instead */
printf("Creating mbuf pool '%s' [%u mbufs] ...\n",
PKTMBUF_POOL_NAME, num_mbufs);
- pktmbuf_pool = rte_mempool_create(PKTMBUF_POOL_NAME, num_mbufs,
- MBUF_SIZE, MBUF_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init,
- NULL, rte_pktmbuf_init, NULL, rte_socket_id(), NO_FLAGS );
+ pktmbuf_pool = rte_pktmbuf_pool_create(PKTMBUF_POOL_NAME, num_mbufs,
+ MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
return (pktmbuf_pool == NULL); /* 0 on success */
}
#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUFS 64*1024 /* use 64k mbufs */
#define MBUF_CACHE_SIZE 256
#define PKT_BURST 32
proc_type = rte_eal_process_type();
mp = (proc_type == RTE_PROC_SECONDARY) ?
rte_mempool_lookup(_SMP_MBUF_POOL) :
- rte_mempool_create(_SMP_MBUF_POOL, NB_MBUFS, MBUF_SIZE,
- MBUF_CACHE_SIZE, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ rte_pktmbuf_pool_create(_SMP_MBUF_POOL, NB_MBUFS,
+ MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ rte_socket_id());
if (mp == NULL)
rte_exit(EXIT_FAILURE, "Cannot get memory pool for buffers\n");
#include "compat_netmap.h"
-#define BUF_SIZE 2048
-#define MBUF_SIZE (BUF_SIZE + sizeof(struct rte_mbuf) + \
- RTE_PKTMBUF_HEADROOM)
+#define BUF_SIZE (2048)
+#define MBUF_DATA_SIZE (BUF_SIZE + RTE_PKTMBUF_HEADROOM)
#define MBUF_PER_POOL 8192
if (rte_eth_dev_count() < 1)
rte_exit(EXIT_FAILURE, "Not enough ethernet ports available\n");
- pool = rte_mempool_create("mbuf_pool", MBUF_PER_POOL, MBUF_SIZE, 32,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_socket_id(), 0);
+ pool = rte_pktmbuf_pool_create("mbuf_pool", MBUF_PER_POOL, 32, 0,
+ MBUF_DATA_SIZE, rte_socket_id());
if (pool == NULL)
rte_exit(EXIT_FAILURE, "Couldn't create mempool\n");
#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
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));
* Buffer pool configuration
*
***/
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MEMPOOL_CACHE_SIZE 256
rte_exit(EXIT_FAILURE, "Invalid input arguments\n");
/* Buffer pool init */
- pool = rte_mempool_create("pool", NB_MBUF, MBUF_SIZE, MEMPOOL_CACHE_SIZE,
- sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL, rte_socket_id(), 0);
+ pool = rte_pktmbuf_pool_create("pool", NB_MBUF, MEMPOOL_CACHE_SIZE,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (pool == NULL)
rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
/* create the mbuf pools for each RX Port */
snprintf(pool_name, MAX_NAME_LEN, "mbuf_pool%u", i);
- qos_conf[i].mbuf_pool = rte_mempool_create(pool_name, mp_size, MBUF_SIZE,
- burst_conf.rx_burst * 4,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL,
- rte_eth_dev_socket_id(qos_conf[i].rx_port),
- 0);
+ qos_conf[i].mbuf_pool = rte_pktmbuf_pool_create(pool_name,
+ mp_size, burst_conf.rx_burst * 4, 0, MBUF_DATA_SIZE,
+ rte_eth_dev_socket_id(qos_conf[i].rx_port));
if (qos_conf[i].mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool for socket %u\n", i);
#define APP_RX_DESC_DEFAULT 128
#define APP_TX_DESC_DEFAULT 256
-#define MBUF_SIZE (1528 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (1528 + RTE_PKTMBUF_HEADROOM)
#define APP_RING_SIZE (8*1024)
#define NB_MBUF (2*1024*1024)
#define RX_DESC_PER_QUEUE 128
#define TX_DESC_PER_QUEUE 512
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_PER_POOL 8192
#define QUOTA_WATERMARK_MEMZONE_NAME "qw_global_vars"
rte_exit(EXIT_FAILURE, "Invalid quota/watermark argument(s)\n");
/* Create a pool of mbuf to store packets */
- mbuf_pool = rte_mempool_create("mbuf_pool", MBUF_PER_POOL, MBUF_SIZE, 32,
- 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, 32, 0,
+ MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_panic("%s\n", rte_strerror(rte_errno));
#define TX_RING_SIZE 512
#define NUM_MBUFS 8191
-#define MBUF_SIZE (1600 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (1600 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
if (nb_ports < 2 || (nb_ports & 1))
rte_exit(EXIT_FAILURE, "Error: number of ports must be even\n");
- mbuf_pool = rte_mempool_create("MBUF_POOL", NUM_MBUFS * nb_ports,
- MBUF_SIZE, MBUF_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",
+ NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
#define TX_RING_SIZE 512
#define NUM_MBUFS 8191
-#define MBUF_SIZE (1600 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (1600 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
rte_exit(EXIT_FAILURE, "Error: number of ports must be even\n");
/* Creates a new mempool in memory to hold the mbufs. */
- mbuf_pool = rte_mempool_create("MBUF_POOL",
- NUM_MBUFS * nb_ports,
- MBUF_SIZE,
- MBUF_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", NUM_MBUFS * nb_ports,
+ MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
(num_switching_cores*MBUF_CACHE_SIZE))
#define MBUF_CACHE_SIZE 128
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* No frame data buffer allocated from host are required for zero copy
* directly use it.
*/
#define VIRTIO_DESCRIPTOR_LEN_ZCP 1518
-#define MBUF_SIZE_ZCP (VIRTIO_DESCRIPTOR_LEN_ZCP + sizeof(struct rte_mbuf) \
- + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE_ZCP (VIRTIO_DESCRIPTOR_LEN_ZCP + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE_ZCP 0
#define MAX_PKT_BURST 32 /* Max burst size for RX/TX */
setup_mempool_tbl(int socket, uint32_t index, char *pool_name,
char *ring_name, uint32_t nb_mbuf)
{
- vpool_array[index].pool
- = rte_mempool_create(pool_name, nb_mbuf, MBUF_SIZE_ZCP,
- MBUF_CACHE_SIZE_ZCP, sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL,
- rte_pktmbuf_init, NULL, socket, 0);
+ vpool_array[index].pool = rte_pktmbuf_pool_create(pool_name, nb_mbuf,
+ MBUF_CACHE_SIZE_ZCP, 0, MBUF_DATA_SIZE_ZCP, socket);
if (vpool_array[index].pool != NULL) {
vpool_array[index].ring
= rte_ring_create(ring_name,
if (zero_copy == 0) {
/* Create the mbuf pool. */
- mbuf_pool = rte_mempool_create(
- "MBUF_POOL",
- NUM_MBUFS_PER_PORT
- * valid_num_ports,
- MBUF_SIZE, MBUF_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",
+ NUM_MBUFS_PER_PORT * valid_num_ports, MBUF_CACHE_SIZE,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
(num_switching_cores*MBUF_CACHE_SIZE))
#define MBUF_CACHE_SIZE 64
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
/*
* RX and TX Prefetch, Host, and Write-back threshold values should be
}
/* Create the mbuf pool. */
- mbuf_pool = rte_mempool_create("MBUF_POOL", NUM_MBUFS_PER_PORT * valid_num_ports,
- MBUF_SIZE, MBUF_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",
+ NUM_MBUFS_PER_PORT * valid_num_ports, MBUF_CACHE_SIZE, 0,
+ MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
*/
#define NUM_MBUFS_PER_PORT (128*512)
#define MBUF_CACHE_SIZE 64
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MAX_PKT_BURST 32
rte_exit(EXIT_FAILURE, "Error with valid ports number is not even or less than 2\n");
}
- mbuf_pool = rte_mempool_create("MBUF_POOL", NUM_MBUFS_PER_PORT * nb_ports,
- MBUF_SIZE, MBUF_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",
+ NUM_MBUFS_PER_PORT * nb_ports, MBUF_CACHE_SIZE,
+ 0, MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
#define NUM_MBUFS 64*1024
#define MBUF_CACHE_SIZE 64
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define INVALID_PORT_ID 0xFF
rte_exit(EXIT_FAILURE, "Error with valid ports number is not even or less than 2\n");
}
- mbuf_pool = rte_mempool_create("MBUF_POOL", NUM_MBUFS * nb_ports,
- MBUF_SIZE, MBUF_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", NUM_MBUFS * nb_ports,
+ MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
struct bond_dev_private *internals = bond_dev->data->dev_private;
struct client_data *hash_table = internals->mode6.client_table;
- uint16_t element_size;
+ uint16_t data_size;
char mem_name[RTE_ETH_NAME_MAX_LEN];
int socket_id = bond_dev->pci_dev->numa_node;
* 256 is size of ETH header, ARP header and nested VLAN headers.
* The value is chosen to be cache aligned.
*/
- element_size = 256 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM;
+ data_size = 256 + RTE_PKTMBUF_HEADROOM;
snprintf(mem_name, sizeof(mem_name), "%s_MODE6", bond_dev->data->name);
- internals->mode6.mempool = rte_mempool_create(mem_name,
- 512 * RTE_MAX_ETHPORTS,
- element_size,
- RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
- 32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
- sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init,
- NULL, rte_pktmbuf_init, NULL, socket_id, 0);
+ internals->mode6.mempool = rte_pktmbuf_pool_create(mem_name,
+ 512 * RTE_MAX_ETHPORTS,
+ RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
+ 32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
+ 0, data_size, socket_id);
if (internals->mode6.mempool == NULL) {
RTE_LOG(ERR, PMD, "%s: Failed to initialize ALB mempool.\n",