ethdev: improve xstats names by IDs get prototype
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Fri, 1 Oct 2021 09:07:22 +0000 (12:07 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 6 Oct 2021 11:07:11 +0000 (13:07 +0200)
Adjust parameters order to eth_xstats_get_by_id_t prototype.
Make ids the second parameter similar to eth_xstats_get_by_id_t.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
19 files changed:
drivers/net/axgbe/axgbe_ethdev.c
drivers/net/cnxk/cnxk_ethdev.h
drivers/net/cnxk/cnxk_stats.c
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/cxgbe/cxgbe_pfvf.h
drivers/net/dpaa/dpaa_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/hns3/hns3_stats.c
drivers/net/hns3/hns3_stats.h
drivers/net/igc/igc_ethdev.c
drivers/net/ionic/ionic_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/octeontx2/otx2_ethdev.h
drivers/net/octeontx2/otx2_stats.c
drivers/net/sfc/sfc_ethdev.c
drivers/net/txgbe/txgbe_ethdev.c
lib/ethdev/ethdev_driver.h
lib/ethdev/rte_ethdev.c

index 9cb4818..ebd5411 100644 (file)
@@ -57,8 +57,8 @@ axgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev,
                           unsigned int n);
 static int
 axgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-                                struct rte_eth_xstat_name *xstats_names,
                                 const uint64_t *ids,
+                                struct rte_eth_xstat_name *xstats_names,
                                 unsigned int size);
 static int axgbe_dev_xstats_reset(struct rte_eth_dev *dev);
 static int axgbe_dev_rss_reta_update(struct rte_eth_dev *dev,
@@ -1076,8 +1076,8 @@ axgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 
 static int
 axgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-                                struct rte_eth_xstat_name *xstats_names,
                                 const uint64_t *ids,
+                                struct rte_eth_xstat_name *xstats_names,
                                 unsigned int size)
 {
        struct rte_eth_xstat_name xstats_names_copy[AXGBE_XSTATS_COUNT];
index 10e05e6..946629f 100644 (file)
@@ -365,8 +365,9 @@ int cnxk_nix_xstats_get_names(struct rte_eth_dev *eth_dev,
                              struct rte_eth_xstat_name *xstats_names,
                              unsigned int limit);
 int cnxk_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
+                                   const uint64_t *ids,
                                    struct rte_eth_xstat_name *xstats_names,
-                                   const uint64_t *ids, unsigned int limit);
+                                   unsigned int limit);
 int cnxk_nix_xstats_get_by_id(struct rte_eth_dev *eth_dev, const uint64_t *ids,
                              uint64_t *values, unsigned int n);
 int cnxk_nix_xstats_reset(struct rte_eth_dev *eth_dev);
index 19bab21..4b0deac 100644 (file)
@@ -227,8 +227,9 @@ cnxk_nix_xstats_get_names(struct rte_eth_dev *eth_dev,
 
 int
 cnxk_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
+                               const uint64_t *ids,
                                struct rte_eth_xstat_name *xstats_names,
-                               const uint64_t *ids, unsigned int limit)
+                               unsigned int limit)
 {
        struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
        uint32_t nix_cnt = roc_nix_num_xstats_get(&dev->nix);
index 304fafe..3abe5c3 100644 (file)
@@ -1036,8 +1036,9 @@ out_err:
 
 /* Get names of port extended statistics by ID. */
 int cxgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-                                    struct rte_eth_xstat_name *xnames,
-                                    const uint64_t *ids, unsigned int n)
+                                           const uint64_t *ids,
+                                           struct rte_eth_xstat_name *xnames,
+                                           unsigned int n)
 {
        struct port_info *pi = dev->data->dev_private;
        struct rte_eth_xstat_name *xnames_copy;
index 81d0fce..176bd46 100644 (file)
@@ -56,8 +56,9 @@ int cxgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev,
                               const uint64_t *ids, uint64_t *values,
                               unsigned int n);
 int cxgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
+                                    const uint64_t *ids,
                                     struct rte_eth_xstat_name *xnames,
-                                    const uint64_t *ids, unsigned int n);
+                                    unsigned int n);
 int cxgbe_dev_xstats_get_names(struct rte_eth_dev *dev,
                               struct rte_eth_xstat_name *xstats_names,
                               unsigned int n);
