Skip to content

Commit

Permalink
net/ena: fix getting xstats global stats offset
Browse files Browse the repository at this point in the history
[ upstream commit 493107f ]

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: 7830e90 ("net/ena: expose extended stats")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
  • Loading branch information
Gerwand authored and bluca committed Nov 9, 2020
1 parent 87cb957 commit a900941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ena/ena_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,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;
Expand Down

0 comments on commit a900941

Please sign in to comment.