Skip to contentSkip to conversation

ethdev: fix xstat name of basic stats per queue

PATCH Applied Thomas Monjalon 9 participants 13 messages Oct 7, 2020 – Oct 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: fix xstat name of basic stats per queue

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

	http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")
---
 doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
 lib/librte_ethdev/rte_ethdev.c         | 4 ++--
 lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +7 -1
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+
+* ethdev: Renamed internal APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
   * ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()``
lib/librte_ethdev/rte_ethdev.c +2 -2
index 48d1333b17..286c1b5966 100644
@@ -2549,7 +2549,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_RXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"rx_q%u%s",
+				"rx_q%u_%s",
 				id_queue, rte_rxq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
@@ -2560,7 +2560,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_TXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"tx_q%u%s",
+				"tx_q%u_%s",
 				id_queue, rte_txq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
lib/librte_ethdev/rte_ethdev.h +7 -0
index d2bf74f128..86434c9cae 100644
@@ -1507,6 +1507,13 @@ struct rte_eth_xstat {
  * An array of this structure is returned by rte_eth_xstats_get_names().
  * It lists the names of extended statistics for a PMD. The *rte_eth_xstat*
  * structure references these names by their array index.
+ *
+ * The xstats should follow a common naming scheme.
+ * Some names are standardized in rte_stats_strings.
+ * Examples:
+ *     - rx_missed_errors
+ *     - tx_q3_bytes
+ *     - tx_size_128_to_255_packets
  */
 struct rte_eth_xstat_name {
 	char name[RTE_ETH_XSTATS_NAME_SIZE]; /**< The statistic name. */
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

	http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")
---
 doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
 lib/librte_ethdev/rte_ethdev.c         | 4 ++--
 lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644

doc/guides/rel_notes/release_20_11.rst API Changes · line 203

Quoted 4 lines
doc/guides/rel_notes/release_20_11.rst +0 -1
@@ -200,7 +200,13 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:

Technically not related to this patch, but I think it's ok to slip it in here. :-)

Quoted 53 lines
doc/guides/rel_notes/release_20_11.rst +7 -0
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+
+* ethdev: Renamed internal APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
   * ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()``
lib/librte_ethdev/rte_ethdev.c +2 -2
index 48d1333b17..286c1b5966 100644
@@ -2549,7 +2549,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_RXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"rx_q%u%s",
+				"rx_q%u_%s",
 				id_queue, rte_rxq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
@@ -2560,7 +2560,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_TXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"tx_q%u%s",
+				"tx_q%u_%s",
 				id_queue, rte_txq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
lib/librte_ethdev/rte_ethdev.h +7 -0
index d2bf74f128..86434c9cae 100644
@@ -1507,6 +1507,13 @@ struct rte_eth_xstat {
  * An array of this structure is returned by rte_eth_xstats_get_names().
  * It lists the names of extended statistics for a PMD. The *rte_eth_xstat*
  * structure references these names by their array index.
+ *
+ * The xstats should follow a common naming scheme.
+ * Some names are standardized in rte_stats_strings.
+ * Examples:
+ *     - rx_missed_errors
+ *     - tx_q3_bytes
+ *     - tx_size_128_to_255_packets
  */
 struct rte_eth_xstat_name {
 	char name[RTE_ETH_XSTATS_NAME_SIZE]; /**< The statistic name. */
Signature · 1 line
2.28.0
Acked-by on v1 1/1
#2 lore raw
In reply to Thomas Monjalon
Quoted 17 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

Quoted 6 lines
	http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")

---

Quoted 65 lines
 doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
 lib/librte_ethdev/rte_ethdev.c         | 4 ++--
 lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +7 -1
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+
+* ethdev: Renamed internal APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
   * ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()``
lib/librte_ethdev/rte_ethdev.c +2 -2
index 48d1333b17..286c1b5966 100644
@@ -2549,7 +2549,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_RXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"rx_q%u%s",
+				"rx_q%u_%s",
 				id_queue, rte_rxq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
@@ -2560,7 +2560,7 @@ rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,
 		for (idx = 0; idx < RTE_NB_TXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"tx_q%u%s",
+				"tx_q%u_%s",
 				id_queue, rte_txq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
lib/librte_ethdev/rte_ethdev.h +7 -0
index d2bf74f128..86434c9cae 100644
@@ -1507,6 +1507,13 @@ struct rte_eth_xstat {
  * An array of this structure is returned by rte_eth_xstats_get_names().
  * It lists the names of extended statistics for a PMD. The *rte_eth_xstat*
  * structure references these names by their array index.
+ *
+ * The xstats should follow a common naming scheme.
+ * Some names are standardized in rte_stats_strings.
+ * Examples:
+ *     - rx_missed_errors
+ *     - tx_q3_bytes
+ *     - tx_size_128_to_255_packets
  */
 struct rte_eth_xstat_name {
 	char name[RTE_ETH_XSTATS_NAME_SIZE]; /**< The statistic name. */
#3 lore raw
Quoted 111 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Kevin Traynor
Sent: Thursday, October 8, 2020 12:10 PM
To: NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix xstat name of basic stats per queue

Quoted 14 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

Quoted 6 lines

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Ffast.
dpdk.org%2Fevents%2Fslides%2FDPDK-2019-09-

Ethernet_Statistics.pdf&amp;

Quoted 1 line

data=02%7C01%7Casafp%40nvidia.com%7C4a551495aff7412fa65108d86b6a22 2f%7

Quoted 1 line

C43083d15727340c1b7db39efd9ccc17a%7C0%7C1%7C637377450869384533&a mp;sda

Quoted 1 line

ta=1Nn2If%2BgHcSc4hZS8FtLTBD5eyEyZeDZZP4u0%2FON5lU%3D&amp;reserv ed=0

Quoted 6 lines
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer

ids")

---

Quoted 15 lines
 doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
 lib/librte_ethdev/rte_ethdev.c         | 4 ++--
 lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -1
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:

doc/guides/rel_notes/release_20_11.rst API Changes · line 212

Quoted 10 lines
doc/guides/rel_notes/release_20_11.rst +8 -0
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+
+* ethdev: Renamed internal APIs:
 
   * ``_rte_eth_dev_callback_process()`` ->

``rte_eth_dev_callback_process()``

lib/librte_ethdev/rte_ethdev.c rte_eth_basic_stats_get_names(struct

Quoted 6 lines

* ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()`` diff
--git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 48d1333b17..286c1b5966 100644

lib/librte_ethdev/rte_ethdev.c +0 -0
@@ -2549,7 +2549,7 @@ rte_eth_basic_stats_get_names(struct

rte_eth_dev *dev,

lib/librte_ethdev/rte_ethdev.c rte_eth_basic_stats_get_names(struct

Quoted 9 lines
lib/librte_ethdev/rte_ethdev.c +1 -1
 		for (idx = 0; idx < RTE_NB_RXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"rx_q%u%s",
+				"rx_q%u_%s",
 				id_queue, rte_rxq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
@@ -2560,7 +2560,7 @@ rte_eth_basic_stats_get_names(struct

rte_eth_dev *dev,

Quoted 19 lines
lib/librte_ethdev/rte_ethdev.c +1 -1
 		for (idx = 0; idx < RTE_NB_TXQ_STATS; idx++) {
 			snprintf(xstats_names[cnt_used_entries].name,
 				sizeof(xstats_names[0].name),
-				"tx_q%u%s",
+				"tx_q%u_%s",
 				id_queue, rte_txq_stats_strings[idx].name);
 			cnt_used_entries++;
 		}
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_ethdev.h index d2bf74f128..86434c9cae 100644

lib/librte_ethdev/rte_ethdev.h +3 -0
@@ -1507,6 +1507,13 @@ struct rte_eth_xstat {
  * An array of this structure is returned by rte_eth_xstats_get_names().
  * It lists the names of extended statistics for a PMD. The *rte_eth_xstat*
  * structure references these names by their array index.
+ *
+ * The xstats should follow a common naming scheme.
+ * Some names are standardized in rte_stats_strings.
Quoted 9 lines

lib/librte_ethdev/rte_ethdev.h struct rte_eth_xstat {

Quoted 7 lines
lib/librte_ethdev/rte_ethdev.h +4 -0
+ * Examples:
+ *     - rx_missed_errors
+ *     - tx_q3_bytes
+ *     - tx_size_128_to_255_packets
  */
 struct rte_eth_xstat_name {
 	char name[RTE_ETH_XSTATS_NAME_SIZE]; /**< The statistic name.

*/

Quoted 1 line

Thanks, Thomas, for taking care of such changes 😊
Looks like hns3 pmd should be updated as well, since it uses the same format.

#4 lore raw
Quoted 120 lines · Asaf Penso
Quoted 111 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Kevin Traynor
Sent: Thursday, October 8, 2020 12:10 PM
To: NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix xstat name of basic stats per queue

Quoted 14 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

Quoted 6 lines

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Ffast.
dpdk.org%2Fevents%2Fslides%2FDPDK-2019-09-

Ethernet_Statistics.pdf&amp;

Quoted 1 line

data=02%7C01%7Casafp%40nvidia.com%7C4a551495aff7412fa65108d86b6a22 2f%7

Quoted 1 line

C43083d15727340c1b7db39efd9ccc17a%7C0%7C1%7C637377450869384533&a mp;sda

Quoted 1 line

ta=1Nn2If%2BgHcSc4hZS8FtLTBD5eyEyZeDZZP4u0%2FON5lU%3D&amp;reserv ed=0

Quoted 6 lines
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer

ids")

---

Quoted 15 lines
  doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
  lib/librte_ethdev/rte_ethdev.c         | 4 ++--
  lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -1
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 
  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:

doc/guides/rel_notes/release_20_11.rst API Changes · line 212

Quoted 10 lines
doc/guides/rel_notes/release_20_11.rst +8 -0
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+
+* ethdev: Renamed internal APIs:
 
    * ``_rte_eth_dev_callback_process()`` ->

``rte_eth_dev_callback_process()``

lib/librte_ethdev/rte_ethdev.c rte_eth_basic_stats_get_names(struct

Quoted 6 lines

* ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()`` diff
--git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 48d1333b17..286c1b5966 100644

lib/librte_ethdev/rte_ethdev.c +0 -0
@@ -2549,7 +2549,7 @@ rte_eth_basic_stats_get_names(struct

rte_eth_dev *dev,

lib/librte_ethdev/rte_ethdev.c rte_eth_basic_stats_get_names(struct

Quoted 9 lines
lib/librte_ethdev/rte_ethdev.c +1 -1
  		for (idx = 0; idx < RTE_NB_RXQ_STATS; idx++) {
  			snprintf(xstats_names[cnt_used_entries].name,
  				sizeof(xstats_names[0].name),
-				"rx_q%u%s",
+				"rx_q%u_%s",
  				id_queue, rte_rxq_stats_strings[idx].name);
  			cnt_used_entries++;
  		}
@@ -2560,7 +2560,7 @@ rte_eth_basic_stats_get_names(struct

rte_eth_dev *dev,

Quoted 19 lines
lib/librte_ethdev/rte_ethdev.c +1 -1
  		for (idx = 0; idx < RTE_NB_TXQ_STATS; idx++) {
  			snprintf(xstats_names[cnt_used_entries].name,
  				sizeof(xstats_names[0].name),
-				"tx_q%u%s",
+				"tx_q%u_%s",
  				id_queue, rte_txq_stats_strings[idx].name);
  			cnt_used_entries++;
  		}
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_ethdev.h index d2bf74f128..86434c9cae 100644

lib/librte_ethdev/rte_ethdev.h +3 -0
@@ -1507,6 +1507,13 @@ struct rte_eth_xstat {
   * An array of this structure is returned by rte_eth_xstats_get_names().
   * It lists the names of extended statistics for a PMD. The *rte_eth_xstat*
   * structure references these names by their array index.
+ *
+ * The xstats should follow a common naming scheme.
+ * Some names are standardized in rte_stats_strings.
Quoted 9 lines

lib/librte_ethdev/rte_ethdev.h struct rte_eth_xstat {

Quoted 7 lines
lib/librte_ethdev/rte_ethdev.h +4 -0
+ * Examples:
+ *     - rx_missed_errors
+ *     - tx_q3_bytes
+ *     - tx_size_128_to_255_packets
   */
  struct rte_eth_xstat_name {
  	char name[RTE_ETH_XSTATS_NAME_SIZE]; /**< The statistic name.

*/

Quoted 1 line
Quoted 3 lines

Thanks, Thomas, for taking care of such changes 😊
Looks like hns3 pmd should be updated as well, since it uses the same format.

Added hns3 maintainers.

Xavier, Connor, Yisen, can you please check the above naming scheme for the xstats and apply it to the hns3 pmd specific ones?

Thanks,
ferruh

Applied
#5 lore raw
In reply to Kevin Traynor
Quoted 20 lines · Kevin Traynor
Quoted 19 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

	http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
Quoted 7 lines
Quoted 4 lines
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")

---

Applied to dpdk-next-net/main, thanks.

Reviewed-by on v1 1/1
#6 lore raw
In reply to Thomas Monjalon
Quoted 14 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

Quoted 8 lines

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

	http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")

no objection,

Quoted 10 lines
  doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
  lib/librte_ethdev/rte_ethdev.c         | 4 ++--
  lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644

doc/guides/rel_notes/release_20_11.rst API Changes · line 208

Quoted 10 lines
doc/guides/rel_notes/release_20_11.rst +6 -1
@@ -200,7 +200,13 @@ API Changes
 
  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

Acked-by
#7 lore raw

Hi Ferruh, Thomas,

Quoted 65 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday 8 October 2020 16:42
To: Thomas Monjalon <[email protected]>; [email protected]; Van Haaren, Harry <[email protected]>; Power, Ciara <[email protected]>; Laatz, Kevin <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] ethdev: fix xstat name of basic stats per queue

Quoted 18 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

Quoted 7 lines

http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pd
f

Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer

ids")

no objection,

Quoted 12 lines
  doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
  lib/librte_ethdev/rte_ethdev.c         | 4 ++--
  lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 

doc/guides/rel_notes/release_20_11.rst API Changes · line 209

Quoted 10 lines
doc/guides/rel_notes/release_20_11.rst +7 -1
  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

I don't think this change will affect anything with telemetry itself, but I am not so familiar with the CollectD plugin, Reshma may be able to verify that.

When using the new dpdk-telemetry.py, the name is just changed in the output which seems ok to me:

	--> /ethdev/xstats,0
	{"/ethdev/xstats": {... "rx_q0packets": 0,

Changes to:

	--> /ethdev/xstats,0
	{"/ethdev/xstats": {... "rx_q0_packets": 0,
#8 lore raw
Quoted 80 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Friday, October 9, 2020 9:33 AM
To: Yigit, Ferruh <[email protected]>; Thomas Monjalon <[email protected]>; [email protected]; Van Haaren, Harry <[email protected]>; Laatz, Kevin <[email protected]>
Cc: [email protected]; Pattan, Reshma <[email protected]>
Subject: RE: [PATCH] ethdev: fix xstat name of basic stats per queue

Hi Ferruh, Thomas,

Quoted 66 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday 8 October 2020 16:42
To: Thomas Monjalon <[email protected]>; [email protected]; Van Haaren, Harry <[email protected]>; Power, Ciara <[email protected]>; Laatz, Kevin <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] ethdev: fix xstat name of basic stats per queue

Quoted 18 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
* direction
* detail 1
* detail 2
* detail n
* unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:

Quoted 8 lines

http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.p
d
f

Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer

ids")

no objection,

Quoted 12 lines
  doc/guides/rel_notes/release_20_11.rst | 8 +++++++-
  lib/librte_ethdev/rte_ethdev.c         | 4 ++--
  lib/librte_ethdev/rte_ethdev.h         | 7 +++++++
  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
 

doc/guides/rel_notes/release_20_11.rst API Changes · line 209

Quoted 10 lines
doc/guides/rel_notes/release_20_11.rst +7 -1
  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
-* Renamed internal ethdev APIs:
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 4 lines
Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

I don't think this change will affect anything with telemetry itself, but I am not so familiar with the CollectD plugin, Reshma may be able to verify that.

Neither collectd has any dependency on naming.

#9 lore raw
Quoted 11 lines · Reshma
Quoted 11 lines
Quoted 11 lines

doc/guides/rel_notes/release_20_11.rst API Changes · line 208

Quoted 7 lines
doc/guides/rel_notes/release_20_11.rst +7 -0
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

I don't think this change will affect anything with telemetry itself, but I am not so familiar with the CollectD plugin, Reshma may be able to verify that.

Neither collectd has any dependency on naming.

I am not sure about this statement.
collectd dpdkstats plugin does seem to inspect the names.

And I can see what looks like a workaround on the problem Thomas is fixing here.
https://github.com/collectd/collectd/commit/126b35ee8786a3aca1bcc1346a60bc528d06c414

Can you test Thomas patch?

Signature · 1 line
David Marchand
#10 lore raw
Quoted 22 lines

-----Original Message-----
From: David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix xstat name of basic stats per queue

Quoted 11 lines · Reshma
Quoted 11 lines
Quoted 11 lines

doc/guides/rel_notes/release_20_11.rst API Changes · line 208

Quoted 7 lines
doc/guides/rel_notes/release_20_11.rst +7 -0
+* ethdev: Renamed basic statistics per queue. An underscore is
+inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from

rename?

Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

I don't think this change will affect anything with telemetry itself, but I am not so familiar with the CollectD plugin, Reshma may be able

to verify that.

Quoted 2 lines

Neither collectd has any dependency on naming.

I am not sure about this statement.
collectd dpdkstats plugin does seem to inspect the names.

Hi,

I should have been more clear on this, It is dpdk_telemetry plugin of collectd I am talking about, as I worked on that. dpdk_telemetry plugin of collectd do not have dependency on the naming.

dpdkstats plugin I did not work on, so I cannot comment on that, might be Harry able to help with that .

Thanks,
Reshma

#11 lore raw
In reply to Ferruh Yigit
Quoted 49 lines · Ferruh Yigit
Quoted 20 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
    * direction
    * detail 1
    * detail 2
    * detail n
    * unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:
    http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf

Quoted 3 lines
Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")

no objection,

Quoted 12 lines

  doc/guides/rel_notes/release_20_11.rst | 8 +++++++- lib/librte_ethdev/rte_ethdev.c         | 4 ++-- lib/librte_ethdev/rte_ethdev.h         | 7 +++++++

  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
     * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.

  -* Renamed internal ethdev APIs:

doc/guides/rel_notes/release_20_11.rst API Changes · line 208

Quoted 6 lines
doc/guides/rel_notes/release_20_11.rst +6 -0
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

Looks to me like everything will be ok in the old collectd plugins too - from doing a code review, it seems it just gets the names from ethdev.

/Kevin

#12 lore raw
Quoted 50 lines · Kevin Laatz
Quoted 48 lines · Ferruh Yigit
Quoted 14 lines · Thomas Monjalon

As described in doc/guides/prog_guide/poll_mode_drv.rst, the naming scheme for the xstats is parts separated with underscore:
    * direction
    * detail 1
    * detail 2
    * detail n
    * unit
where detail 1 can be "q" followed with a queue number.
It means the name of the stats per queue should be rx_qN_* or tx_qN_*.

The second underscore was missing so far.
Fixing the basic xstat names may be considered an API change, that's why it should not be backported.

Quoted 8 lines

While fixing this mistake, some examples of the naming scheme are given as part of the API documentation of rte_eth_xstat_name. More proposals about standardizing statistics:
    http://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf

Fixes bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")

no objection,

Quoted 12 lines

  doc/guides/rel_notes/release_20_11.rst | 8 +++++++- lib/librte_ethdev/rte_ethdev.c         | 4 ++-- lib/librte_ethdev/rte_ethdev.h         | 7 +++++++

  3 files changed, 16 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_20_11.rst +0 -0
index cdf20404c9..d0d77c5d3d 100644
@@ -200,7 +200,13 @@ API Changes
     * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.

  -* Renamed internal ethdev APIs:

doc/guides/rel_notes/release_20_11.rst API Changes · line 208

Quoted 6 lines
doc/guides/rel_notes/release_20_11.rst +6 -0
+* ethdev: Renamed basic statistics per queue. An underscore is inserted
+  between the queue number and the rest of the xstat name:
+
+  * ``rx_qN*`` -> ``rx_qN_*``
+  * ``tx_qN*`` -> ``tx_qN_*``
+

As far as I remember collect plugin was using xstat output, does this rename affects it? Or any other telemetry application relying on xstats.

Quoted 4 lines
Quoted 1 line

Harry, Ciara, Kevin, do you know anything that will be affected from rename?

Looks to me like everything will be ok in the old collectd plugins too - from doing a code review, it seems it just gets the names from ethdev.

Thanks for checking, the workaround David highlighted in the collectd seems preventing this change to cause an error, so we can proceed.

But it would be nice to test the 'dpdkstat' plugin with this change. Do you know who is the maintainer of that plugin in collectd?