From: Hemant Agrawal Date: Wed, 25 Apr 2018 12:57:01 +0000 (+0530) Subject: net/dpaa: fix xstats implementation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=339c1025a87c3eeb38a9ec5bf0679caf21bec7e6;p=dpdk.git net/dpaa: fix xstats implementation 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 Acked-by: Shreyansh Jain --- diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 6bf8c15903..f7e234d583 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -379,12 +379,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);