DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Lee Daly <lee.daly@intel.com>, thomas@monjalon.net
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix xstats retrieve by id API
Date: Wed, 11 Oct 2017 19:33:02 +0100	[thread overview]
Message-ID: <4936d1b1-c689-7247-4672-621da7075b3a@intel.com> (raw)
In-Reply-To: <20171011072208.137243-1-lee.daly@intel.com>

On 10/11/2017 8:22 AM, Lee Daly wrote:
> From: Lee <lee.daly@intel.com>
> 
> Fix xstats functions, rte_eth_xstats_get_names_by_id()
> and rte_eth_xstats_get_by_id(), in current implementation
> ethdev level reads all xstat values and filters out
> the ones requested by the application. This behavior doesn't
> benefit from PMD ops and doesn't provide the benefit the
> API was created in the first place for. APIs are also unnecessarily
> complicated. Both APIs have different returns for the same params.
> 
> In this fix, instead of reading all the stats and finding the
> requested value, drivers can provide ops to get selected xstats.
> API no longer crashes with certain params,
> 
> rte_eth_get_by_id returned seg fault with
> "ids = NULL && values != NULL && n<max”
> rte_eth_get_names_by_id returned seg fault with
> "ids = NULL && values != NULL && n=0”
> These now return max number of stats available, matching the other API.
> 
> rte_eth_get_by_id returned seg fault with
> "ids != NULL && values = NULL && n<max”
> This now returns -22,(EINVAL).
> 
> Standardized variable/parameter names between the 2 APIs.
> 
> Overall code complexity reduced.

Fixes: 79c913a42f0e ("ethdev: retrieve xstats by ID")
Cc: kubax.kozak@intel.com

> 
> Signed-off-by: Lee <lee.daly@intel.com>

Please use full name:
Signed-off-by: Lee Daly <lee.daly@intel.com>

<...>

> @@ -2472,7 +2472,7 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id,
>   *   - A negative value on error (invalid port id).
>   */
>  int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,
> -			     uint64_t *values, unsigned int n);
> +			     uint64_t *values, unsigned int size);

Function doxygen comment also should be updated to reflect this,
otherwise giving a warning.

>  
>  /**
>   * Gets the ID of a statistic from its name.
> 

Except above issues:
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Can you please send a new version addressing above issues, feel free to
keep review tag.

Thanks,
ferruh

  reply	other threads:[~2017-10-11 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  7:22 Lee Daly
2017-10-11 18:33 ` Ferruh Yigit [this message]
2017-10-12 13:31 ` [dpdk-dev] [PATCH v2] " Lee Daly
2017-10-12 19:42   ` Ferruh Yigit

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=4936d1b1-c689-7247-4672-621da7075b3a@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=lee.daly@intel.com \
    --cc=thomas@monjalon.net \
    /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).