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")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
This commit is contained in:
Thomas Monjalon 2020-10-07 23:48:48 +02:00 committed by Ferruh Yigit
parent 6d3c595d3a
commit 1372d0cb2a
3 changed files with 16 additions and 3 deletions

View File

@ -369,7 +369,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 functions:
* ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
* ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()``

View File

@ -2545,7 +2545,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++;
}
@ -2556,7 +2556,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++;
}

View File

@ -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. */