index 36d8f92..1f80e8d 100644 (file)
@@ -815,8 +815,8 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 static int
 dpaa_xstats_get_names_by_id(
        struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit)
 {
        unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
index 275656f..f4f118a 100644 (file)
@@ -1797,8 +1797,8 @@ dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 static int
 dpaa2_xstats_get_names_by_id(
        struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit)
 {
        unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings);
index d80fad0..6510cd7 100644 (file)
@@ -96,7 +96,7 @@ static int eth_igb_xstats_get_names(struct rte_eth_dev *dev,
                                    struct rte_eth_xstat_name *xstats_names,
                                    unsigned int size);
 static int eth_igb_xstats_get_names_by_id(struct rte_eth_dev *dev,
-               struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+               const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
                unsigned int limit);
 static int eth_igb_stats_reset(struct rte_eth_dev *dev);
 static int eth_igb_xstats_reset(struct rte_eth_dev *dev);
@@ -1883,7 +1883,7 @@ static int eth_igb_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int eth_igb_xstats_get_names_by_id(struct rte_eth_dev *dev,
-               struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+               const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
                unsigned int limit)
 {
        unsigned int i;
@@ -1902,7 +1902,7 @@ static int eth_igb_xstats_get_names_by_id(struct rte_eth_dev *dev,
        } else {
                struct rte_eth_xstat_name xstats_names_copy[IGB_NB_XSTATS];
 
-               eth_igb_xstats_get_names_by_id(dev, xstats_names_copy, NULL,
+               eth_igb_xstats_get_names_by_id(dev, NULL, xstats_names_copy,
                                IGB_NB_XSTATS);
 
                for (i = 0; i < limit; i++) {
index e09dc0d..0fe853d 100644 (file)
@@ -1365,12 +1365,12 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param ids
+ *   IDs array given by app to retrieve specific statistics
  * @param xstats_names
  *   An rte_eth_xstat_name array of at least *size* elements to
  *   be filled. If set to NULL, the function returns the required number
  *   of elements.
- * @param ids
- *   IDs array given by app to retrieve specific statistics
  * @param size
  *   The size of the xstats_names array (number of elements).
  * @return
@@ -1383,8 +1383,9 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
  */
 int
 hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
+                               const uint64_t *ids,
                                struct rte_eth_xstat_name *xstats_names,
-                               const uint64_t *ids, uint32_t size)
+                               uint32_t size)
 {
        const uint32_t cnt_stats = hns3_xstats_calc_num(dev);
        struct hns3_adapter *hns = dev->data->dev_private;
index de5c40d..d1230f9 100644 (file)
@@ -161,8 +161,8 @@ int hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev,
                              uint64_t *values,
                              uint32_t size);
 int hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-                                   struct rte_eth_xstat_name *xstats_names,
                                    const uint64_t *ids,
+                                   struct rte_eth_xstat_name *xstats_names,
                                    uint32_t size);
 int hns3_stats_reset(struct rte_eth_dev *dev);
 int hns3_tqp_stats_init(struct hns3_hw *hw);
index 224a095..be2c066 100644 (file)
@@ -216,7 +216,7 @@ static int eth_igc_xstats_get_names(struct rte_eth_dev *dev,
                                struct rte_eth_xstat_name *xstats_names,
                                unsigned int size);
 static int eth_igc_xstats_get_names_by_id(struct rte_eth_dev *dev,
-               struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+               const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
                unsigned int limit);
 static int eth_igc_xstats_reset(struct rte_eth_dev *dev);
 static int
@@ -2013,7 +2013,7 @@ eth_igc_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 
 static int
 eth_igc_xstats_get_names_by_id(struct rte_eth_dev *dev,
-               struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+               const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
                unsigned int limit)
 {
        unsigned int i;
index e620793..344c076 100644 (file)
@@ -52,7 +52,7 @@ static int  ionic_dev_xstats_reset(struct rte_eth_dev *dev);
 static int  ionic_dev_xstats_get_names(struct rte_eth_dev *dev,
        struct rte_eth_xstat_name *xstats_names, unsigned int size);
 static int  ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+       const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
        unsigned int limit);
 static int  ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev,
        char *fw_version, size_t fw_size);
@@ -733,7 +733,7 @@ ionic_dev_xstats_get_names(__rte_unused struct rte_eth_dev *eth_dev,
 
 static int
 ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
-               struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+               const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
                unsigned int limit)
 {
        struct rte_eth_xstat_name xstats_names_copy[IONIC_NB_HW_STATS];
@@ -751,7 +751,7 @@ ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
                return IONIC_NB_HW_STATS;
        }
 
-       ionic_dev_xstats_get_names_by_id(eth_dev, xstats_names_copy, NULL,
+       ionic_dev_xstats_get_names_by_id(eth_dev, NULL, xstats_names_copy,
                IONIC_NB_HW_STATS);
 
        for (i = 0; i < limit; i++) {
index 8b33897..f9a3101 100644 (file)
@@ -173,8 +173,8 @@ static int ixgbevf_dev_xstats_get_names(struct rte_eth_dev *dev,
        struct rte_eth_xstat_name *xstats_names, unsigned limit);
 static int ixgbe_dev_xstats_get_names_by_id(
        struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit);
 static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
                                             uint16_t queue_id,
@@ -3437,8 +3437,8 @@ static int ixgbe_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 
 static int ixgbe_dev_xstats_get_names_by_id(
        struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit)
 {
        if (!ids) {
@@ -3497,7 +3497,7 @@ static int ixgbe_dev_xstats_get_names_by_id(
        uint16_t size = ixgbe_xstats_calc_num();
        struct rte_eth_xstat_name xstats_names_copy[size];
 
-       ixgbe_dev_xstats_get_names_by_id(dev, xstats_names_copy, NULL,
+       ixgbe_dev_xstats_get_names_by_id(dev, NULL, xstats_names_copy,
                        size);
 
        for (i = 0; i < limit; i++) {
index 7871e3d..b1575f5 100644 (file)
@@ -514,8 +514,9 @@ int otx2_nix_xstats_get_by_id(struct rte_eth_dev *eth_dev,
                              const uint64_t *ids,
                              uint64_t *values, unsigned int n);
 int otx2_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
+                                   const uint64_t *ids,
                                    struct rte_eth_xstat_name *xstats_names,
-                                   const uint64_t *ids, unsigned int limit);
+                                   unsigned int limit);
 
 /* RSS */
 void otx2_nix_rss_set_key(struct otx2_eth_dev *dev,
index 8aaf270..3adf216 100644 (file)
@@ -240,8 +240,9 @@ otx2_nix_xstats_get_names(struct rte_eth_dev *eth_dev,
 
 int
 otx2_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
+                               const uint64_t *ids,
                                struct rte_eth_xstat_name *xstats_names,
-                               const uint64_t *ids, unsigned int limit)
+                               unsigned int limit)
 {
        struct rte_eth_xstat_name xstats_names_copy[OTX2_NIX_NUM_XSTATS_REG];
        uint16_t i;
index 2db0d00..f212ca8 100644 (file)
@@ -838,8 +838,9 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 
 static int
 sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+                          const uint64_t *ids,
                           struct rte_eth_xstat_name *xstats_names,
-                          const uint64_t *ids, unsigned int size)
+                          unsigned int size)
 {
        struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
        struct sfc_port *port = &sa->port;
index 0063994..b267da4 100644 (file)
@@ -2451,8 +2451,8 @@ static int txgbe_dev_xstats_get_names(struct rte_eth_dev *dev,
 }
 
 static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit)
 {
        unsigned int i;
index 81dee87..96dd0ec 100644 (file)
@@ -237,11 +237,11 @@ typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
  *
  * @param dev
  *   ethdev handle of port.
+ * @param ids
+ *   IDs array to retrieve specific statistics. Must not be NULL.
  * @param xstats_names
  *   An rte_eth_xstat_name array of at least @p size elements to be filled.
  *   Must not be NULL.
- * @param ids
- *   IDs array to retrieve specific statistics. Must not be NULL.
  * @param size
  *   Element count in @p ids and @p xstats_names.
  *
@@ -250,7 +250,7 @@ typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
  *   - A negative value on error.
  */
 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+       const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
        unsigned int size);
 
 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
index e5ddc1b..655d7be 100644 (file)
@@ -3023,7 +3023,7 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id,
 
                if (no_basic_stat_requested)
                        return (*dev->dev_ops->xstats_get_names_by_id)(dev,
-                                       xstats_names, ids_copy, size);
+                                       ids_copy, xstats_names, size);
        }
 
        /* Retrieve all stats */