DPDK patches and discussions
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Maryam Tahhan <maryam.tahhan@intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>,
	Helin Zhang <helin.zhang@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jing Chen <jing.d.chen@intel.com>,
	Huawei Xie <huawei.xie@intel.com>
Subject: [dpdk-dev] [PATCH v4 7/8] rte: change xstats usage to new API
Date: Mon, 13 Jun 2016 16:52:00 +0100	[thread overview]
Message-ID: <1465833121-26953-8-git-send-email-remy.horton@intel.com> (raw)
In-Reply-To: <1465833121-26953-1-git-send-email-remy.horton@intel.com>

The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 app/proc_info/main.c               | 29 +++++++++++++++++---
 app/test-pmd/config.c              | 54 +++++++++++++++++++++++++++++---------
 drivers/net/e1000/igb_ethdev.c     | 10 +++----
 drivers/net/fm10k/fm10k_ethdev.c   |  5 +---
 drivers/net/i40e/i40e_ethdev.c     |  8 ++----
 drivers/net/i40e/i40e_ethdev_vf.c  |  5 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c   | 11 +++-----
 drivers/net/virtio/virtio_ethdev.c |  6 ++---
 lib/librte_ether/rte_ethdev.c      |  5 +---
 lib/librte_ether/rte_ethdev.h      |  7 +++--
 10 files changed, 85 insertions(+), 55 deletions(-)

diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 5f83092..f2063fa 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -1,7 +1,7 @@
 /*
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -243,11 +243,13 @@ nic_stats_clear(uint8_t port_id)
 static void
 nic_xstats_display(uint8_t port_id)
 {
-	struct rte_eth_xstats *xstats;
+	struct rte_eth_xstat_name *xstats_names;
+	struct rte_eth_xstat *xstats;
 	int len, ret, i;
+	int idx_name;
 	static const char *nic_stats_border = "########################";
 
-	len = rte_eth_xstats_get(port_id, NULL, 0);
+	len = rte_eth_xstats_get_names(port_id, NULL, 0);
 	if (len < 0) {
 		printf("Cannot get xstats count\n");
 		return;
@@ -258,6 +260,18 @@ nic_xstats_display(uint8_t port_id)
 		return;
 	}
 
+	xstats_names = malloc(sizeof(struct rte_eth_xstat_name) * len);
+	if (xstats_names == NULL) {
+		printf("Cannot allocate memory for xstat names\n");
+		free(xstats);
+		return;
+	}
+	if (len != rte_eth_xstats_get_names(
+			port_id, xstats_names, len)) {
+		printf("Cannot get xstat names\n");
+		return;
+	}
+
 	printf("###### NIC extended statistics for port %-2d #########\n",
 			   port_id);
 	printf("%s############################\n",
@@ -270,11 +284,18 @@ nic_xstats_display(uint8_t port_id)
 	}
 
 	for (i = 0; i < len; i++)
-		printf("%s: %"PRIu64"\n", xstats[i].name, xstats[i].value);
+		for (idx_name = 0; idx_name < len; idx_name++)
+			if (xstats_names[idx_name].id == xstats[i].id) {
+				printf("%s: %"PRIu64"\n",
+					xstats_names[idx_name].name,
+					xstats[i].value);
+				break;
+			}
 
 	printf("%s############################\n",
 			   nic_stats_border);
 	free(xstats);
+	free(xstats_names);
 }
 
 static void
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1c552e4..8ddec07 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -232,29 +232,57 @@ nic_stats_clear(portid_t port_id)
 void
 nic_xstats_display(portid_t port_id)
 {
-	struct rte_eth_xstats *xstats;
-	int len, ret, i;
+	struct rte_eth_xstat *xstats;
+	int cnt_xstats, idx_xstat, idx_name;
+	struct rte_eth_xstat_name *xstats_names;
 
 	printf("###### NIC extended statistics for port %-2d\n", port_id);
+	if (!rte_eth_dev_is_valid_port(port_id)) {
+		printf("Error: Invalid port number %i\n", port_id);
+		return;
+	}
+
+	/* Get count */
+	cnt_xstats = rte_eth_xstats_get_names(port_id, NULL, 0);
+	if (cnt_xstats  < 0) {
+		printf("Error: Cannot get count of xstats\n");
+		return;
+	}
 
