[RFC,v2,2/2] doc: announce queue stats moving to xstats

Message ID 20201014022649.2165524-2-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [RFC,v2,1/2] ethdev: provide device flag to bypass ethdev queue xstats |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ferruh Yigit Oct. 14, 2020, 2:26 a.m. UTC
  Queue stats will be removed from basic stats to xstats.

It will be PMDs responsibility to fill queue stats based on number of
queues they have.

Until all PMDs implement the xstats, a temporary
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
to the xstats should clear this flag to bypass the ethdev layer autofill
for queue stats.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/rte_config.h                  | 2 +-
 doc/guides/rel_notes/deprecation.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.h       | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)
  

Comments

Ray Kinsella Oct. 14, 2020, 8:43 a.m. UTC | #1
On 14/10/2020 03:26, Ferruh Yigit wrote:
> Queue stats will be removed from basic stats to xstats.
> 
> It will be PMDs responsibility to fill queue stats based on number of
> queues they have.
> 
> Until all PMDs implement the xstats, a temporary
> 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> to the xstats should clear this flag to bypass the ethdev layer autofill
> for queue stats.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  config/rte_config.h                  | 2 +-
>  doc/guides/rel_notes/deprecation.rst | 7 +++++++
>  lib/librte_ethdev/rte_ethdev.h       | 3 +++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>
  
Igor Ryzhov Oct. 14, 2020, 9:35 a.m. UTC | #2
Hi Ferruh,

As rte_eth_stats is going to be changed, is it possible to add new counters
there?
For example, in/out multicast/broadcast packets.

Igor

