X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fexception_path%2Fmain.c;h=e551e6d118e763bd9d7b64cb537fe6cfffef3bcd;hb=8e04becc9432d15531e0596118443d099bc6917a;hp=fe30e070314cebba5b63b06226b8ab8d606d81e0;hpb=67064d67959a75c5122aab63651f6aab3da4175c;p=dpdk.git diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index fe30e07031..e551e6d118 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -448,6 +447,8 @@ static void init_port(uint8_t port) { int ret; + uint16_t nb_rxd = NB_RXD; + uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ PRINT_INFO("Initialising port %u ...", (unsigned)port); @@ -457,14 +458,21 @@ init_port(uint8_t port) FATAL_ERROR("Could not configure port%u (%d)", (unsigned)port, ret); - ret = rte_eth_rx_queue_setup(port, 0, NB_RXD, rte_eth_dev_socket_id(port), + ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); + if (ret < 0) + FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", + (unsigned)port, ret); + + ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, + rte_eth_dev_socket_id(port), NULL, pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", (unsigned)port, ret); - ret = rte_eth_tx_queue_setup(port, 0, NB_TXD, rte_eth_dev_socket_id(port), + ret = rte_eth_tx_queue_setup(port, 0, nb_txd, + rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)",