aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/en_port.c
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2015-06-23 10:14:13 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-24 03:42:33 -0400
commitf1a3badb0b429cae75b4785c97af35cb89bf1457 (patch)
treee914c115b738cfb3e8a28e2c7e817a6b451911e0 /drivers/net/ethernet/mellanox/mlx4/en_port.c
parent9a2abf5a80ebc8b77d6ad4b68ab597ad43d07399 (diff)
net/mlx4_en: Use HW counters for rx/tx bytes/packets in PF device
Under SRIOV, the port rx/tx bytes/packets statistics should by read from the HW instead of using the PF netdevice SW accounting. This is needed in order to get the full port statistics and not just the PF own ones Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_port.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_port.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.c b/drivers/net/ethernet/mellanox/mlx4/en_port.c
index 73f6277d9ac1..ee99e67187f5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c
@@ -203,6 +203,20 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
203 priv->port_stats.tso_packets += ring->tso_packets; 203 priv->port_stats.tso_packets += ring->tso_packets;
204 priv->port_stats.xmit_more += ring->xmit_more; 204 priv->port_stats.xmit_more += ring->xmit_more;
205 } 205 }
206 if (mlx4_is_master(mdev->dev)) {
207 stats->rx_packets = en_stats_adder(&mlx4_en_stats->RTOT_prio_0,
208 &mlx4_en_stats->RTOT_prio_1,
209 NUM_PRIORITIES);
210 stats->tx_packets = en_stats_adder(&mlx4_en_stats->TTOT_prio_0,
211 &mlx4_en_stats->TTOT_prio_1,
212 NUM_PRIORITIES);
213 stats->rx_bytes = en_stats_adder(&mlx4_en_stats->ROCT_prio_0,
214 &mlx4_en_stats->ROCT_prio_1,
215 NUM_PRIORITIES);
216 stats->tx_bytes = en_stats_adder(&mlx4_en_stats->TOCT_prio_0,
217 &mlx4_en_stats->TOCT_prio_1,
218 NUM_PRIORITIES);
219 }
206 220
207 /* net device stats */ 221 /* net device stats */
208 stats->rx_errors = be64_to_cpu(mlx4_en_stats->PCS) + 222 stats->rx_errors = be64_to_cpu(mlx4_en_stats->PCS) +