X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_meter%2Fmain.c;h=0de5e7fb55d74d2a61ac8a8edd4f9d06adc37390;hb=824cb29c0e7b8a2b3ed285546c3a39a8e0b3cd44;hp=c02ac508514080b550042f43c787a7310c8ed4ed;hpb=68fa37e021a1c44c6b2a947cefc20eb61c729947;p=dpdk.git diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index c02ac50851..0de5e7fb55 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -70,7 +70,6 @@ * Buffer pool configuration * ***/ -#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define NB_MBUF 8192 #define MEMPOOL_CACHE_SIZE 256 @@ -102,26 +101,6 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, /* RX prefetch threshold reg */ - .hthresh = 8, /* RX host threshold reg */ - .wthresh = 4, /* RX write-back threshold reg */ - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, /* TX prefetch threshold reg */ - .hthresh = 0, /* TX host threshold reg */ - .wthresh = 0, /* TX write-back threshold reg */ - }, - .tx_free_thresh = 0, - .tx_rs_thresh = 0, - .txq_flags = 0x0, -}; - #define NIC_RX_QUEUE_DESC 128 #define NIC_TX_QUEUE_DESC 512 @@ -358,7 +337,7 @@ parse_args(int argc, char **argv) } int -MAIN(int argc, char **argv) +main(int argc, char **argv) { uint32_t lcore_id; int ret; @@ -380,9 +359,8 @@ MAIN(int argc, char **argv) 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, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); if (pool == NULL) rte_exit(EXIT_FAILURE, "Buffer pool creation error\n"); @@ -391,11 +369,15 @@ MAIN(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret); - ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, rte_eth_dev_socket_id(port_rx), &rx_conf, pool); + ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, + rte_eth_dev_socket_id(port_rx), + NULL, pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_rx, ret); - ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, rte_eth_dev_socket_id(port_rx), &tx_conf); + ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, + rte_eth_dev_socket_id(port_rx), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret); @@ -403,11 +385,15 @@ MAIN(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret); - ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, rte_eth_dev_socket_id(port_tx), &rx_conf, pool); + ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, + rte_eth_dev_socket_id(port_tx), + NULL, pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_tx, ret); - ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, rte_eth_dev_socket_id(port_tx), &tx_conf); + ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, + rte_eth_dev_socket_id(port_tx), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_tx, ret);