Skip to content

Commit

Permalink
linux/dim: Rename net_dim_sample() to net_dim_update_sample()
Browse files Browse the repository at this point in the history
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: Tal Gilboa <talgi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
talgimellanox authored and Saeed Mahameed committed Jun 25, 2019
1 parent c002bd5 commit e5b6ab0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,8 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget)
}

if (priv->dim.use_dim) {
net_dim_sample(priv->dim.event_ctr, priv->dim.packets,
priv->dim.bytes, &dim_sample);
net_dim_update_sample(priv->dim.event_ctr, priv->dim.packets,
priv->dim.bytes, &dim_sample);
net_dim(&priv->dim.dim, dim_sample);
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2130,10 +2130,10 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
if (bp->flags & BNXT_FLAG_DIM) {
struct net_dim_sample dim_sample;

net_dim_sample(cpr->event_ctr,
cpr->rx_packets,
cpr->rx_bytes,
&dim_sample);
net_dim_update_sample(cpr->event_ctr,
cpr->rx_packets,
cpr->rx_bytes,
&dim_sample);
net_dim(&cpr->dim, dim_sample);
}
return work_done;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,8 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
}

if (ring->dim.use_dim) {
net_dim_sample(ring->dim.event_ctr, ring->dim.packets,
ring->dim.bytes, &dim_sample);
net_dim_update_sample(ring->dim.event_ctr, ring->dim.packets,
ring->dim.bytes, &dim_sample);
net_dim(&ring->dim.dim, dim_sample);
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
return;

net_dim_sample(sq->cq.event_ctr, stats->packets, stats->bytes,
&dim_sample);
net_dim_update_sample(sq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
net_dim(&sq->dim, dim_sample);
}

Expand All @@ -66,8 +65,7 @@ static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
return;

net_dim_sample(rq->cq.event_ctr, stats->packets, stats->bytes,
&dim_sample);
net_dim_update_sample(rq->cq.event_ctr, stats->packets, stats->bytes, &dim_sample);
net_dim(&rq->dim, dim_sample);
}

Expand Down
3 changes: 2 additions & 1 deletion include/linux/dim.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ static inline void dim_park_tired(struct net_dim *dim)
}

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->pkt_ctr = packets;
Expand Down
4 changes: 2 additions & 2 deletions include/linux/net_dim.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ static inline void net_dim(struct net_dim *dim,
}
/* fall through */
case DIM_START_MEASURE:
net_dim_sample(end_sample.event_ctr, end_sample.pkt_ctr, end_sample.byte_ctr,
&dim->start_sample);
net_dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr,
end_sample.byte_ctr, &dim->start_sample);
dim->state = DIM_MEASURE_IN_PROGRESS;
break;
case DIM_APPLY_NEW_PROFILE:
Expand Down

0 comments on commit e5b6ab0

Please sign in to comment.