Lines Matching refs:pkg_stats
81 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_init_stats() local
88 memset(pkg_stats, 0, sizeof(struct can_pkg_stats)); in can_init_stats()
89 pkg_stats->jiffies_init = jiffies; in can_init_stats()
118 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_stat_update() local
121 long rx_frames = atomic_long_read(&pkg_stats->rx_frames); in can_stat_update()
122 long tx_frames = atomic_long_read(&pkg_stats->tx_frames); in can_stat_update()
123 long matches = atomic_long_read(&pkg_stats->matches); in can_stat_update()
124 long rx_frames_delta = atomic_long_read(&pkg_stats->rx_frames_delta); in can_stat_update()
125 long tx_frames_delta = atomic_long_read(&pkg_stats->tx_frames_delta); in can_stat_update()
126 long matches_delta = atomic_long_read(&pkg_stats->matches_delta); in can_stat_update()
133 if (j < pkg_stats->jiffies_init) in can_stat_update()
150 pkg_stats->total_rx_match_ratio = (matches * 100) / rx_frames; in can_stat_update()
152 pkg_stats->total_tx_rate = calc_rate(pkg_stats->jiffies_init, j, in can_stat_update()
154 pkg_stats->total_rx_rate = calc_rate(pkg_stats->jiffies_init, j, in can_stat_update()
159 pkg_stats->current_rx_match_ratio = in can_stat_update()
162 pkg_stats->current_tx_rate = calc_rate(0, HZ, tx_frames_delta); in can_stat_update()
163 pkg_stats->current_rx_rate = calc_rate(0, HZ, rx_frames_delta); in can_stat_update()
166 if (pkg_stats->max_tx_rate < pkg_stats->current_tx_rate) in can_stat_update()
167 pkg_stats->max_tx_rate = pkg_stats->current_tx_rate; in can_stat_update()
169 if (pkg_stats->max_rx_rate < pkg_stats->current_rx_rate) in can_stat_update()
170 pkg_stats->max_rx_rate = pkg_stats->current_rx_rate; in can_stat_update()
172 if (pkg_stats->max_rx_match_ratio < pkg_stats->current_rx_match_ratio) in can_stat_update()
173 pkg_stats->max_rx_match_ratio = pkg_stats->current_rx_match_ratio; in can_stat_update()
176 atomic_long_set(&pkg_stats->tx_frames_delta, 0); in can_stat_update()
177 atomic_long_set(&pkg_stats->rx_frames_delta, 0); in can_stat_update()
178 atomic_long_set(&pkg_stats->matches_delta, 0); in can_stat_update()
219 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_stats_proc_show() local
224 atomic_long_read(&pkg_stats->tx_frames)); in can_stats_proc_show()
226 atomic_long_read(&pkg_stats->rx_frames)); in can_stats_proc_show()
228 atomic_long_read(&pkg_stats->matches)); in can_stats_proc_show()
234 pkg_stats->total_rx_match_ratio); in can_stats_proc_show()
237 pkg_stats->total_tx_rate); in can_stats_proc_show()
239 pkg_stats->total_rx_rate); in can_stats_proc_show()
244 pkg_stats->current_rx_match_ratio); in can_stats_proc_show()
247 pkg_stats->current_tx_rate); in can_stats_proc_show()
249 pkg_stats->current_rx_rate); in can_stats_proc_show()
254 pkg_stats->max_rx_match_ratio); in can_stats_proc_show()
257 pkg_stats->max_tx_rate); in can_stats_proc_show()
259 pkg_stats->max_rx_rate); in can_stats_proc_show()
285 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_reset_stats_proc_show() local
293 if (pkg_stats->jiffies_init != jiffies) in can_reset_stats_proc_show()