DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/8] net/bnxt: add support for xstats get by id
Date: Tue, 29 Aug 2017 17:10:04 +0100	[thread overview]
Message-ID: <ee4038f8-d709-5cdb-caee-9d2fd112721f@intel.com> (raw)
In-Reply-To: <20170824162956.62761-3-ajit.khaparde@broadcom.com>

On 8/24/2017 5:29 PM, Ajit Khaparde wrote:
> This patch adds support for xstats_get_by_id/xstats_get_names_by_id.
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

<...>

> +
> +int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
> +		uint64_t *values, unsigned int limit)
> +{
> +	/* Account for the Tx drop pkts aka the Anti spoof counter */
> +	const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +
> +				RTE_DIM(bnxt_tx_stats_strings) + 1;
> +	struct rte_eth_xstat xstats[stat_cnt];
> +	uint16_t i;
> +
> +	bnxt_dev_xstats_get_op(dev, xstats, limit);

I guess intention here is to read all xstats, so "stat_cnt" should be
used instead of "limit"

> +
> +	for (i = 0; i < limit; i++) {
> +		if (ids[i] >= stat_cnt) {

Current xstats_get_by_id API, which is an interesting one, can call this
with ids==NULL.

> +			RTE_LOG(ERR, PMD, "id value isn't valid");
> +			return -1;
> +		}
> +		values[i] = xstats[ids[i]].value;
> +	}
> +	return limit;

if limit is zero, API expects to get number of available xstats, so
can't just return limit here.

> +}

<...>

  reply	other threads:[~2017-08-29 16:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 16:29 [dpdk-dev] [PATCH 0/8] bnxt patchset Ajit Khaparde
2017-08-24 16:29 ` [dpdk-dev] [PATCH 1/8] net/bnxt: add support for xstats get by id Ajit Khaparde
2017-08-29 16:10   ` Ferruh Yigit [this message]
2017-08-24 16:29 ` [dpdk-dev] [PATCH 2/8] net/bnxt: add support for rx_queue_count Ajit Khaparde
2017-08-29 16:10   ` Ferruh Yigit
2017-08-24 16:29 ` [dpdk-dev] [PATCH 3/8] net/bnxt: add support for rx_descriptor_status Ajit Khaparde
2017-08-29 16:11   ` Ferruh Yigit
2017-08-24 16:29 ` [dpdk-dev] [PATCH 4/8] net/bnxt: add support for rx_descriptor_done Ajit Khaparde
2017-08-29 16:11   ` Ferruh Yigit
2017-08-24 16:29 ` [dpdk-dev] [PATCH 5/8] net/bnxt: add support for tx_descriptor_status Ajit Khaparde
2017-08-29 16:12   ` Ferruh Yigit
2017-08-24 16:29 ` [dpdk-dev] [PATCH 6/8] net/bnxt: add new HWRM structures Ajit Khaparde
2017-08-24 16:29 ` [dpdk-dev] [PATCH 7/8] net/bnxt: fix HWRM_*() macros and locking Ajit Khaparde
2017-08-29 16:12   ` Ferruh Yigit
2017-08-24 16:29 ` [dpdk-dev] [PATCH 8/8] net/bnxt: add support for flow filter ops Ajit Khaparde
2017-08-29 16:16   ` 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=ee4038f8-d709-5cdb-caee-9d2fd112721f@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=ajit.khaparde@broadcom.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 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).