examples: check status of getting ethdev info
[dpdk.git] / examples / performance-thread / l3fwd-thread / main.c
index 49d9424..00f5350 100644 (file)
@@ -3559,7 +3559,13 @@ main(int argc, char **argv)
                        n_tx_queue = MAX_TX_QUEUE_PER_PORT;
                printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
                        nb_rx_queue, (unsigned)n_tx_queue);
-               rte_eth_dev_info_get(portid, &dev_info);
+
+               ret = rte_eth_dev_info_get(portid, &dev_info);
+               if (ret != 0)
+                       rte_exit(EXIT_FAILURE,
+                               "Error during getting device (port %u) info: %s\n",
+                               portid, strerror(-ret));
+
                if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                        local_port_conf.txmode.offloads |=
                                DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -3663,7 +3669,12 @@ main(int argc, char **argv)
                        printf("rxq=%d,%d,%d ", portid, queueid, socketid);
                        fflush(stdout);
 
-                       rte_eth_dev_info_get(portid, &dev_info);
+                       ret = rte_eth_dev_info_get(portid, &dev_info);
+                       if (ret != 0)
+                               rte_exit(EXIT_FAILURE,
+                                       "Error during getting device (port %u) info: %s\n",
+                                       portid, strerror(-ret));
+
                        rxq_conf = dev_info.default_rxconf;
                        rxq_conf.offloads = port_conf.rxmode.offloads;
                        ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,