-	len = rte_eth_xstats_get(port_id, NULL, 0);
-	if (len < 0) {
-		printf("Cannot get xstats count\n");
+	/* Get id-name lookup table */
+	xstats_names = malloc(sizeof(struct rte_eth_xstat_name) * cnt_xstats);
+	if (xstats_names == NULL) {
+		printf("Cannot allocate memory for xstats lookup\n");
 		return;
 	}
-	xstats = malloc(sizeof(xstats[0]) * len);
+	if (cnt_xstats != rte_eth_xstats_get_names(
+			port_id, xstats_names, cnt_xstats)) {
+		printf("Error: Cannot get xstats lookup\n");
+		return;
+	}
+
+	/* Get stats themselves */
+	xstats = malloc(sizeof(struct rte_eth_xstat) * cnt_xstats);
 	if (xstats == NULL) {
 		printf("Cannot allocate memory for xstats\n");
+		free(xstats_names);
 		return;
 	}
-	ret = rte_eth_xstats_get(port_id, xstats, len);
-	if (ret < 0 || ret > len) {
-		printf("Cannot get xstats\n");
-		free(xstats);
+	if (cnt_xstats != rte_eth_xstats_get(port_id, xstats, cnt_xstats)) {
+		printf("Error: Unable to get xstats\n");
 		return;
 	}
-	for (i = 0; i < len; i++)
-		printf("%s: %"PRIu64"\n", xstats[i].name, xstats[i].value);
+
+	/* Display xstats */
+	for (idx_xstat = 0; idx_xstat < cnt_xstats; idx_xstat++)
+		for (idx_name = 0; idx_name < cnt_xstats; idx_name++)
+			if (xstats_names[idx_name].id == xstats[idx_xstat].id) {
+				printf("%s: %"PRIu64"\n",
+					xstats_names[idx_name].name,
+					xstats[idx_xstat].value);
+				break;
+			}
+	free(xstats_names);
 	free(xstats);
 }
 
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index dffa04f..b822992 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -99,7 +99,7 @@ static int  eth_igb_link_update(struct rte_eth_dev *dev,
 static void eth_igb_stats_get(struct rte_eth_dev *dev,
 				struct rte_eth_stats *rte_stats);
 static int eth_igb_xstats_get(struct rte_eth_dev *dev,
-			      struct rte_eth_xstats *xstats, unsigned n);
+			      struct rte_eth_xstat *xstats, unsigned n);
 static int eth_igb_xstats_get_names(struct rte_eth_dev *dev,
 				    struct rte_eth_xstat_name *xstats_names,
 				    unsigned limit);
@@ -167,7 +167,7 @@ static int eth_igbvf_link_update(struct e1000_hw *hw);
 static void eth_igbvf_stats_get(struct rte_eth_dev *dev,
 				struct rte_eth_stats *rte_stats);
 static int eth_igbvf_xstats_get(struct rte_eth_dev *dev,
-				struct rte_eth_xstats *xstats, unsigned n);
+				struct rte_eth_xstat *xstats, unsigned n);
 static int eth_igbvf_xstats_get_names(struct rte_eth_dev *dev,
 				      struct rte_eth_xstat_name *xstats_names,
 				      unsigned limit);
