mbuf: add namespace to offload flags
[dpdk.git] / drivers / net / hns3 / hns3_stats.c
index 1af689f..0fe853d 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018-2019 Hisilicon Limited.
+ * Copyright(c) 2018-2021 HiSilicon Limited.
  */
 
 #include <rte_ethdev.h>
@@ -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;