diff options
author | Andy Gospodarek <gospo@broadcom.com> | 2018-01-10 00:06:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-10 23:27:45 +0300 |
commit | 8115b750dbcbeb3aa412f18b7a8b0aee4d35b079 (patch) | |
tree | b4fa5607f5f7e5655abca1b0f0fd6524e20a1c4d /include/linux/net_dim.h | |
parent | 4c4dbb4a7363ce56c77cf8eb2090f67c1b0aa2cc (diff) | |
download | linux-8115b750dbcbeb3aa412f18b7a8b0aee4d35b079.tar.xz |
net/dim: use struct net_dim_sample as arg to net_dim
Simplify the arguments net_dim() by formatting them into a struct
net_dim_sample before calling the function.
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Suggested-by: Tal Gilboa <talgi@mellanox.com>
Acked-by: Tal Gilboa <talgi@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/net_dim.h')
-rw-r--r-- | include/linux/net_dim.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/linux/net_dim.h b/include/linux/net_dim.h index 741510fb74cb..1c7e45016120 100644 --- a/include/linux/net_dim.h +++ b/include/linux/net_dim.h @@ -342,21 +342,18 @@ static inline void net_dim_calc_stats(struct net_dim_sample *start, } static inline void net_dim(struct net_dim *dim, - u16 event_ctr, - u64 packets, - u64 bytes) + struct net_dim_sample end_sample) { - struct net_dim_sample end_sample; struct net_dim_stats curr_stats; u16 nevents; switch (dim->state) { case NET_DIM_MEASURE_IN_PROGRESS: - nevents = BIT_GAP(BITS_PER_TYPE(u16), event_ctr, + nevents = BIT_GAP(BITS_PER_TYPE(u16), + end_sample.event_ctr, dim->start_sample.event_ctr); if (nevents < NET_DIM_NEVENTS) break; - net_dim_sample(event_ctr, packets, bytes, &end_sample); net_dim_calc_stats(&dim->start_sample, &end_sample, &curr_stats); if (net_dim_decision(&curr_stats, dim)) { @@ -366,7 +363,6 @@ static inline void net_dim(struct net_dim *dim, } /* fall through */ case NET_DIM_START_MEASURE: - net_dim_sample(event_ctr, packets, bytes, &dim->start_sample); dim->state = NET_DIM_MEASURE_IN_PROGRESS; break; case NET_DIM_APPLY_NEW_PROFILE: |