In dpaa_xstats_get_by_id(), fman_if_bmi_stats_get_all() was called
with 'values' (the output array) instead of 'values_copy' (the
scratch buffer). This caused the BMI stats to overwrite already
computed xstat values and then the subsequent loop would copy
garbage from values_copy into the output.

Pass 'values_copy' as intended so that BMI stats are fetched into
the scratch buffer and then correctly indexed into 'values'.

Fixes: d2536b006d ("bus/dpaa: add port buffer manager stats")
Cc: [email protected]

Signed-off-by: Hemant Agrawal <[email protected]>
---
 drivers/net/dpaa/dpaa_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index eaeb4221c9..a221406cbf 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -928,7 +928,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const 
uint64_t *ids,
                        values[i] =
                                values_copy[dpaa_xstats_strings[i].offset / 8];
 
-               fman_if_bmi_stats_get_all(dev->process_private, values);
+               fman_if_bmi_stats_get_all(dev->process_private, values_copy);
                for (j = 0; i < stat_cnt; i++, j++)
                        values[i] = values_copy[j];
 
-- 
2.43.0

Reply via email to