patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	David Marchand <david.marchand@6wind.com>,
	dev@dpdk.org
Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com,
	bernard.iremonger@intel.com,  stable@dpdk.org,
	Harry Van Haaren <harry.van.haaren@intel.com>
Subject: Re: [dpdk-stable] [PATCH] app/testpmd: add sanity checks when retrieving xstats
Date: Thu, 14 Jun 2018 20:33:44 +0100	[thread overview]
Message-ID: <9e34833d-cb17-170a-f6ba-15210db0c7eb@intel.com> (raw)
In-Reply-To: <1c72a061-db06-8fac-b1fa-3d0695686de9@intel.com>


On 14/06/2018 11:55, Ferruh Yigit wrote:
> On 6/14/2018 7:39 AM, Remy Horton wrote:
>>
>> On 13/06/2018 16:39, Ferruh Yigit wrote:
>>> On 6/7/2018 9:15 AM, David Marchand wrote:
>>>> Testpmd should not expect the xstats names and values arrays to be
>>>> aligned: neither the arrays sizes, nor the order in which the values are.
[..]

> APIs exist for getting subset of values (.._by_id) but they both assume
> requested ids are array index.
> As you said this works fine because of xstats[idx].id==idx

Changing that coincidence into an assumption looks like a bug to me.


> struct rte_eth_xstat_name { char name[]; }
> struct rte_eth_xstat { uint64_t id; uint64_t value; }
>
> These two structs are for basic key-value match.
> But one has the "id" field, but other doesn't. If we use "id" as match, this
> will be the index of xstat_name[]. This is extra complexity, and xstats is
> already unnecessarily complex.
>
> I am for documenting that "xstat_name" and "xstat" are aligned, both in size and
> order, and array indexes are ids, clearly in API doc and continue with existing
> implementation. What do you think?

As long as none of the PMD vendors intend to take advantage of 
xstats[idx].id!=idx (e.g. to allow omitted values) then I'm OK with it.


..Remy

      reply	other threads:[~2018-06-14 19:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07  8:15 David Marchand
2018-06-12  7:09 ` David Marchand
2018-06-12  8:38 ` Remy Horton
2018-06-13 15:39 ` Ferruh Yigit
2018-06-14  6:39   ` Remy Horton
2018-06-14 10:55     ` Ferruh Yigit
2018-06-14 19:33       ` Remy Horton [this message]

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=9e34833d-cb17-170a-f6ba-15210db0c7eb@intel.com \
    --to=remy.horton@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.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).