X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fhns3%2Fhns3_stats.c;h=0fe853d62626e6638600df5dbabf623afc32ceb1;hb=daa02b5cddbb8e11b31d41e2bf7bb1ae64dcae2f;hp=1af689ff09d98cb52522f6215903fbc756f2d574;hpb=cb082f598568dd1522881111193166d4d2bbc929;p=dpdk.git diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 1af689ff09..0fe853d626 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2021 HiSilicon Limited. */ #include @@ -1325,7 +1325,7 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, len = cnt_stats * sizeof(struct rte_eth_xstat); values_copy = rte_zmalloc("hns3_xstats_values", len, 0); if (values_copy == NULL) { - hns3_err(hw, "Failed to allocate %" PRIx64 " bytes needed " + hns3_err(hw, "Failed to allocate 0x%" PRIx64 " bytes needed " "to store statistics values", len); return -ENOMEM; } @@ -1347,7 +1347,7 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, for (i = 0; i < size; i++) { if (ids[i] >= cnt_stats) { - hns3_err(hw, "ids[%u] (%" PRIx64 ") is invalid, " + hns3_err(hw, "ids[%u] (%" PRIu64 ") is invalid, " "should < %u", i, ids[i], cnt_stats); rte_free(values_copy); return -EINVAL; @@ -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; @@ -1406,7 +1407,7 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, len = cnt_stats * sizeof(struct rte_eth_xstat_name); names_copy = rte_zmalloc("hns3_xstats_names", len, 0); if (names_copy == NULL) { - hns3_err(hw, "Failed to allocate %" PRIx64 " bytes needed " + hns3_err(hw, "Failed to allocate 0x%" PRIx64 " bytes needed " "to store statistics names", len); return -ENOMEM; } @@ -1415,7 +1416,7 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, for (i = 0; i < size; i++) { if (ids[i] >= cnt_stats) { - hns3_err(hw, "ids[%u] (%" PRIx64 ") is invalid, " + hns3_err(hw, "ids[%u] (%" PRIu64 ") is invalid, " "should < %u", i, ids[i], cnt_stats); rte_free(names_copy); return -EINVAL;