[dpdk-dev,08/14] mlx5: fix possible crash when clearing device statistics

Message ID 1448289889-9590-9-git-send-email-adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Adrien Mazarguil Nov. 23, 2015, 2:44 p.m. UTC
  A typo causes TX stats indices to be retrieved from RX queues.

Fixes: 87011737b715 ("mlx5: add software counters")

Reported-by: Nicolas Harnois <nicolas.harnois@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index a51e945..6d1a600 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -133,7 +133,7 @@  mlx5_stats_reset(struct rte_eth_dev *dev)
 	for (i = 0; (i != priv->txqs_n); ++i) {
 		if ((*priv->txqs)[i] == NULL)
 			continue;
-		idx = (*priv->rxqs)[i]->stats.idx;
+		idx = (*priv->txqs)[i]->stats.idx;
 		(*priv->txqs)[i]->stats =
 			(struct mlx5_txq_stats){ .idx = idx };
 	}