|
@@ -1296,15 +1296,16 @@ static void mlx4_en_tx_timeout(struct net_device *dev)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-static struct net_device_stats *mlx4_en_get_stats(struct net_device *dev)
|
|
|
|
|
|
|
+static struct rtnl_link_stats64 *
|
|
|
|
|
+mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
|
|
{
|
|
{
|
|
|
struct mlx4_en_priv *priv = netdev_priv(dev);
|
|
struct mlx4_en_priv *priv = netdev_priv(dev);
|
|
|
|
|
|
|
|
spin_lock_bh(&priv->stats_lock);
|
|
spin_lock_bh(&priv->stats_lock);
|
|
|
- memcpy(&priv->ret_stats, &priv->stats, sizeof(priv->stats));
|
|
|
|
|
|
|
+ netdev_stats_to_stats64(stats, &dev->stats);
|
|
|
spin_unlock_bh(&priv->stats_lock);
|
|
spin_unlock_bh(&priv->stats_lock);
|
|
|
|
|
|
|
|
- return &priv->ret_stats;
|
|
|
|
|
|
|
+ return stats;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv)
|
|
static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv)
|
|
@@ -1876,7 +1877,6 @@ static void mlx4_en_clear_stats(struct net_device *dev)
|
|
|
if (mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 1))
|
|
if (mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 1))
|
|
|
en_dbg(HW, priv, "Failed dumping statistics\n");
|
|
en_dbg(HW, priv, "Failed dumping statistics\n");
|
|
|
|
|
|
|
|
- memset(&priv->stats, 0, sizeof(priv->stats));
|
|
|
|
|
memset(&priv->pstats, 0, sizeof(priv->pstats));
|
|
memset(&priv->pstats, 0, sizeof(priv->pstats));
|
|
|
memset(&priv->pkstats, 0, sizeof(priv->pkstats));
|
|
memset(&priv->pkstats, 0, sizeof(priv->pkstats));
|
|
|
memset(&priv->port_stats, 0, sizeof(priv->port_stats));
|
|
memset(&priv->port_stats, 0, sizeof(priv->port_stats));
|
|
@@ -1892,6 +1892,11 @@ static void mlx4_en_clear_stats(struct net_device *dev)
|
|
|
priv->tx_ring[i]->bytes = 0;
|
|
priv->tx_ring[i]->bytes = 0;
|
|
|
priv->tx_ring[i]->packets = 0;
|
|
priv->tx_ring[i]->packets = 0;
|
|
|
priv->tx_ring[i]->tx_csum = 0;
|
|
priv->tx_ring[i]->tx_csum = 0;
|
|
|
|
|
+ priv->tx_ring[i]->tx_dropped = 0;
|
|
|
|
|
+ priv->tx_ring[i]->queue_stopped = 0;
|
|
|
|
|
+ priv->tx_ring[i]->wake_queue = 0;
|
|
|
|
|
+ priv->tx_ring[i]->tso_packets = 0;
|
|
|
|
|
+ priv->tx_ring[i]->xmit_more = 0;
|
|
|
}
|
|
}
|
|
|
for (i = 0; i < priv->rx_ring_num; i++) {
|
|
for (i = 0; i < priv->rx_ring_num; i++) {
|
|
|
priv->rx_ring[i]->bytes = 0;
|
|
priv->rx_ring[i]->bytes = 0;
|
|
@@ -2482,7 +2487,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
|
|
|
.ndo_stop = mlx4_en_close,
|
|
.ndo_stop = mlx4_en_close,
|
|
|
.ndo_start_xmit = mlx4_en_xmit,
|
|
.ndo_start_xmit = mlx4_en_xmit,
|
|
|
.ndo_select_queue = mlx4_en_select_queue,
|
|
.ndo_select_queue = mlx4_en_select_queue,
|
|
|
- .ndo_get_stats = mlx4_en_get_stats,
|
|
|
|
|
|
|
+ .ndo_get_stats64 = mlx4_en_get_stats64,
|
|
|
.ndo_set_rx_mode = mlx4_en_set_rx_mode,
|
|
.ndo_set_rx_mode = mlx4_en_set_rx_mode,
|
|
|
.ndo_set_mac_address = mlx4_en_set_mac,
|
|
.ndo_set_mac_address = mlx4_en_set_mac,
|
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
@@ -2514,7 +2519,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
|
|
|
.ndo_stop = mlx4_en_close,
|
|
.ndo_stop = mlx4_en_close,
|
|
|
.ndo_start_xmit = mlx4_en_xmit,
|
|
.ndo_start_xmit = mlx4_en_xmit,
|
|
|
.ndo_select_queue = mlx4_en_select_queue,
|
|
.ndo_select_queue = mlx4_en_select_queue,
|
|
|
- .ndo_get_stats = mlx4_en_get_stats,
|
|
|
|
|
|
|
+ .ndo_get_stats64 = mlx4_en_get_stats64,
|
|
|
.ndo_set_rx_mode = mlx4_en_set_rx_mode,
|
|
.ndo_set_rx_mode = mlx4_en_set_rx_mode,
|
|
|
.ndo_set_mac_address = mlx4_en_set_mac,
|
|
.ndo_set_mac_address = mlx4_en_set_mac,
|
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
.ndo_validate_addr = eth_validate_addr,
|