summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_stats.c
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2015-11-23 15:44:43 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-11-24 17:49:27 +0100
commit7efc807d48a6cacb0ab432daabdc2f20449523c3 (patch)
tree7e02ec2d802668637966b4ccb6667ea0f9749e54 /drivers/net/mlx5/mlx5_stats.c
parent0f9db82d9f54b6210bbf9d7fad1c144f00e76ccb (diff)
downloaddpdk-7efc807d48a6cacb0ab432daabdc2f20449523c3.zip
dpdk-7efc807d48a6cacb0ab432daabdc2f20449523c3.tar.gz
dpdk-7efc807d48a6cacb0ab432daabdc2f20449523c3.tar.xz
mlx5: fix possible crash when clearing device statistics
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>
Diffstat (limited to 'drivers/net/mlx5/mlx5_stats.c')
-rw-r--r--drivers/net/mlx5/mlx5_stats.c2
1 files changed, 1 insertions, 1 deletions
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 };
}