* Default size of the mbuf data buffer to receive standard 1518-byte
* Ethernet frames in a mono-segment memory buffer.
*/
-#define DEFAULT_MBUF_DATA_SIZE 2048 /**< Default size of mbuf data buffer. */
+#define DEFAULT_MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
+/**< Default size of mbuf data buffer. */
/*
* The maximum number of segments per packet is used when creating
worker_idx = 0;
}
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
static int
test_distributor(void)
{
(BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());
if (p == NULL) {
p = rte_pktmbuf_pool_create("DT_MBUF_POOL", nb_bufs, BURST,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
if (p == NULL) {
printf("Error creating mempool\n");
return -1;
worker_idx = 0;
}
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
static int
test_distributor_perf(void)
{
(BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());
if (p == NULL) {
p = rte_pktmbuf_pool_create("DPT_MBUF_POOL", nb_bufs, BURST,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
if (p == NULL) {
printf("Error creating mempool\n");
return -1;
ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
ETH_TXQ_FLAGS_NOXSUMTCP)
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE (250)
#define BURST_SIZE (32)
-#define DEFAULT_MBUF_DATA_SIZE (2048)
#define RTE_TEST_RX_DESC_MAX (2048)
#define RTE_TEST_TX_DESC_MAX (2048)
#define MAX_PKT_BURST (512)
RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST;
if (test_params->mbuf_pool == NULL) {
test_params->mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
- nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- rte_socket_id());
+ nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE (250)
#define BURST_SIZE (32)
-#define DEFAULT_MBUF_DATA_SIZE (2048)
#define TEST_RX_DESC_MAX (2048)
#define TEST_TX_DESC_MAX (2048)
#define MAX_PKT_BURST (32)
nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST +
TEST_TX_DESC_MAX + MAX_PKT_BURST;
test_params.mbuf_pool = rte_pktmbuf_pool_create("TEST_MODE4",
- nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- socket_id);
+ nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE, socket_id);
TEST_ASSERT(test_params.mbuf_pool != NULL,
"rte_mempool_create failed\n");
#define NB_ETHPORTS_USED (1)
#define NB_SOCKETS (2)
#define MEMPOOL_CACHE_SIZE 250
-#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)
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
mbufpool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
- MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- socketid);
+ MEMPOOL_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE, socketid);
if (mbufpool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
#define RING_SIZE 256
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 512
static int
test_pmd_ring(void)
{
mp = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_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_pktmbuf_pool_create("RO_MBUF_POOL",
- NUM_MBUFS, BURST, 0, MBUF_DATA_SIZE, rte_socket_id());
+ NUM_MBUFS, BURST, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
+ rte_socket_id());
if (test_params->p == NULL) {
printf("%s: Error creating mempool\n", __func__);
return -1;
#define PORT_TX_RING_SIZE 512
#define RING_RX_SIZE 128
#define RING_TX_SIZE 128
-#define POOL_BUFFER_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
+#define POOL_BUFFER_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
#define POOL_SIZE (32 * 1024)
#define POOL_CACHE_SIZE 256
#define BURST_SIZE 8
#define RTE_LOGTYPE_DCB RTE_LOGTYPE_USER1
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF (1024*8)
#define MAX_PKT_BURST 32
rte_exit(EXIT_FAILURE, "You can have max 4 ports\n");
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
#define RTE_RING_SZ 1024
"when using a single port\n");
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
- NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- rte_socket_id());
+ NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF (32 * 1024)
#define MAX_PKT_BURST 32
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_pktmbuf_pool_create(s, NB_MBUF, 32, 0,
- MBUF_DATA_SIZE, socketid);
+ RTE_MBUF_DEFAULT_BUF_SIZE, socketid);
if (pktmbuf_pool[socketid] == NULL) {
printf("Cannot init mbuf pool on socket %d\n", socketid);
return -1;
#define RTE_LOGTYPE_IP_FRAG RTE_LOGTYPE_USER1
-#define MBUF_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
/* allow max jumbo frame 9.5 KB */
#define JUMBO_FRAME_MAX_SIZE 0x2600
snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, socket);
+ 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);
if (mp == NULL) {
RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
return -1;
.bsz_swq_wr = 64,
/* Buffer pool */
- .pool_buffer_size = 2048 + RTE_PKTMBUF_HEADROOM,
+ .pool_buffer_size = RTE_MBUF_DEFAULT_BUF_SIZE,
.pool_size = 32 * 1024,
.pool_cache_size = 256,
#define MAX_JUMBO_PKT_LEN 9600
-#define BUF_SIZE 2048
+#define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
#define MBUF_SIZE \
(BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define MCAST_CLONE_PORTS 2
#define MCAST_CLONE_SEGS 2
-#define PKT_MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
+#define PKT_MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
#define NB_PKT_MBUF 8192
#define HDR_MBUF_DATA_SIZE (2 * RTE_PKTMBUF_HEADROOM)
static struct ether_addr l2fwd_ivshmem_ports_eth_addr[RTE_MAX_ETHPORTS];
#define NB_MBUF 8192
-#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_pktmbuf_pool_create(MBUF_MP_NAME, NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
/* create the mbuf pool */
l2fwd_pktmbuf_pool =
rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
/* create the mbuf pool */
l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
/*
* This expression is used to calculate the number of mbufs needed
* depending on user input, taking into account memory for rx and tx hardware
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
- MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ MEMPOOL_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
/*
* This expression is used to calculate the number of mbufs needed depending on
* user input, taking into account memory for rx and tx hardware rings, cache
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
- MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ MEMPOOL_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
socketid);
if (pktmbuf_pool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
#define MEMPOOL_CACHE_SIZE 256
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
/*
* This expression is used to calculate the number of mbufs needed depending on user input, taking
* into account memory for rx and tx hardware rings, cache per lcore and mtable per port per lcore.
if (pktmbuf_pool[socketid] == NULL) {
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] = rte_pktmbuf_pool_create(s,
- nb_mbuf, MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- socketid);
+ nb_mbuf, MEMPOOL_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
-
/*
* This expression is used to calculate the number of mbufs needed depending on user input, taking
* into account memory for rx and tx hardware rings, cache per lcore and mtable per port per lcore.
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
- MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- socketid);
+ MEMPOOL_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MAX_PKT_BURST 32
/* create the mbuf pool */
lsi_pktmbuf_pool =
rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32, 0,
- MBUF_DATA_SIZE, rte_socket_id());
+ RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
if (lsi_pktmbuf_pool == NULL)
rte_panic("Cannot init mbuf pool\n");
/* Mempools */
#ifndef APP_DEFAULT_MBUF_DATA_SIZE
-#define APP_DEFAULT_MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
+#define APP_DEFAULT_MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
#endif
#ifndef APP_DEFAULT_MEMPOOL_BUFFERS
#define MBUFS_PER_CLIENT 1536
#define MBUFS_PER_PORT 1536
#define MBUF_CACHE_SIZE 512
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define RTE_MP_RX_DESC_DEFAULT 512
#define RTE_MP_TX_DESC_DEFAULT 512
printf("Creating mbuf pool '%s' [%u mbufs] ...\n",
PKTMBUF_POOL_NAME, num_mbufs);
pktmbuf_pool = rte_pktmbuf_pool_create(PKTMBUF_POOL_NAME, num_mbufs,
- MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
+ MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
return (pktmbuf_pool == NULL); /* 0 on success */
}
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
#define MBUF_NAME "mbuf_pool_%d"
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_SIZE \
+(RTE_MBUF_DEFAULT_DATAROOM + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define RING_MASTER_NAME "l2fwd_ring_m2s_"
#define RING_SLAVE_NAME "l2fwd_ring_s2m_"
#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
-#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
mp = (proc_type == RTE_PROC_SECONDARY) ?
rte_mempool_lookup(_SMP_MBUF_POOL) :
rte_pktmbuf_pool_create(_SMP_MBUF_POOL, NB_MBUFS,
- MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_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 BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
#define MBUF_DATA_SIZE (BUF_SIZE + RTE_PKTMBUF_HEADROOM)
#define MBUF_PER_POOL 8192
#define MAX_PKTS_BURST 32
#define REORDER_BUFFER_SIZE 8192
#define MBUF_PER_POOL 65535
-#define MBUF_DATA_SIZE (1600 + RTE_PKTMBUF_HEADROOM)
#define MBUF_POOL_CACHE_SIZE 250
#define RING_SIZE 16384
"when using a single port\n");
mbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", MBUF_PER_POOL,
- MBUF_POOL_CACHE_SIZE, 0, MBUF_DATA_SIZE,
+ MBUF_POOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
* Buffer pool configuration
*
***/
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define NB_MBUF 8192
#define MEMPOOL_CACHE_SIZE 256
/* Buffer pool init */
pool = rte_pktmbuf_pool_create("pool", NB_MBUF, MEMPOOL_CACHE_SIZE,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_pktmbuf_pool_create(pool_name,
- mp_size, burst_conf.rx_burst * 4, 0, MBUF_DATA_SIZE,
+ mp_size, burst_conf.rx_burst * 4, 0,
+ RTE_MBUF_DEFAULT_BUF_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_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
#define MBUF_PER_POOL 8192
#define QUOTA_WATERMARK_MEMZONE_NAME "qw_global_vars"
#define TX_RING_SIZE 512
#define NUM_MBUFS 8191
-#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");
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
- NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE,
- rte_socket_id());
+ NUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0,
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (1600 + RTE_PKTMBUF_HEADROOM)
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
/* Creates a new mempool in memory to hold the mbufs. */
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NUM_MBUFS * nb_ports,
- MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
+ MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
(num_switching_cores*RTE_TEST_TX_DESC_DEFAULT) +\
(num_switching_cores*MBUF_CACHE_SIZE))
-#define MBUF_CACHE_SIZE 128
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
+#define MBUF_CACHE_SIZE 128
+#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
/*
* No frame data buffer allocated from host are required for zero copy
* implementation, guest will allocate the frame data buffer, and vhost
* directly use it.
*/
-#define VIRTIO_DESCRIPTOR_LEN_ZCP 1518
-#define MBUF_DATA_SIZE_ZCP (VIRTIO_DESCRIPTOR_LEN_ZCP + RTE_PKTMBUF_HEADROOM)
+#define VIRTIO_DESCRIPTOR_LEN_ZCP RTE_MBUF_DEFAULT_DATAROOM
+#define MBUF_DATA_SIZE_ZCP RTE_MBUF_DEFAULT_BUF_SIZE
#define MBUF_CACHE_SIZE_ZCP 0
#define MAX_PKT_BURST 32 /* Max burst size for RX/TX */
(num_switching_cores*MBUF_CACHE_SIZE))
#define MBUF_CACHE_SIZE 64
-#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_pktmbuf_pool_create("MBUF_POOL",
NUM_MBUFS_PER_PORT * valid_num_ports, MBUF_CACHE_SIZE, 0,
- MBUF_DATA_SIZE, rte_socket_id());
+ RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MAX_PKT_BURST 32
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL",
NUM_MBUFS_PER_PORT * nb_ports, MBUF_CACHE_SIZE,
- 0, MBUF_DATA_SIZE, rte_socket_id());
+ 0, RTE_MBUF_DEFAULT_BUF_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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define INVALID_PORT_ID 0xFF
}
mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NUM_MBUFS * nb_ports,
- MBUF_CACHE_SIZE, 0, MBUF_DATA_SIZE, rte_socket_id());
+ MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
*/
const char *rte_get_tx_ol_flag_name(uint64_t mask);
+/**
+ * Some NICs need at least 2KB buffer to RX standard Ethernet frame without
+ * splitting it into multiple segments.
+ * So, for mbufs that planned to be involved into RX/TX, the recommended
+ * minimal buffer length is 2KB + RTE_PKTMBUF_HEADROOM.
+ */
+#define RTE_MBUF_DEFAULT_DATAROOM 2048
+#define RTE_MBUF_DEFAULT_BUF_SIZE \
+ (RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM)
+
/* define a set of marker types that can be used to refer to set points in the
* mbuf */
typedef void *MARKER[0]; /**< generic marker for a point in a structure */