[v3,10/10] net/atlantic: fix xstats to return correct number of items

Message ID 7ff8c44079f5bd9adc1370988c97a8aabb48e94f.1552402263.git.igor.russkikh@aquantia.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
  • net/atlantic: bugfixes and code cleanup
Related show


Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Igor Russkikh March 12, 2019, 3:25 p.m.
Max number of xstats items was returned instead of actual number
of filled in records.

Cc: stable@dpdk.org
Fixes: fbe059e87209 ("net/atlantic: implement device statistics")
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
 drivers/net/atlantic/atl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index b05dc545d0b1..5c62d137b255 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -758,7 +758,7 @@  atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
 		snprintf(xstats_names[i].name, RTE_ETH_XSTATS_NAME_SIZE, "%s",
-	return size;
+	return i;
 static int
@@ -778,7 +778,7 @@  atl_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats,
-	return n;
+	return i;
 static int