examples/qos_sched: check status of getting ethdev info
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Thu, 12 Sep 2019 16:42:38 +0000 (17:42 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 12:45:35 +0000 (14:45 +0200)
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/qos_sched according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
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;