All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger B Melton <rmelton@cisco.com>
To: dev@dpdk.org
Subject: Re: [PATCH v6 0/5] Extended xstats API in ethdev library to allow grouping of stats
Date: Tue, 25 Apr 2017 18:49:34 -0400	[thread overview]
Message-ID: <b44f7841-eb9a-8012-5e1f-4cb704efbb60@cisco.com> (raw)
In-Reply-To: <B27915DBBA3421428155699D51E4CFE2332C0C57@IRSMSX103.ger.corp.intel.com>

On 4/24/17 11:49 AM, Mcnamara, John wrote:
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
>> Sent: Monday, April 24, 2017 1:41 PM
>> To: Kozak, KubaX <kubax.kozak@intel.com>
>> Cc: dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>; Van Haaren, Harry
>> <harry.van.haaren@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>;
>> Piasecki, JacekX <jacekx.piasecki@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v6 0/5] Extended xstats API in ethdev
>> library to allow grouping of stats
>>
>> 24/04/2017 14:32, Olivier Matz:
>>> Hi,
>>>
>> ...
>>> So, I wonder if it wouldn't be more simple to keep the old API intact
>>> (it would avoid unannounced breakage). The new feature can be
>>> implemented in an additional API:
>>>
>>>   rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids,
>>>         uint64_t *values, unsigned int size)
>>> rte_eth_xstats_get_names_by_id(uint8_t port_id, const uint64_t *ids,
>>>         struct rte_eth_xstat_name *xstats_names, unsigned int size)
>>>
>>> Or:
>>>
>>>   rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids,
>>>         struct rte_eth_xstat *values, unsigned int size)
>>> rte_eth_xstats_get_names_by_id(uint8_t port_id, const uint64_t *ids,
>>>         struct rte_eth_xstat_name *xstats_names, unsigned int size)
>>>
>>>   (which would allow to deprecate the old API, but I'm not sure
>>>    we need to)
>>>
>>>
>>> Can we fix that for 17.05?
>> ...
>>
>> Back to the issues, please try to fix it quickly or we should revert it
>> for 17.05-rc3.
> Hi,
>
> We'll submit a patch to change the APIs for rte_eth_xstats_get() and
> rte_eth_xstats_get_names() back to their previous signature, without
> symbol versions, and add the APIs suggested by Olivier.
>
> We'll work on that as soon as possible.
>
> John
> .
>
Hi folks,

I adapted our application to the API changes presented in 17.05-rc2 and 
encountered problem that I don't think was pointed out in Olivier's list 
of issues.

In our application we call rte_eth_stats_get() with NULL pointers to 
determine the number of xstats.  We use the returned count  to 
pre-allocate buffers for the name strings and xstats values and then 
invoke rte_eth_xstats_get_names() and rte_eth_xstats_get() with pointers 
to appropriately sized buffers and the number of entries available in 
those buffers.

Things appeared to work fine until I requested stats for a net_ixgbe_vf 
port. In that case the initial call to rte_eth_xstats_get() did not 
account for the xstats extensions from the ixgbevf PMD.  Long story 
short, my buffers were undersized and bad things happened.

John,

If you intend to restore the previous API signature but retain the -rc2 
internal implementation, may I suggest that both APIs use the same 
internal function to determine stats count.  Otherwise the potential for 
disagreement between the APIs will remain.

Also while on this topic, IMO the above demonstrates that we really need 
an API to query the xstats count rather than relying on 
rte_eth_xstats_get() or rte_eth_xstats_get_names() with 0'd out arguments.

