From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21EA8A0C43; Thu, 30 Sep 2021 18:03:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60D0241121; Thu, 30 Sep 2021 18:03:21 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id D2D60410E5 for ; Thu, 30 Sep 2021 18:03:17 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 99DA97F6DD; Thu, 30 Sep 2021 19:03:17 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 0842C7F6D6; Thu, 30 Sep 2021 19:02:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0842C7F6D6 Authentication-Results: shelob.oktetlabs.ru/0842C7F6D6; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Somalapuram Amaranath , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , Haiyue Wang , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , Andrew Boyer , Jerin Jacob , Jiawen Wu , Jian Wang , Thomas Monjalon , Ferruh Yigit Cc: dev@dpdk.org Date: Thu, 30 Sep 2021 19:01:53 +0300 Message-Id: <20210930160156.961041-6-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210930160156.961041-1-andrew.rybchenko@oktetlabs.ru> References: <20210604144225.287678-1-andrew.rybchenko@oktetlabs.ru> <20210930160156.961041-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v7 3/4] ethdev: improve xstats names by IDs get prototype X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/axgbe/axgbe_ethdev.c | 4 ++-- drivers/net/cnxk/cnxk_ethdev.h | 3 ++- drivers/net/cnxk/cnxk_stats.c | 3 ++- drivers/net/cxgbe/cxgbe_ethdev.c | 3 ++- drivers/net/dpaa/dpaa_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 6 +++--- drivers/net/hns3/hns3_stats.c | 7 ++++--- drivers/net/hns3/hns3_stats.h | 2 +- drivers/net/igc/igc_ethdev.c | 4 ++-- drivers/net/ionic/ionic_ethdev.c | 6 +++--- drivers/net/ixgbe/ixgbe_ethdev.c | 6 +++--- drivers/net/octeontx2/otx2_ethdev.h | 3 ++- drivers/net/octeontx2/otx2_stats.c | 3 ++- drivers/net/sfc/sfc_ethdev.c | 3 ++- drivers/net/txgbe/txgbe_ethdev.c | 2 +- lib/ethdev/ethdev_driver.h | 9 ++++++--- lib/ethdev/rte_ethdev.c | 2 +- 18 files changed, 40 insertions(+), 30 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 9cb4818af1..ebd5411fdd 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -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]; diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h index 10e05e6b5e..946629f72e 100644 --- a/drivers/net/cnxk/cnxk_ethdev.h +++ b/drivers/net/cnxk/cnxk_ethdev.h @@ -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); diff --git a/drivers/net/cnxk/cnxk_stats.c b/drivers/net/cnxk/cnxk_stats.c index 19bab2170c..4b0deac05e 100644 --- a/drivers/net/cnxk/cnxk_stats.c +++ b/drivers/net/cnxk/cnxk_stats.c @@ -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); diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 177eca3976..4929766d9a 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -1006,8 +1006,9 @@ static int cxgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev, /* Get names of port extended statistics by ID. */ static 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) { struct port_info *pi = dev->data->dev_private; struct rte_eth_xstat_name *xnames_copy; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 36d8f9249d..1f80e8d744 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -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); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c12169578e..ea191564fc 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1795,8 +1795,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); diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index d80fad01e3..6510cd7ceb 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -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++) { diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index e09dc0da80..0fe853d626 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -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; diff --git a/drivers/net/hns3/hns3_stats.h b/drivers/net/hns3/hns3_stats.h index de5c40d6b5..d1230f94cb 100644 --- a/drivers/net/hns3/hns3_stats.h +++ b/drivers/net/hns3/hns3_stats.h @@ -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); diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 224a095483..be2c066111 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -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; diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index e620793966..344c076f30 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -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++) { diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 47693c0c47..aae8b55d83 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -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++) { diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 7871e3d30b..b1575f59a2 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -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, diff --git a/drivers/net/octeontx2/otx2_stats.c b/drivers/net/octeontx2/otx2_stats.c index 8aaf270a7c..3adf21608c 100644 --- a/drivers/net/octeontx2/otx2_stats.c +++ b/drivers/net/octeontx2/otx2_stats.c @@ -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; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 2db0d000c3..f212ca8ad6 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -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; diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 0063994688..b267da462b 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -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; diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index 74af878bb8..6a2be98c1f 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -237,11 +237,14 @@ 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. Can be NULL together + * with @p xstats_names to retrieve number of available statistics. + * @param ids + * IDs array to retrieve specific statistics. Must not be NULL. * @param xstats_names * An rte_eth_xstat_name array of at least *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. * @@ -251,7 +254,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, diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index e5ddc1b81f..655d7be3b5 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -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 */ -- 2.30.2