#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_launch.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#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
unsigned rx;
unsigned tx;
unsigned drop;
-} __attribute__((aligned(CACHE_LINE_SIZE / 2)));
+} __attribute__((aligned(RTE_CACHE_LINE_SIZE / 2)));
static int proc_id = -1;
static unsigned num_procs = 0;
}
};
const uint16_t rx_rings = num_queues, tx_rings = num_queues;
+ struct rte_eth_dev_info info;
int retval;
uint16_t q;
printf("# Initialising port %u... ", (unsigned)port);
fflush(stdout);
+ rte_eth_dev_info_get(port, &info);
+ info.default_rxconf.rx_drop_en = 1;
+
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval < 0)
return retval;
for (q = 0; q < rx_rings; q ++) {
retval = rte_eth_rx_queue_setup(port, q, RX_RING_SIZE,
rte_eth_dev_socket_id(port),
- NULL,
+ &info.default_rxconf,
mbuf_pool);
if (retval < 0)
return retval;
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");