net/sfc: add missing header guard to TSO header file
[dpdk.git] / examples / ethtool / ethtool-app / main.c
index fb4639e..dc93adf 100644 (file)
@@ -20,8 +20,8 @@
 
 #define MAX_PORTS RTE_MAX_ETHPORTS
 #define MAX_BURST_LENGTH 32
-#define PORT_RX_QUEUE_SIZE 128
-#define PORT_TX_QUEUE_SIZE 256
+#define PORT_RX_QUEUE_SIZE 1024
+#define PORT_TX_QUEUE_SIZE 1024
 #define PKTPOOL_EXTRA_SIZE 512
 #define PKTPOOL_CACHE 32
 
@@ -95,6 +95,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
        char str_name[16];
        uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
        uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
+       struct rte_eth_txconf txconf;
 
        memset(&cfg_port, 0, sizeof(cfg_port));
        cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
@@ -131,6 +132,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
                                                     &nb_txd) < 0)
                        rte_exit(EXIT_FAILURE,
                                 "rte_eth_dev_adjust_nb_rx_tx_desc failed");
+
                if (rte_eth_rx_queue_setup(
                            idx_port, 0, nb_rxd,
                            rte_eth_dev_socket_id(idx_port), NULL,
@@ -138,9 +140,10 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
                        rte_exit(EXIT_FAILURE,
                                 "rte_eth_rx_queue_setup failed"
                                );
+               txconf = dev_info.default_txconf;
                if (rte_eth_tx_queue_setup(
                            idx_port, 0, nb_txd,
-                           rte_eth_dev_socket_id(idx_port), NULL) < 0)
+                           rte_eth_dev_socket_id(idx_port), &txconf) < 0)
                        rte_exit(EXIT_FAILURE,
                                 "rte_eth_tx_queue_setup failed"
                                );
@@ -246,7 +249,7 @@ int main(int argc, char **argv)
        if (cnt_args_parsed < 0)
                rte_exit(EXIT_FAILURE, "rte_eal_init(): Failed");
 
-       cnt_ports = rte_eth_dev_count();
+       cnt_ports = rte_eth_dev_count_avail();
        printf("Number of NICs: %i\n", cnt_ports);
        if (cnt_ports == 0)
                rte_exit(EXIT_FAILURE, "No available NIC ports!\n");