Commit e5b6ab02 authored by Tal Gilboa's avatar Tal Gilboa Committed by Saeed Mahameed

linux/dim: Rename net_dim_sample() to net_dim_update_sample()

In order to avoid confusion between the function and the similarly
named struct.
In preparation for removing the 'net' prefix from dim members.
Signed-off-by: default avatarTal Gilboa <talgi@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent c002bd52
...@@ -1019,8 +1019,8 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget) ...@@ -1019,8 +1019,8 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget)
} }
if (priv->dim.use_dim) { if (priv->dim.use_dim) {
net_dim_sample(priv->dim.event_ctr, priv->dim.packets, net_dim_update_sample(priv->dim.event_ctr, priv->dim.packets,
priv->dim.bytes, &dim_sample); priv->dim.bytes, &dim_sample);
net_dim(&priv->dim.dim, dim_sample); net_dim(&priv->dim.dim, dim_sample);
} }
......
...@@ -2130,10 +2130,10 @@ static int bnxt_poll(struct napi_struct *napi, int budget) ...@@ -2130,10 +2130,10 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
if (bp->flags & BNXT_FLAG_DIM) { if (bp->flags & BNXT_FLAG_DIM) {
struct net_dim_sample dim_sample; struct net_dim_sample dim_sample;
net_dim_sample(cpr->event_ctr, net_dim_update_sample(cpr->event_ctr,
cpr->rx_packets, cpr->rx_packets,
cpr->rx_bytes, cpr->rx_bytes,
&dim_sample); &dim_sample);
net_dim(&cpr->dim, dim_sample); net_dim(&cpr->dim, dim_sample);
} }
return work_done; return work_done;
......
...@@ -1909,8 +1909,8 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget) ...@@ -1909,8 +1909,8 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
} }
if (ring->dim.use_dim) { if (ring->dim.use_dim) {
net_dim_sample(ring->dim.event_ctr, ring->dim.packets, net_dim_update_sample(ring->dim.event_ctr, ring->dim.packets,
ring->dim.bytes, &dim_sample); ring->dim.bytes, &dim_sample);
net_dim(&ring->dim.dim, dim_sample); net_dim(&ring->dim.dim, dim_sample);
} }
......
...@@ -53,8 +53,7 @@ static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq) ...@@ -53,8 +53,7 @@ static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state))) if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
return; return;
net_dim_sample(sq->cq.event_ctr, stats->packets, stats->bytes, net_dim_update_sample(sq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
&dim_sample);
net_dim(&sq->dim, dim_sample); net_dim(&sq->dim, dim_sample);
} }
...@@ -66,8 +65,7 @@ static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq) ...@@ -66,8 +65,7 @@ static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state))) if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
return; return;
net_dim_sample(rq->cq.event_ctr, stats->packets, stats->bytes, net_dim_update_sample(rq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
&dim_sample);
net_dim(&rq->dim, dim_sample); net_dim(&rq->dim, dim_sample);
} }
......
...@@ -123,7 +123,8 @@ static inline void dim_park_tired(struct net_dim *dim) ...@@ -123,7 +123,8 @@ static inline void dim_park_tired(struct net_dim *dim)
} }
static inline void static inline void
net_dim_sample(u16 event_ctr, u64 packets, u64 bytes, struct net_dim_sample *s) net_dim_update_sample(u16 event_ctr, u64 packets, u64 bytes,
struct net_dim_sample *s)
{ {
s->time = ktime_get(); s->time = ktime_get();
s->pkt_ctr = packets; s->pkt_ctr = packets;
......
...@@ -261,8 +261,8 @@ static inline void net_dim(struct net_dim *dim, ...@@ -261,8 +261,8 @@ static inline void net_dim(struct net_dim *dim,
} }
/* fall through */ /* fall through */
case DIM_START_MEASURE: case DIM_START_MEASURE:
net_dim_sample(end_sample.event_ctr, end_sample.pkt_ctr, end_sample.byte_ctr, net_dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr,
&dim->start_sample); end_sample.byte_ctr, &dim->start_sample);
dim->state = DIM_MEASURE_IN_PROGRESS; dim->state = DIM_MEASURE_IN_PROGRESS;
break; break;
case DIM_APPLY_NEW_PROFILE: case DIM_APPLY_NEW_PROFILE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment