net/mlx5: add C++ include guard to public header
[dpdk.git] / drivers / net / mlx5 / mlx5_stats.c
index 82d4d4a..7327759 100644 (file)
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
 
@@ -16,7 +16,8 @@
 
 #include "mlx5_defs.h"
 #include "mlx5.h"
-#include "mlx5_rxtx.h"
+#include "mlx5_rx.h"
+#include "mlx5_tx.h"
 #include "mlx5_malloc.h"
 
 /**
@@ -106,7 +107,7 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
        memset(&tmp, 0, sizeof(tmp));
        /* Add software counters. */
        for (i = 0; (i != priv->rxqs_n); ++i) {
-               struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
+               struct mlx5_rxq_data *rxq = mlx5_rxq_data_get(dev, i);
 
                if (rxq == NULL)
                        continue;
@@ -180,10 +181,11 @@ mlx5_stats_reset(struct rte_eth_dev *dev)
        unsigned int i;
 
        for (i = 0; (i != priv->rxqs_n); ++i) {
-               if ((*priv->rxqs)[i] == NULL)
+               struct mlx5_rxq_data *rxq_data = mlx5_rxq_data_get(dev, i);
+
+               if (rxq_data == NULL)
                        continue;
-               memset(&(*priv->rxqs)[i]->stats, 0,
-                      sizeof(struct mlx5_rxq_stats));
+               memset(&rxq_data->stats, 0, sizeof(struct mlx5_rxq_stats));
        }
        for (i = 0; (i != priv->txqs_n); ++i) {
                if ((*priv->txqs)[i] == NULL)