DPDK patches and discussions
 help / color / mirror / Atom feed
From: "David Harton (dharton)" <dharton@cisco.com>
To: "Van Haaren, Harry" <harry.van.haaren@intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Future Direction for rte_eth_stats_get()
Date: Fri, 22 Jan 2016 16:04:13 +0000	[thread overview]
Message-ID: <78791945dbf442b291adb72df8ec09f3@XCH-RCD-016.cisco.com> (raw)
In-Reply-To: <E923DB57A917B54B9182A2E928D00FA6128617BE@IRSMSX102.ger.corp.intel.com>

> > xstats are driver agnostic and have a well-defined naming scheme.
> 
> Indeed, described here:
> http://dpdk.org/doc/guides/prog_guide/poll_mode_drv.html#extended-
> statistics-api

Thanks for sharing.  I do think what is in the link is well thought out but it also may not match how the application would choose to represent that stat (capitalization, abbreviation, etc).

> From: David Harton:
> > For example, what if there was a kind of "stats registry" composed of
> > ID and name.  It would work similar to xtats except instead of
> > advertising strings only the "get" API would return ID/count pairs.
> > If the application wishes to use the DPDK provided string they can
> > call another API to get the stat string via the ID.  These IDs would
> > be well-defined clearly explaining what the count represent.  This way
> > the strings for counts will be uniform across drivers and also make it
> clear to the users what the counts truly represent and the application
> could obtain stats from any driver in a driver agnostic manner.
> 
> What you (David Harton) describe about a well-defined name, and clearly
> explaining the value it is representing is what the goal was for xstats: a
> human readable string, which can be easily parsed and a value retrieved.
> 
> The "rules" of encoding a statistic as an xstats string are pretty simple,
> and if any PMD breaks the rules, it should be considered broken and fixed.

I understand it may be broken, but that doesn't help finding them and ensuring they aren't broken to begin with.  What regression/automation is in place to ensure drivers aren't broken?

> 
> Consistency is key, in this case consistency in the PMD xstats
> implementations to make it useful for clients of the API.
> 
> The big advantage xstats has over adding items to rte_eth_stats is that it
> won't break ABI.

100% agree.  I can see the intent.

> 
> Do you see a fundamental problem with parsing the strings to retrieve
> values?

I think parsing strings is expensive CPU wise and again subject to error as devices are added.  That's why I was wondering if a binary id could be generated instead.  The binary id could also be used to look up the string name if the application wants it.  The API would be very similar to the current xstats API except it would pass id/value pairs instead of string/value pairs.  This avoids string comparisons to figure out while still allowing flexibility between drivers.  It would also 100% guarantee that any strings returned by "const char* rte_eth_xstats_str_get(uint32_t stat_id)" are consistent across devices.

I also think there is less chance for error if drivers assign their stats to ID versus constructing a string.  I haven't checked my application, but I wonder if the binary size would actually be smaller if all the stats strings were centrally located versus distributed across binaries (highly dependent on the linker and optimization level).

> 
> If you like I could code up a minimal sample-app that only pulls
> statistics, and you can show "interest" in various statistics for printing
> / monitoring?

Appreciate the offer.  I actually understand what's is available.  And, BTW, I apologize for being late to the game (looks like this was discussed last summer) but I'm just now getting looped in and following the mailer but I'm just wondering if something that is performance friendly for the user/application and flexible for the drivers is possible.

Thanks,
Dave

> 
> 
> Regards, -Harry

  parent reply	other threads:[~2016-01-22 16:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 17:18 David Harton (dharton)
2016-01-22 11:07 ` Tahhan, Maryam
2016-01-22 13:40   ` David Harton (dharton)
2016-01-22 14:18     ` Tahhan, Maryam
2016-01-22 14:40       ` David Harton (dharton)
2016-01-22 14:48         ` Thomas Monjalon
2016-01-22 15:22           ` Van Haaren, Harry
2016-01-22 15:53             ` Jay Rolette
2016-01-22 16:04             ` David Harton (dharton) [this message]
2016-01-22 16:37               ` Thomas Monjalon
2016-01-22 16:41               ` Van Haaren, Harry
2016-01-22 19:26                 ` David Harton (dharton)
2016-01-28  9:37                   ` Van Haaren, Harry
2016-02-01 16:47                   ` David Harton (dharton)
2016-02-01 21:23                     ` Matthew Hall
2016-02-02 11:40                     ` Van Haaren, Harry
2016-02-05 21:16                       ` David Harton (dharton)
2016-02-19  8:59                         ` Tahhan, Maryam
2016-01-22 14:44       ` Thomas Monjalon
2016-01-22 14:48         ` Tahhan, Maryam
2016-01-22 15:02         ` Igor Ryzhov
2016-01-22 20:48           ` Matthew Hall
2016-02-02 12:44             ` Tahhan, Maryam
2016-02-02 13:47               ` Kyle Larose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78791945dbf442b291adb72df8ec09f3@XCH-RCD-016.cisco.com \
    --to=dharton@cisco.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).