DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, shreyansh.jain@nxp.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/5] net/dpaa: fix the xstats implementation
Date: Wed, 25 Apr 2018 18:27:01 +0530	[thread overview]
Message-ID: <1524661022-21484-4-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1524661022-21484-1-git-send-email-hemant.agrawal@nxp.com>

Some of the applications are expecting that if n is 0, it shall
return the supported number of stats. e.g. VPP

Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index b2740b4..136f716 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -354,12 +354,12 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings);
 	uint64_t values[sizeof(struct dpaa_if_stats) / 8];
 
-	if (xstats == NULL)
-		return 0;
-
 	if (n < num)
 		return num;
 
+	if (xstats == NULL)
+		return 0;
+
 	fman_if_stats_get_all(dpaa_intf->fif, values,
 			      sizeof(struct dpaa_if_stats) / 8);
 
-- 
2.7.4

  parent reply	other threads:[~2018-04-25 12:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
2018-04-25 12:56 ` [dpdk-dev] [PATCH 2/5] bus/fslmc: " Hemant Agrawal
2018-04-25 12:57 ` [dpdk-dev] [PATCH 3/5] bus/fslmc: minor improvements in debug logging Hemant Agrawal
2018-04-25 12:57 ` Hemant Agrawal [this message]
2018-04-25 12:57 ` [dpdk-dev] [PATCH 5/5] bus/dpaa: improve the dynamic logging Hemant Agrawal
2018-05-09  5:41 ` [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Shreyansh Jain
2018-05-13 22:38   ` Thomas Monjalon

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=1524661022-21484-4-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@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).