pdump: check status of getting ethdev info
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Thu, 12 Sep 2019 16:42:18 +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
pdump component according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_pdump/rte_pdump.c

index cd24dd0..ac94fea 100644 (file)
@@ -333,7 +333,14 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
        if (queue == RTE_PDUMP_ALL_QUEUES) {
                struct rte_eth_dev_info dev_info;
 
-               rte_eth_dev_info_get(port, &dev_info);
+               ret = rte_eth_dev_info_get(port, &dev_info);
+               if (ret != 0) {
+                       RTE_LOG(ERR, PDUMP,
+                               "Error during getting device (port %u) info: %s\n",
+                               port, strerror(-ret));
+                       return ret;
+               }
+
                nb_rx_q = dev_info.nb_rx_queues;
                nb_tx_q = dev_info.nb_tx_queues;
                if (nb_rx_q == 0 && flags & RTE_PDUMP_FLAG_RX) {