[dpdk-dev] [RFC PATCH v1 0/3] Remove string operations from xstats

David Harton (dharton) dharton at cisco.com
Fri Apr 29 14:52:33 CEST 2016


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Remy Horton
> Sent: Friday, April 15, 2016 10:44 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [RFC PATCH v1 0/3] Remove string operations from
> xstats
> 
> The current extended ethernet statistics fetching involve doing several
> string operations, which causes performance issues if there are lots of
> statistics and/or network interfaces. This RFC patchset changes the API
> for xstats to use integer identifiers instead of strings and implements
> this new API for the ixgbe driver. Others drivers to follow.
> 
> --
> 
> Since this will involve API & ABI breakage as previously advertised,
> there are several design assumptions that need consideration:
> 
> *) id-name & id-value pairs for both lookup and query
> Permits out-of-order and non-contigious returning of names/ids/values,
> even though expected implmentations would in practice return items in
> sorted order by id. Is this sufficent/desirable future proofing? Idea
> is to allow possibility of drivers returning partial statistics.

I think the key is that the order of the stats must always be honored 
and if that's the case then an id isn't necessary.  However, if others 
want an id certainly doesn't hurt.

I don't see drivers autonomously providing a subset of stats and users 
can filter out stats they don't want to their presentation layers.

> 
> *) Bulk name-id mapping lookup only
> At the moment individual lookup is not supported, as this would impose
> extra overheads on drivers. The assumption is that any end user would
> fetch all this data once on startup and then cache the mappings.

Agreed.  Similarly there is no need to return a partial list of stats 
as the presentation layers can filter.

> 
> *) Replacement or additional API
> This patch replaces the current xstats API, but there is no inherant
> reason beyond maintainability why this funtionality could not be in
> addition rather than a replacement. What is consensus on this?

I suggest 3 new functions are added:
- get number of xstats
- get xstats names
- get xstats values

This facilitates:
- parallel development within the release without breaking current usage
- possibility of removing rte_eth_xstats_get() in following release

Thanks for moving this forward,
Dave

> 
> Comments welcome.
> 
> Remy Horton (3):
>   rte: change xstats to use integer keys
>   drivers/net/ixgbe: change xstats to use integer keys
>   examples/ethtool: add xstats display command
> 
>  drivers/net/ixgbe/ixgbe_ethdev.c      | 87
> +++++++++++++++++++++++++++++++----
>  examples/ethtool/ethtool-app/ethapp.c | 57 +++++++++++++++++++++++
>  lib/librte_ether/rte_ethdev.c         | 87
> +++++++++++++++++++++++++++++++----
>  lib/librte_ether/rte_ethdev.h         | 38 +++++++++++++++
>  4 files changed, 252 insertions(+), 17 deletions(-)
> 
> --
> 2.5.5


More information about the dev mailing list