[dpdk-dev] [PATCH v2 2/3] ethdev: fix xstats get by id APIS

Thomas Monjalon thomas at monjalon.net
Tue Oct 24 01:33:13 CEST 2017


24/10/2017 01:15, Ferruh Yigit:
> xstats _by_id() APIs are broken because ids known by user sent directly
> to the PMDs.
> 
> ethdev xstat get by id APIs:
> rte_eth_xstats_get_names_by_id() and rte_eth_xstats_get_by_id()
> work on ids calculated as "basic stats + extended stats"
> 
> When an application asking for id less than "basic stats count", it is
> indeed asking basic stats not extended stats.
> 
> The dev_ops PMDs implements work on extended stats ids.
> 
> This patch adds a check if all requested stats are xstats and if so
> converts ids to xstats ids before passing them to PMDs.
> 
> This conversion wasn't required before commit 8c49d5f1c219, because
> _by_id dev_ops were always used to get whole stats via NULL ids.
> 
> Fixes: 8c49d5f1c219 ("ethdev: rework xstats retrieve by id")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> Reviewed-by: Ivan Malov <ivan.malov at oktetlabs.ru>
> Tested-by: Ivan Malov <ivan.malov at oktetlabs.ru>
> ---
> Cc: Ivan Malov <Ivan.Malov at oktetlabs.ru>
> Cc: Harry Van Haaren <harry.van.haaren at intel.com>
> Cc: Lee Daly <lee.daly at intel.com>
> 
> v2:
> * variable renamed, all_ids_from_pmd -> no_basic_stat_requested
> * xstats id conversion commented.

A lot more clear :)
Thanks

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



More information about the dev mailing list