Sorry if it wasn't clear, in mlx5 there is limited number of counters, so if 
there are X counters and 2X queues, there won't be enough counters to get 
statistics for all queues at the same time.
In this case we thought the best approach would be to allow the user to choose 
which queues they want statistics from.
If the counters are exceeded, the user would have the option to disable the 
counter, thereby freeing up the resource for reuse elsewhere.

> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Sunday, 22 December 2024 18:46
> To: Shani Peretz <shper...@nvidia.com>
> Cc: dev@dpdk.org; Aman Singh <aman.deep.si...@intel.com>; Dariusz
> Sosnowski <dsosnow...@nvidia.com>; Slava Ovsiienko
> <viachesl...@nvidia.com>; Bing Zhao <bi...@nvidia.com>; Ori Kam
> <or...@nvidia.com>; Suanming Mou <suanmi...@nvidia.com>; Matan
> Azrad <ma...@nvidia.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <tho...@monjalon.net>; Ferruh Yigit <ferruh.yi...@amd.com>; Andrew
> Rybchenko <andrew.rybche...@oktetlabs.ru>; Anatoly Burakov
> <anatoly.bura...@intel.com>
> Subject: Re: [RFC PATCH] ethdev: add new API for enable/disable xstat
> counters by ID
> 
> External email: Use caution opening links or attachments
> 
> 
> On Sun, 22 Dec 2024 17:38:19 +0200
> Shani Peretz <shper...@nvidia.com> wrote:
> 
> > This change introduces a new API to dynamically enable or disable
> > xstat counters by their IDs. Some counters may require hardware
> > resources that are potentially limited, so providing the ability to
> > toggle them on or off makes sense.
> > In addition, adding an API to query the current state (enabled,
> > disabled, or not supported) of an xstat counter is added.
> > New APIs:
> >       - rte_eth_xstats_enable_counter(struct rte_eth_dev *dev, uint64_t id);
> >       - rte_eth_xstats_disable_counter(struct rte_eth_dev *dev, uint64_t 
> > id);
> >       - rte_eth_xstats_query_state(struct rte_eth_dev *dev, uint64_t
> > id);
> >
> > Added the following testpmd subcommands:
> >  toggle the counter on and off
> >      > port (port_id) enable|disable <counter_name> query the state of
> > counters:
> >      > set xstats-show-state on|off
> >
> > Note that by default, generic stats (like those provided by
> > eth_basic_stats_get()) will be considered unsupported and will not be
> > toggleable.
> > Also all xstats will be considered unsupported for dynamic
> > enable/disable, and each PMD will be able to override this in its
> implementation.
> >
> > Specifically in mlx5 PMD, expose a new xstat to track packet drops of
> > hairpin Rx queue:
> >    - Hairpin_out_of_buffer - Port-level counter -
> >               counts drops from all the hairpin queues
> >    - Hairpin_out_of_buffer_rxq* - Queue-level counter -
> >               counts drops of a specific queue Both the port-level and
> > per-queue counters can be enabled, disabled, and queried.
> >
> > Signed-off-by: Shani Peretz <shper...@nvidia.com>
> 
> Why what is the value of having a counter disabled?
> Is this something that speeds up the PMD?
> 
> IMHO DPDK changes should be driven off user need, not the HW capabilities.

Reply via email to