examples/qos_sched: check status of getting ethdev info
[dpdk.git] / examples / qos_sched / init.c
index b05206d..cf9e8f4 100644 (file)
@@ -98,7 +98,13 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
        /* init port */
        RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", 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;