DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "David Harton (dharton)" <dharton@cisco.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: Thu, 28 Jan 2016 09:37:18 +0000	[thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA612864882@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <d517cdf33b6d4144ba5bf1d7a83dde85@XCH-RCD-016.cisco.com>

> From: David Harton
> 
> enum rte_eth_stat_e {
>     /* accurate desc #1 */
>     RTE_ETH_STAT_1,
>     /* accurate desc #2 */
>     RTE_ETH_STAT_2,
> ...
> }
> struct rte_eth_id_stat {
>     rte_eth_stat_e id;
>     uin64_t value;
> }
> 
> int rte_eth_id_stats_num(uint8_t port_id, uint32_t *num_stats);
> /* returns < 0 on error or the number of stats that could have been read (i.e. if userd
> */
> int rte_eth_id_stats_get(uint8_t port_id, uint32_t num_stats, rte_eth_id_stat *id_stats);
> const char* rte_eth_id_stat_str(rte_eth_stat_e id);
> 
> This allows a driver to return whatever stats that it supports in a consistent manner and
> also in a performance friendly way.  In fact, the driver side would be identical to what
> they have today but instead of having arrays with "string stat name" they will have the
> rte_eth_stat_e.


Thanks for the code and explanation.


> > RE: Thomas asking about performance numbers:
> > I can scrape together some raw tsc data on Monday and post to list, and we
> > can discuss it more then.
> 
> I can do the same if desired.  But, just to make sure we are discussing the same issue:
> 
> 1) call rte_eth_xtats_get()
> This will result in many string copies and depending on the driver *many* copies I don't
> want or care about.
> 2) "tokenize"/parse/hash the string returned to identify what the stat actually is
> I'm guessing you are stating that this step could be mitigated at startup.  But, again, I
> don't think the API provides a guarantee which usually leads to bugs over time.
> 3) Copy the value of the stat into the driver agnostic container the application uses
> 4) Repeat steps 1-3 for every interface being serviced every 5 or 10 secs
> 
> Contrast that to my suggestion which has no string copies and a compile time mapping
> between "stat_id" and "app stat" can be created for step 2.  I think the performance
> differences are obvious even without generating cycle times.


Indeed using integers will reduce overhead compared to
strings, and the helper function to convert the integer
to string provides the same possibilities as the current
API (in a different way).

I haven't collected performance data yet, apologies for
the delay. Perhaps continuing this conversation after the
V1 patch deadline at the end of the week is a good idea?
I'll have more time to dedicate to thinking about this.


-Harry

  reply	other threads:[~2016-01-28  9:37 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)
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 [this message]
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=E923DB57A917B54B9182A2E928D00FA612864882@IRSMSX102.ger.corp.intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=dev@dpdk.org \
    --cc=dharton@cisco.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).