patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 4/5] net/dpaa: fix the xstats implementation
       [not found] <1524661022-21484-1-git-send-email-hemant.agrawal@nxp.com>
@ 2018-04-25 12:57 ` Hemant Agrawal
  0 siblings, 0 replies; only message in thread
From: Hemant Agrawal @ 2018-04-25 12:57 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain, stable

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-25 12:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1524661022-21484-1-git-send-email-hemant.agrawal@nxp.com>
2018-04-25 12:57 ` [dpdk-stable] [PATCH 4/5] net/dpaa: fix the xstats implementation Hemant Agrawal

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).