Regards,
Roger

  reply	other threads:[~2017-04-25 22:49 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 21:50 [PATCH v2 0/5] Extended xstats API in ethdev library to allow grouping of stats Michal Jastrzebski
2017-03-30 21:50 ` [PATCH v2 1/5] add new xstats API retrieving by id Michal Jastrzebski
2017-04-03 12:09   ` [PATCH v3 0/3] Extended xstats API in ethdev library to allow grouping of stats Jacek Piasecki
2017-04-03 12:09     ` [PATCH v3 1/3] add new xstats API retrieving by id Jacek Piasecki
2017-04-03 12:37       ` Van Haaren, Harry
2017-04-04 15:03       ` Thomas Monjalon
2017-04-04 15:45         ` Van Haaren, Harry
2017-04-04 16:18           ` Thomas Monjalon
2017-04-10 17:59       ` [PATCH v4 0/3] Extended xstats API in ethdev library to allow grouping of stats Jacek Piasecki
2017-04-10 17:59         ` [PATCH v4 1/3] ethdev: new xstats API add retrieving by ID Jacek Piasecki
2017-04-11 16:37           ` [PATCH v5 0/3] Extended xstats API in ethdev library to allow grouping of stats Michal Jastrzebski
2017-04-11 16:37             ` [PATCH v5 1/3] ethdev: new xstats API add retrieving by ID Michal Jastrzebski
2017-04-12  8:56               ` Van Haaren, Harry
2017-04-12 17:10               ` Thomas Monjalon
2017-04-13 10:52               ` Mcnamara, John
2017-04-13 14:59               ` [PATCH v6 0/5] Extended xstats API in ethdev library to allow grouping of stats Kuba Kozak
2017-04-13 14:59                 ` [PATCH v6 1/5] ethdev: new xstats API add retrieving by ID Kuba Kozak
2017-04-13 16:23                   ` Van Haaren, Harry
2017-04-13 14:59                 ` [PATCH v6 2/5] ethdev: added new function for xstats ID Kuba Kozak
2017-04-13 16:23                   ` Van Haaren, Harry
2017-04-13 14:59                 ` [PATCH v6 3/5] proc-info: add support for new xstats API Kuba Kozak
2017-04-13 16:23                   ` Van Haaren, Harry
2017-04-13 14:59                 ` [PATCH v6 4/5] net/e1000: new xstats API add ID support for e1000 Kuba Kozak
2017-04-13 16:23                   ` Van Haaren, Harry
2017-04-13 14:59                 ` [PATCH v6 5/5] net/ixgbe: new xstats API add ID support for ixgbe Kuba Kozak
2017-04-13 16:23                   ` Van Haaren, Harry
2017-04-13 16:21                 ` [PATCH v6 0/5] Extended xstats API in ethdev library to allow grouping of stats Van Haaren, Harry
2017-04-20 20:31                 ` Thomas Monjalon
2017-04-24 12:32                   ` Olivier Matz
2017-04-24 12:41                     ` Thomas Monjalon
2017-04-24 15:49                       ` Mcnamara, John
2017-04-25 22:49                         ` Roger B Melton [this message]
2017-04-11 16:37             ` [PATCH v5 2/3] net/e1000: new xstats API add ID support for e1000 Michal Jastrzebski
2017-04-12  8:56               ` Van Haaren, Harry
2017-04-11 16:37             ` [PATCH v5 3/3] net/ixgbe: new xstats API add ID support for ixgbe Michal Jastrzebski
2017-04-12  8:56               ` Van Haaren, Harry
2017-04-10 17:59         ` [PATCH v4 2/3] net/e1000: new xstats API add ID support for e1000 Jacek Piasecki
2017-04-10 17:59         ` [PATCH v4 3/3] net/ixgbe: new xstats API add ID support for ixgbe Jacek Piasecki
2017-04-03 12:09     ` [PATCH v3 2/3] add new xstats API id support for e1000 Jacek Piasecki
2017-04-03 12:38       ` Van Haaren, Harry
2017-04-03 12:09     ` [PATCH v3 3/3] add new xstats API id support for ixgbe Jacek Piasecki
2017-04-03 12:38       ` Van Haaren, Harry
2017-03-30 21:50 ` [PATCH v2 2/5] add new xstats API id support for e1000 Michal Jastrzebski
2017-03-30 22:06 ` [PATCH v2 3/5] add new xstats API id support for ixgbe Michal Jastrzebski
2017-03-30 22:22 ` [PATCH v2 4/5] add support for new xstats API retrieving by id Michal Jastrzebski
2017-03-30 22:23 ` [PATCH v2 5/5] " Michal Jastrzebski

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=b44f7841-eb9a-8012-5e1f-4cb704efbb60@cisco.com \
    --to=rmelton@cisco.com \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.