ethdev: do not use get xstats names by IDs to obtain count
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Fri, 1 Oct 2021 09:07:20 +0000 (12:07 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 6 Oct 2021 11:07:11 +0000 (13:07 +0200)
Relax requirements on get xstats names by IDs. After the patch
corresponding the driver operation is called with non-NULL ids
and xstats_names parameters only.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/ethdev/rte_ethdev.c

index daf5ca9..e5ddc1b 100644 (file)
@@ -2866,12 +2866,6 @@ eth_dev_get_xstats_count(uint16_t port_id)
 
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
        dev = &rte_eth_devices[port_id];
-       if (dev->dev_ops->xstats_get_names_by_id != NULL) {
-               count = (*dev->dev_ops->xstats_get_names_by_id)(dev, NULL,
-                               NULL, 0);
-               if (count < 0)
-                       return eth_err(port_id, count);
-       }
        if (dev->dev_ops->xstats_get_names != NULL) {
                count = (*dev->dev_ops->xstats_get_names)(dev, NULL, 0);
                if (count < 0)