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()
218 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_stats_proc_show() local
223 atomic_long_read(&pkg_stats->tx_frames)); in can_stats_proc_show()
225 atomic_long_read(&pkg_stats->rx_frames)); in can_stats_proc_show()
227 atomic_long_read(&pkg_stats->matches)); in can_stats_proc_show()
233 pkg_stats->total_rx_match_ratio); in can_stats_proc_show()
236 pkg_stats->total_tx_rate); in can_stats_proc_show()
238 pkg_stats->total_rx_rate); in can_stats_proc_show()
243 pkg_stats->current_rx_match_ratio); in can_stats_proc_show()
246 pkg_stats->current_tx_rate); in can_stats_proc_show()
248 pkg_stats->current_rx_rate); in can_stats_proc_show()
253 pkg_stats->max_rx_match_ratio); in can_stats_proc_show()
256 pkg_stats->max_tx_rate); in can_stats_proc_show()
258 pkg_stats->max_rx_rate); in can_stats_proc_show()
284 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_reset_stats_proc_show() local
292 if (pkg_stats->jiffies_init != jiffies) in can_reset_stats_proc_show()