From 4e1ede9395122a2d90951bfd0b9abfb1e32922ca Mon Sep 17 00:00:00 2001
From: Michal Krawczyk <mk@semihalf.com>
Date: Thu, 16 Jul 2020 10:55:26 +0000
Subject: [PATCH 128/166] net/ena: fix getting xstats global stats offset

There was a bug in a code, which was reading stat_offset value from the
ena_stats_rx_strings array instead of ena_stats_global_strings.

It wasn't causing real problems just because ena_stats_rx_strings was
not smaller than ena_stats_global_strings and both arrays hold the same
offsets.

Fixes: 7830e905b7c9 ("net/ena: expose extended stats")
Cc: stable@dpdk.org

Change-Id: Idb021ab236b4840617a10ede7b51d5124340ab37
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
---
 drivers/net/ena/ena_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 8d5391c7af..2181ad8bf2 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2771,7 +2771,7 @@ static int ena_xstats_get(struct rte_eth_dev *dev,
 		return 0;
 
 	for (stat = 0; stat < ENA_STATS_ARRAY_GLOBAL; stat++, count++) {
-		stat_offset = ena_stats_rx_strings[stat].stat_offset;
+		stat_offset = ena_stats_global_strings[stat].stat_offset;
 		stats_begin = &adapter->dev_stats;
 
 		xstats[count].id = count;
-- 
2.25.1