On Wed, Oct 14, 2020 at 5:27 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> Queue stats will be removed from basic stats to xstats.
>
> It will be PMDs responsibility to fill queue stats based on number of
> queues they have.
>
> Until all PMDs implement the xstats, a temporary
> 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> to the xstats should clear this flag to bypass the ethdev layer autofill
> for queue stats.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  config/rte_config.h                  | 2 +-
>  doc/guides/rel_notes/deprecation.rst | 7 +++++++
>  lib/librte_ethdev/rte_ethdev.h       | 3 +++
>  3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 03d90d78bc..9ef3b75940 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -55,7 +55,7 @@
>
>  /* ether defines */
>  #define RTE_MAX_QUEUES_PER_PORT 1024
> -#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
> +#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16 /* max 256 */
>  #define RTE_ETHDEV_RXTX_CALLBACKS 1
>
>  /* cryptodev defines */
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 584e720879..9143cfc529 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -164,6 +164,13 @@ Deprecation Notices
>    following the IPv6 header, as proposed in RFC
>    https://mails.dpdk.org/archives/dev/2020-August/177257.html.
>
> +* ethdev: Queue specific stats fields will be removed from ``struct
> rte_eth_stats``.
> +  Mentioned fields are: ``q_ipackets``, ``q_opackets``, ``q_ibytes``,
> ``q_obytes``,
> +  ``q_errors``.
> +  Instead queue stats will be received via xstats API. Current method
> support
> +  will be limited to maximum 256 queues.
> +  Also compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` will be removed.
> +
>  * security: The API ``rte_security_session_create`` takes only single
> mempool
>    for session and session private data. So the application need to create
>    mempool for twice the number of sessions needed and will also lead to
> diff --git a/lib/librte_ethdev/rte_ethdev.h
> b/lib/librte_ethdev/rte_ethdev.h
> index bb7a2b4289..a2e811ca48 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -253,6 +253,7 @@ struct rte_eth_stats {
>         uint64_t ierrors;   /**< Total number of erroneous received
> packets. */
>         uint64_t oerrors;   /**< Total number of failed transmitted
> packets. */
>         uint64_t rx_nombuf; /**< Total number of RX mbuf allocation
> failures. */
> +       /* Queue stats are limited to max 256 queues */
>         uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
>         /**< Total number of queue RX packets. */
>         uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
> @@ -2704,6 +2705,7 @@ int rte_eth_xstats_reset(uint16_t port_id);
>   *   The per-queue packet statistics functionality number that the
> transmit
>   *   queue is to be assigned.
>   *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
> + *   Max RTE_ETHDEV_QUEUE_STAT_CNTRS being 256.
>   * @return
>   *   Zero if successful. Non-zero otherwise.
>   */
> @@ -2724,6 +2726,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t
> port_id,
>   *   The per-queue packet statistics functionality number that the receive
>   *   queue is to be assigned.
>   *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
> + *   Max RTE_ETHDEV_QUEUE_STAT_CNTRS being 256.
>   * @return
>   *   Zero if successful. Non-zero otherwise.
>   */
> --
> 2.26.2
>
>
  
Thomas Monjalon Oct. 14, 2020, 9:45 a.m. UTC | #3
14/10/2020 11:35, Igor Ryzhov:
> Hi Ferruh,
> 
> As rte_eth_stats is going to be changed, is it possible to add new counters
> there?
> For example, in/out multicast/broadcast packets.

Good question.
In order to avoid redundancy, I prefer focusing on xstats
and plan deprecation of rte_eth_stats.

The basic stats you are asking for should have standardized names
and reserved ids in xstats API.
Please see these slides:
https://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
  
Igor Ryzhov Oct. 15, 2020, 7:55 a.m. UTC | #4
Hi Thomas,

Thanks for the slides, I checked the latest code and multicast/broadcast
counters mostly look standardized. But mlx5 adds the "port" word to all
its xstats names. I suppose you may be the right person to ask - is there
any specific reason for this?

On Wed, Oct 14, 2020 at 12:45 PM Thomas Monjalon <thomas@monjalon.net>
wrote:

> 14/10/2020 11:35, Igor Ryzhov:
> > Hi Ferruh,
> >
> > As rte_eth_stats is going to be changed, is it possible to add new
> counters
> > there?
> > For example, in/out multicast/broadcast packets.
>
> Good question.
> In order to avoid redundancy, I prefer focusing on xstats
> and plan deprecation of rte_eth_stats.
>
> The basic stats you are asking for should have standardized names
> and reserved ids in xstats API.
> Please see these slides:
> https://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
>
>
>
  
Thomas Monjalon Oct. 15, 2020, 8:03 a.m. UTC | #5
15/10/2020 09:55, Igor Ryzhov:
> Hi Thomas,
> 
> Thanks for the slides, I checked the latest code and multicast/broadcast
> counters mostly look standardized. But mlx5 adds the "port" word to all
> its xstats names. I suppose you may be the right person to ask - is there
> any specific reason for this?

No specific reason, I consider it as a bug.
Please could you open a bugzilla ticket?


> On Wed, Oct 14, 2020 at 12:45 PM Thomas Monjalon <thomas@monjalon.net>
> wrote:
> 
> > 14/10/2020 11:35, Igor Ryzhov:
> > > Hi Ferruh,
> > >
> > > As rte_eth_stats is going to be changed, is it possible to add new
> > counters
> > > there?
> > > For example, in/out multicast/broadcast packets.
> >
> > Good question.
> > In order to avoid redundancy, I prefer focusing on xstats
> > and plan deprecation of rte_eth_stats.
> >
> > The basic stats you are asking for should have standardized names
> > and reserved ids in xstats API.
> > Please see these slides:
> > https://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
  
Igor Ryzhov Oct. 15, 2020, 5:39 p.m. UTC | #6
Done.

https://bugs.dpdk.org/show_bug.cgi?id=558

On Thu, Oct 15, 2020 at 11:03 AM Thomas Monjalon <thomas@monjalon.net>
wrote:

> 15/10/2020 09:55, Igor Ryzhov:
> > Hi Thomas,
> >
> > Thanks for the slides, I checked the latest code and multicast/broadcast
> > counters mostly look standardized. But mlx5 adds the "port" word to all
> > its xstats names. I suppose you may be the right person to ask - is there
> > any specific reason for this?
>
> No specific reason, I consider it as a bug.
> Please could you open a bugzilla ticket?
>
>
> > On Wed, Oct 14, 2020 at 12:45 PM Thomas Monjalon <thomas@monjalon.net>
> > wrote:
> >
> > > 14/10/2020 11:35, Igor Ryzhov:
> > > > Hi Ferruh,
> > > >
> > > > As rte_eth_stats is going to be changed, is it possible to add new
> > > counters
> > > > there?
> > > > For example, in/out multicast/broadcast packets.
> > >
> > > Good question.
> > > In order to avoid redundancy, I prefer focusing on xstats
> > > and plan deprecation of rte_eth_stats.
> > >
> > > The basic stats you are asking for should have standardized names
> > > and reserved ids in xstats API.
> > > Please see these slides:
> > >
> https://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
>
>
>
>
  
Thomas Monjalon Oct. 15, 2020, 5:45 p.m. UTC | #7
15/10/2020 19:39, Igor Ryzhov:
> Done.
> 
> https://bugs.dpdk.org/show_bug.cgi?id=558

Thanks


> On Thu, Oct 15, 2020 at 11:03 AM Thomas Monjalon <thomas@monjalon.net>
> wrote:
> 
> > 15/10/2020 09:55, Igor Ryzhov:
> > > Hi Thomas,
> > >
> > > Thanks for the slides, I checked the latest code and multicast/broadcast
> > > counters mostly look standardized. But mlx5 adds the "port" word to all
> > > its xstats names. I suppose you may be the right person to ask - is there
> > > any specific reason for this?
> >
> > No specific reason, I consider it as a bug.
> > Please could you open a bugzilla ticket?
> >
> >
> > > On Wed, Oct 14, 2020 at 12:45 PM Thomas Monjalon <thomas@monjalon.net>
> > > wrote:
> > >
> > > > 14/10/2020 11:35, Igor Ryzhov:
> > > > > Hi Ferruh,
> > > > >
> > > > > As rte_eth_stats is going to be changed, is it possible to add new
> > > > counters
> > > > > there?
> > > > > For example, in/out multicast/broadcast packets.
> > > >
> > > > Good question.
> > > > In order to avoid redundancy, I prefer focusing on xstats
> > > > and plan deprecation of rte_eth_stats.
> > > >
> > > > The basic stats you are asking for should have standardized names
> > > > and reserved ids in xstats API.
> > > > Please see these slides:
> > > >
> > https://fast.dpdk.org/events/slides/DPDK-2019-09-Ethernet_Statistics.pdf
> >
> >
> >
> >
>
  
Thomas Monjalon Oct. 16, 2020, 2:34 p.m. UTC | #8
14/10/2020 10:43, Kinsella, Ray:
> 
> On 14/10/2020 03:26, Ferruh Yigit wrote:
> > Queue stats will be removed from basic stats to xstats.
> > 
> > It will be PMDs responsibility to fill queue stats based on number of
> > queues they have.
> > 
> > Until all PMDs implement the xstats, a temporary
> > 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> > to the xstats should clear this flag to bypass the ethdev layer autofill
> > for queue stats.
> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> >  config/rte_config.h                  | 2 +-
> >  doc/guides/rel_notes/deprecation.rst | 7 +++++++
> >  lib/librte_ethdev/rte_ethdev.h       | 3 +++
> >  3 files changed, 11 insertions(+), 1 deletion(-)
> > 
> Acked-by: Ray Kinsella <mdr@ashroe.eu>

Acked-by: Thomas Monjalon <thomas@monjalon.net>

We need more acks for the deprecation notice to be accepted.
  
Bruce Richardson Oct. 16, 2020, 2:36 p.m. UTC | #9
On Fri, Oct 16, 2020 at 04:34:46PM +0200, Thomas Monjalon wrote:
> 14/10/2020 10:43, Kinsella, Ray:
> > 
> > On 14/10/2020 03:26, Ferruh Yigit wrote:
> > > Queue stats will be removed from basic stats to xstats.
> > > 
> > > It will be PMDs responsibility to fill queue stats based on number of
> > > queues they have.
> > > 
> > > Until all PMDs implement the xstats, a temporary
> > > 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> > > to the xstats should clear this flag to bypass the ethdev layer autofill
> > > for queue stats.
> > > 
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > >  config/rte_config.h                  | 2 +-
> > >  doc/guides/rel_notes/deprecation.rst | 7 +++++++
> > >  lib/librte_ethdev/rte_ethdev.h       | 3 +++
> > >  3 files changed, 11 insertions(+), 1 deletion(-)
> > > 
> > Acked-by: Ray Kinsella <mdr@ashroe.eu>
> 
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Jerin Jacob Oct. 16, 2020, 2:37 p.m. UTC | #10
On Fri, Oct 16, 2020 at 8:05 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 14/10/2020 10:43, Kinsella, Ray:
> >
> > On 14/10/2020 03:26, Ferruh Yigit wrote:
> > > Queue stats will be removed from basic stats to xstats.
> > >
> > > It will be PMDs responsibility to fill queue stats based on number of
> > > queues they have.
> > >
> > > Until all PMDs implement the xstats, a temporary
> > > 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> > > to the xstats should clear this flag to bypass the ethdev layer autofill
> > > for queue stats.
> > >
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > >  config/rte_config.h                  | 2 +-
> > >  doc/guides/rel_notes/deprecation.rst | 7 +++++++
> > >  lib/librte_ethdev/rte_ethdev.h       | 3 +++
> > >  3 files changed, 11 insertions(+), 1 deletion(-)
> > >
> > Acked-by: Ray Kinsella <mdr@ashroe.eu>
>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
>
> We need more acks for the deprecation notice to be accepted.

Acked-by: Jerin Jacob <jerinj@marvell.com>



>
>
  
Stephen Hemminger Oct. 16, 2020, 3:07 p.m. UTC | #11
On Fri, 16 Oct 2020 16:34:46 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 14/10/2020 10:43, Kinsella, Ray:
> > 
> > On 14/10/2020 03:26, Ferruh Yigit wrote:  
> > > Queue stats will be removed from basic stats to xstats.
> > > 
> > > It will be PMDs responsibility to fill queue stats based on number of
> > > queues they have.
> > > 
> > > Until all PMDs implement the xstats, a temporary
> > > 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> > > to the xstats should clear this flag to bypass the ethdev layer autofill
> > > for queue stats.
> > > 
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > >  config/rte_config.h                  | 2 +-
> > >  doc/guides/rel_notes/deprecation.rst | 7 +++++++
> > >  lib/librte_ethdev/rte_ethdev.h       | 3 +++
> > >  3 files changed, 11 insertions(+), 1 deletion(-)
> > >   
> > Acked-by: Ray Kinsella <mdr@ashroe.eu>  
> 
> Acked-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Ajit Khaparde Oct. 16, 2020, 5:48 p.m. UTC | #12
On Fri, Oct 16, 2020 at 8:07 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Fri, 16 Oct 2020 16:34:46 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 14/10/2020 10:43, Kinsella, Ray:
> > >
> > > On 14/10/2020 03:26, Ferruh Yigit wrote:
> > > > Queue stats will be removed from basic stats to xstats.
> > > >
> > > > It will be PMDs responsibility to fill queue stats based on number of
> > > > queues they have.
> > > >
> > > > Until all PMDs implement the xstats, a temporary
> > > > 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
> > > > to the xstats should clear this flag to bypass the ethdev layer autofill
> > > > for queue stats.
> > > >
> > > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > > ---
> > > >  config/rte_config.h                  | 2 +-
> > > >  doc/guides/rel_notes/deprecation.rst | 7 +++++++
> > > >  lib/librte_ethdev/rte_ethdev.h       | 3 +++
> > > >  3 files changed, 11 insertions(+), 1 deletion(-)
> > > >
> > > Acked-by: Ray Kinsella <mdr@ashroe.eu>
> >
> > Acked-by: Thomas Monjalon <thomas@monjalon.net>
>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  

Patch

diff --git a/config/rte_config.h b/config/rte_config.h
index 03d90d78bc..9ef3b75940 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -55,7 +55,7 @@ 
 
 /* ether defines */
 #define RTE_MAX_QUEUES_PER_PORT 1024
-#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
+#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16 /* max 256 */
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 
 /* cryptodev defines */
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 584e720879..9143cfc529 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -164,6 +164,13 @@  Deprecation Notices
   following the IPv6 header, as proposed in RFC
   https://mails.dpdk.org/archives/dev/2020-August/177257.html.
 
+* ethdev: Queue specific stats fields will be removed from ``struct rte_eth_stats``.
+  Mentioned fields are: ``q_ipackets``, ``q_opackets``, ``q_ibytes``, ``q_obytes``,
+  ``q_errors``.
+  Instead queue stats will be received via xstats API. Current method support
+  will be limited to maximum 256 queues.
+  Also compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` will be removed.
+
 * security: The API ``rte_security_session_create`` takes only single mempool
   for session and session private data. So the application need to create
   mempool for twice the number of sessions needed and will also lead to
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index bb7a2b4289..a2e811ca48 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -253,6 +253,7 @@  struct rte_eth_stats {
 	uint64_t ierrors;   /**< Total number of erroneous received packets. */
 	uint64_t oerrors;   /**< Total number of failed transmitted packets. */
 	uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */
+	/* Queue stats are limited to max 256 queues */
 	uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
 	/**< Total number of queue RX packets. */
 	uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
@@ -2704,6 +2705,7 @@  int rte_eth_xstats_reset(uint16_t port_id);
  *   The per-queue packet statistics functionality number that the transmit
  *   queue is to be assigned.
  *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
+ *   Max RTE_ETHDEV_QUEUE_STAT_CNTRS being 256.
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
@@ -2724,6 +2726,7 @@  int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
  *   The per-queue packet statistics functionality number that the receive
  *   queue is to be assigned.
  *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
+ *   Max RTE_ETHDEV_QUEUE_STAT_CNTRS being 256.
  * @return
  *   Zero if successful. Non-zero otherwise.
  */