@@ -1720,7 +1720,7 @@ static int eth_igb_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int
-eth_igb_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+eth_igb_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		   unsigned n)
 {
 	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1741,7 +1741,6 @@ eth_igb_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	/* Extended stats */
 	for (i = 0; i < IGB_NB_XSTATS; i++) {
-		xstats[i].name[0] = '\0';
 		xstats[i].id = i;
 		xstats[i].value = *(uint64_t *)(((char *)hw_stats) +
 			rte_igb_stats_strings[i].offset);
@@ -1807,7 +1806,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int
-eth_igbvf_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+eth_igbvf_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		     unsigned n)
 {
 	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1824,7 +1823,6 @@ eth_igbvf_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 		return 0;
 
 	for (i = 0; i < IGBVF_NB_XSTATS; i++) {
-		xstats[i].name[0] = '\0';
 		xstats[i].id = i;
 		xstats[i].value = *(uint64_t *)(((char *)hw_stats) +
 			rte_igbvf_stats_strings[i].offset);
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index e07c1ec..ce053b0 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1298,7 +1298,7 @@ static int fm10k_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int
-fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		 unsigned n)
 {
 	struct fm10k_hw_stats *hw_stats =
@@ -1310,7 +1310,6 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	/* Global stats */
 	for (i = 0; i < FM10K_NB_HW_XSTATS; i++) {
-		xstats[count].name[0] = '\0';
 		xstats[count].value = *(uint64_t *)(((char *)hw_stats) +
 			fm10k_hw_stats_strings[count].offset);
 		count++;
@@ -1319,14 +1318,12 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 	/* PF queue stats */
 	for (q = 0; q < FM10K_MAX_QUEUES_PF; q++) {
 		for (i = 0; i < FM10K_NB_RX_Q_XSTATS; i++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].value =
 				*(uint64_t *)(((char *)&hw_stats->q[q]) +
 				fm10k_hw_stats_rx_q_strings[i].offset);
 			count++;
 		}
 		for (i = 0; i < FM10K_NB_TX_Q_XSTATS; i++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].value =
 				*(uint64_t *)(((char *)&hw_stats->q[q]) +
 				fm10k_hw_stats_tx_q_strings[i].offset);
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d712bbe..f94ad87 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -305,7 +305,7 @@ static int i40e_dev_set_link_down(struct rte_eth_dev *dev);
 static void i40e_dev_stats_get(struct rte_eth_dev *dev,
 			       struct rte_eth_stats *stats);
 static int i40e_dev_xstats_get(struct rte_eth_dev *dev,
-			       struct rte_eth_xstats *xstats, unsigned n);
+			       struct rte_eth_xstat *xstats, unsigned n);
 static int i40e_dev_xstats_get_names(struct rte_eth_dev *dev,
 				     struct rte_eth_xstat_name *xstats_names,
 				     unsigned limit);
@@ -2264,7 +2264,7 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int
-i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		    unsigned n)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -2285,7 +2285,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	/* Get stats from i40e_eth_stats struct */
 	for (i = 0; i < I40E_NB_ETH_XSTATS; i++) {
-		xstats[count].name[0] = '\0';
 		xstats[count].id = count;
 		xstats[count].value = *(uint64_t *)(((char *)&hw_stats->eth) +
 			rte_i40e_stats_strings[i].offset);
@@ -2294,7 +2293,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	/* Get individiual stats from i40e_hw_port struct */
 	for (i = 0; i < I40E_NB_HW_PORT_XSTATS; i++) {
-		xstats[count].name[0] = '\0';
 		xstats[count].id = count;
 		xstats[count].value = *(uint64_t *)(((char *)hw_stats) +
 			rte_i40e_hw_port_strings[i].offset);
@@ -2303,7 +2301,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	for (i = 0; i < I40E_NB_RXQ_PRIO_XSTATS; i++) {
 		for (prio = 0; prio < 8; prio++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count;
 			xstats[count].value =
 				*(uint64_t *)(((char *)hw_stats) +
@@ -2315,7 +2312,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 
 	for (i = 0; i < I40E_NB_TXQ_PRIO_XSTATS; i++) {
 		for (prio = 0; prio < 8; prio++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count;
 			xstats[count].value =
 				*(uint64_t *)(((char *)hw_stats) +
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 4c5e45e..37af399 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -111,7 +111,7 @@ static int i40evf_dev_link_update(struct rte_eth_dev *dev,
 static void i40evf_dev_stats_get(struct rte_eth_dev *dev,
 				struct rte_eth_stats *stats);
 static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
-				 struct rte_eth_xstats *xstats, unsigned n);
+				 struct rte_eth_xstat *xstats, unsigned n);
 static int i40evf_dev_xstats_get_names(struct rte_eth_dev *dev,
 				       struct rte_eth_xstat_name *xstats_names,
 				       unsigned limit);
@@ -1005,7 +1005,7 @@ static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
-				 struct rte_eth_xstats *xstats, unsigned n)
+				 struct rte_eth_xstat *xstats, unsigned n)
 {
 	int ret;
 	unsigned i;
@@ -1023,7 +1023,6 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 
 	/* loop over xstats array and values from pstats */
 	for (i = 0; i < I40EVF_NB_XSTATS; i++) {
-		xstats[i].name[0] = '\0';
 		xstats[i].id = i;
 		xstats[i].value = *(uint64_t *)(((char *)pstats) +
 			rte_i40evf_stats_strings[i].offset);
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 9e73492..125c257 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -174,9 +174,9 @@ static int ixgbe_dev_link_update(struct rte_eth_dev *dev,
 static void ixgbe_dev_stats_get(struct rte_eth_dev *dev,
 				struct rte_eth_stats *stats);
 static int ixgbe_dev_xstats_get(struct rte_eth_dev *dev,
-				struct rte_eth_xstats *xstats, unsigned n);
+				struct rte_eth_xstat *xstats, unsigned n);
 static int ixgbevf_dev_xstats_get(struct rte_eth_dev *dev,
-				  struct rte_eth_xstats *xstats, unsigned n);
+				  struct rte_eth_xstat *xstats, unsigned n);
 static void ixgbe_dev_stats_reset(struct rte_eth_dev *dev);
 static void ixgbe_dev_xstats_reset(struct rte_eth_dev *dev);
 static int ixgbe_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
@@ -2775,7 +2775,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 }
 
 static int
-ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 					 unsigned n)
 {
 	struct ixgbe_hw *hw =
@@ -2808,7 +2808,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 	count = 0;
 	for (i = 0; i < IXGBE_NB_HW_STATS; i++) {
 		xstats[count].id = count;
-		xstats[count].name[0] = '\0';
 		xstats[count].value = *(uint64_t *)(((char *)hw_stats) +
 				rte_ixgbe_stats_strings[i].offset);
 		count++;
@@ -2818,7 +2817,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 	for (stat = 0; stat < IXGBE_NB_RXQ_PRIO_STATS; stat++) {
 		for (i = 0; i < IXGBE_NB_RXQ_PRIO_VALUES; i++) {
 			xstats[count].id = count;
-			xstats[count].name[0] = '\0';
 			xstats[count].value = *(uint64_t *)(((char *)hw_stats) +
 					rte_ixgbe_rxq_strings[stat].offset +
 					(sizeof(uint64_t) * i));
@@ -2830,7 +2828,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 	for (stat = 0; stat < IXGBE_NB_TXQ_PRIO_STATS; stat++) {
 		for (i = 0; i < IXGBE_NB_TXQ_PRIO_VALUES; i++) {
 			xstats[count].id = count;
-			xstats[count].name[0] = '\0';
 			xstats[count].value = *(uint64_t *)(((char *)hw_stats) +
 					rte_ixgbe_txq_strings[stat].offset +
 					(sizeof(uint64_t) * i));
@@ -2884,7 +2881,7 @@ ixgbevf_update_stats(struct rte_eth_dev *dev)
 }
 
 static int
-ixgbevf_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+ixgbevf_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		       unsigned n)
 {
 	struct ixgbevf_hw_stats *hw_stats = (struct ixgbevf_hw_stats *)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 83df025..a833740 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -79,7 +79,7 @@ static void virtio_get_hwaddr(struct virtio_hw *hw);
 static void virtio_dev_stats_get(struct rte_eth_dev *dev,
 				 struct rte_eth_stats *stats);
 static int virtio_dev_xstats_get(struct rte_eth_dev *dev,
-				 struct rte_eth_xstats *xstats, unsigned n);
+				 struct rte_eth_xstat *xstats, unsigned n);
 static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 				       struct rte_eth_xstat_name *xstats_names,
 				       unsigned limit);
@@ -759,7 +759,7 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 }
 
 static int
-virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		      unsigned n)
 {
 	unsigned i;
@@ -780,7 +780,6 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 		unsigned t;
 
 		for (t = 0; t < VIRTIO_NB_Q_XSTATS; t++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count;
 			xstats[count].value = *(uint64_t *)(((char *)rxvq) +
 				rte_virtio_q_stat_strings[t].offset);
@@ -797,7 +796,6 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
 		unsigned t;
 
 		for (t = 0; t < VIRTIO_NB_Q_XSTATS; t++) {
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count;
 			xstats[count].value = *(uint64_t *)(((char *)txvq) +
 				rte_virtio_q_stat_strings[t].offset);
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 79a01cc..afe1291 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1584,7 +1584,7 @@ rte_eth_xstats_get_names(uint8_t port_id,
 
 /* retrieve ethdev extended statistics */
 int
-rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
+rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats,
 	unsigned n)
 {
 	struct rte_eth_stats eth_stats;
@@ -1626,7 +1626,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
 		stats_ptr = RTE_PTR_ADD(&eth_stats,
 					rte_stats_strings[i].offset);
 		val = *stats_ptr;
-		xstats[count].name[0] = '\0';
 		xstats[count].id = count + xcount;
 		xstats[count++].value = val;
 	}
@@ -1638,7 +1637,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
 					rte_rxq_stats_strings[i].offset +
 					q * sizeof(uint64_t));
 			val = *stats_ptr;
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count + xcount;
 			xstats[count++].value = val;
 		}
@@ -1651,7 +1649,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
 					rte_txq_stats_strings[i].offset +
 					q * sizeof(uint64_t));
 			val = *stats_ptr;
-			xstats[count].name[0] = '\0';
 			xstats[count].id = count + xcount;
 			xstats[count++].value = val;
 		}
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 7d8ce3c..76b9d61 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -914,8 +914,7 @@ struct rte_eth_txq_info {
  * statistics that are not provided in the generic rte_eth_stats
  * structure.
  */
-struct rte_eth_xstats {
-	char name[RTE_ETH_XSTATS_NAME_SIZE];
+struct rte_eth_xstat {
 	uint64_t id;
 	uint64_t value;
 };
@@ -1060,7 +1059,7 @@ typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
 /**< @internal Reset global I/O statistics of an Ethernet device to 0. */
 
 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
-	struct rte_eth_xstats *stats, unsigned n);
+	struct rte_eth_xstat *stats, unsigned n);
 /**< @internal Get extended stats of an Ethernet device. */
 
 typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
@@ -2308,7 +2307,7 @@ int rte_eth_xstats_get_names(uint8_t port_id,
  *     shall not be used by the caller.
  *   - negative value on error (invalid port id)
  */
-int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
+int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats,
 		unsigned n);
 
 /**
-- 
2.5.5

  parent reply	other threads:[~2016-06-13 15:52 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 14:44 [dpdk-dev] [RFC PATCH v1 0/3] Remove string operations from xstats Remy Horton
2016-04-15 14:44 ` [dpdk-dev] [RFC PATCH v1 1/3] rte: change xstats to use integer keys Remy Horton
2016-04-29 13:17   ` David Harton (dharton)
2016-04-15 14:44 ` [dpdk-dev] [RFC PATCH v1 2/3] drivers/net/ixgbe: change xstats to use integers Remy Horton
2016-04-29 13:43   ` David Harton (dharton)
2016-05-03 12:22     ` Remy Horton
2016-05-03 13:40       ` David Harton (dharton)
2016-04-15 14:44 ` [dpdk-dev] [RFC PATCH v1 3/3] examples/ethtool: add xstats display command Remy Horton
2016-04-20 16:03 ` [dpdk-dev] [RFC PATCH v1 0/3] Remove string operations from xstats David Harton (dharton)
2016-04-20 16:49   ` Mcnamara, John
2016-04-22 15:04     ` David Harton (dharton)
2016-04-28 14:56   ` Tahhan, Maryam
2016-04-28 15:58     ` David Harton (dharton)
2016-04-29 10:21       ` Remy Horton
2016-04-29 12:15         ` David Harton (dharton)
2016-04-29 12:52 ` David Harton (dharton)
2016-05-06 11:11 ` [dpdk-dev] [RFC PATCH v2 " Remy Horton
2016-05-06 11:11   ` [dpdk-dev] [RFC PATCH v2 1/3] rte: change xstats to use integer keys Remy Horton
2016-05-09 13:59     ` David Harton (dharton)
2016-05-10  8:58       ` Remy Horton
2016-05-12 16:17       ` Thomas Monjalon
2016-05-16 10:47     ` Tahhan, Maryam
2016-05-18  8:31     ` Tahhan, Maryam
2016-05-18  8:45       ` Remy Horton
2016-05-06 11:11   ` [dpdk-dev] [RFC PATCH v2 2/3] drivers/net/ixgbe: change xstats to use integer id Remy Horton
2016-05-09 14:06     ` David Harton (dharton)
2016-05-18  8:41     ` Tahhan, Maryam
2016-05-06 11:11   ` [dpdk-dev] [RFC PATCH v2 3/3] examples/ethtool: add xstats display command Remy Horton
2016-05-09 14:08     ` David Harton (dharton)
2016-05-18  8:42     ` Tahhan, Maryam
2016-05-16 10:42   ` [dpdk-dev] [RFC PATCH v2 0/3] Remove string operations from xstats Tahhan, Maryam
2016-05-18 10:12     ` Remy Horton
2016-05-30 10:48   ` [dpdk-dev] [PATCH v3 00/10] " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 01/10] rte: change xstats to use integer ids Remy Horton
2016-06-08  9:37       ` Thomas Monjalon
2016-06-08 11:16         ` Remy Horton
2016-06-08 12:22           ` Thomas Monjalon
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 02/10] drivers/net/ixgbe: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 03/10] drivers/net/e1000: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 04/10] drivers/net/fm10k: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 05/10] drivers/net/i40e: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 06/10] drivers/net/virtio: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 07/10] app/test-pmd: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 08/10] app/proc_info: " Remy Horton
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 09/10] remove name field from struct rte_eth_xstats Remy Horton
2016-06-08 12:23       ` Thomas Monjalon
2016-05-30 10:48     ` [dpdk-dev] [PATCH v3 10/10] doc: update xstats documentation Remy Horton
2016-06-09  8:48       ` Mcnamara, John
2016-06-06 12:45     ` [dpdk-dev] [PATCH v3 00/10] Remove string operations from xstats David Harton (dharton)
2016-06-13 15:51     ` [dpdk-dev] [PATCH v4 0/8] " Remy Horton
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 1/8] rte: change xstats to use integer ids Remy Horton
2016-06-15  9:19         ` Thomas Monjalon
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 2/8] drivers/net/ixgbe: " Remy Horton
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 3/8] drivers/net/e1000: " Remy Horton
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 4/8] drivers/net/fm10k: " Remy Horton
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 5/8] drivers/net/i40e: " Remy Horton
2016-06-13 15:51       ` [dpdk-dev] [PATCH v4 6/8] drivers/net/virtio: " Remy Horton
2016-06-13 15:52       ` Remy Horton [this message]
2016-06-15  9:13         ` [dpdk-dev] [PATCH v4 7/8] rte: change xstats usage to new API Thomas Monjalon
2016-06-13 15:52       ` [dpdk-dev] [PATCH v4 8/8] doc: update xstats documentation Remy Horton
2016-06-14 14:06         ` Mcnamara, John
2016-06-15 15:25       ` [dpdk-dev] [PATCH v5 0/7] Remove string operations from xstats Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 1/7] rte: change xstats to use integer ids Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 2/7] drivers/net/ixgbe: " Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 3/7] drivers/net/e1000: " Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 4/7] drivers/net/fm10k: " Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 5/7] drivers/net/i40e: " Remy Horton
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 6/7] drivers/net/virtio: " Remy Horton
2016-06-20 10:43           ` Yuanhan Liu
2016-06-15 15:25         ` [dpdk-dev] [PATCH v5 7/7] rte: change xstats usage to new API Remy Horton
2016-06-16 16:02         ` [dpdk-dev] [PATCH v5 0/7] Remove string operations from xstats Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465833121-26953-8-git-send-email-remy.horton@intel.com \
    --to=remy.horton@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=huawei.xie@intel.com \
    --cc=jing.d.chen@intel.com \
    --cc=maryam.tahhan@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=thomas.monjalon@6wind.com \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).