net/mlx5e: Avoid reset netdev stats on configuration changes
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_txrx.c
index 5d6f9ce2bf80ff65e3ff697341fc0e388046e10b..1b17f682693b90b09300fcf92fd7ed74aa29fef5 100644 (file)
@@ -46,24 +46,26 @@ static inline bool mlx5e_channel_no_affinity_change(struct mlx5e_channel *c)
 
 static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
 {
+       struct mlx5e_sq_stats *stats = sq->stats;
        struct net_dim_sample dim_sample;
 
        if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
                return;
 
-       net_dim_sample(sq->cq.event_ctr, sq->stats.packets, sq->stats.bytes,
+       net_dim_sample(sq->cq.event_ctr, stats->packets, stats->bytes,
                       &dim_sample);
        net_dim(&sq->dim, dim_sample);
 }
 
 static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
 {
+       struct mlx5e_rq_stats *stats = rq->stats;
        struct net_dim_sample dim_sample;
 
        if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
                return;
 
-       net_dim_sample(rq->cq.event_ctr, rq->stats.packets, rq->stats.bytes,
+       net_dim_sample(rq->cq.event_ctr, stats->packets, stats->bytes,
                       &dim_sample);
        net_dim(&rq->dim, dim_sample);
 }