struct mutex state_lock; /* Protects Interface state */
struct mlx5e_rq drop_rq;
- rwlock_t stats_lock; /* Protects channels SW stats updates */
- bool channels_active;
struct mlx5e_channels channels;
u32 tisn[MLX5E_MAX_NUM_TC];
struct mlx5e_rqt indir_rqt;
mlx5e_build_tx2sq_maps(priv);
mlx5e_activate_channels(&priv->channels);
- write_lock(&priv->stats_lock);
- priv->channels_active = true;
- write_unlock(&priv->stats_lock);
netif_tx_start_all_queues(priv->netdev);
if (MLX5_VPORT_MANAGER(priv->mdev))
*/
netif_tx_stop_all_queues(priv->netdev);
netif_tx_disable(priv->netdev);
- write_lock(&priv->stats_lock);
- priv->channels_active = false;
- write_unlock(&priv->stats_lock);
mlx5e_deactivate_channels(&priv->channels);
}
profile->max_nch(mdev), netdev->mtu);
mutex_init(&priv->state_lock);
- rwlock_init(&priv->stats_lock);
INIT_WORK(&priv->update_carrier_work, mlx5e_update_carrier_work);
INIT_WORK(&priv->set_rx_mode_work, mlx5e_set_rx_mode_work);
struct mlx5e_sq_stats *sq_stats;
int i, j;
- read_lock(&priv->stats_lock);
- if (!priv->channels_active)
- goto out;
-
memset(s, 0, sizeof(*s));
for (i = 0; i < priv->channels.num; i++) {
struct mlx5e_channel *c = priv->channels.c[i];
s->tx_bytes += sq_stats->bytes;
}
}
-out:
- read_unlock(&priv->stats_lock);
}
static void mlx5e_rep_get_ethtool_stats(struct net_device *dev,
int i;
memset(s, 0, sizeof(*s));
- read_lock(&priv->stats_lock);
- if (!priv->channels_active)
- goto out;
for (i = 0; i < priv->profile->max_nch(priv->mdev); i++) {
struct mlx5e_channel_stats *channel_stats =
}
memcpy(&priv->stats.sw, s, sizeof(*s));
-out:
- read_unlock(&priv->stats_lock);
}
static const struct counter_desc q_stats_desc[] = {