net/mlx5e: Fix global PFC counters replication
authorGal Pressman <[email protected]>
Wed, 7 Sep 2016 16:08:00 +0000 (19:08 +0300)
committerDavid S. Miller <[email protected]>
Thu, 8 Sep 2016 23:15:29 +0000 (16:15 -0700)
Currently when reading global PFC statistics we left the counter
iterator out of the equation and we ended up reading the same counter
over and over again.

Instead of reading the counter at index 0 on every iteration we now read
the counter at index (i).

Fixes: e989d5a532ce ('net/mlx5e: Expose flow control counters to ethtool')
Signed-off-by: Gal Pressman <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

index 98e1a4a442689c1233a22a754dec22ec6f6ee25e..7a346bb2ed0064c4db51404842a514af513a7f5b 100644 (file)
@@ -331,7 +331,7 @@ static void mlx5e_get_ethtool_stats(struct net_device *dev,
        if (mlx5e_query_global_pause_combined(priv)) {
                for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) {
                        data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[0],
-                                                         pport_per_prio_pfc_stats_desc, 0);
+                                                         pport_per_prio_pfc_stats_desc, i);
                }
        }