examples: check status of getting ethdev info
[dpdk.git] / examples / link_status_interrupt / main.c
index 9cd4dc7..0c3dfc6 100644 (file)
@@ -609,7 +609,13 @@ main(int argc, char **argv)
                /* init port */
                printf("Initializing port %u... ", (unsigned) portid);
                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));
+
                if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                        local_port_conf.txmode.offloads |=
                                DEV_TX_OFFLOAD_MBUF_FAST_FREE;