From ffe3a1337c1380a5b79651b34037c6c9f66b9ea1 Mon Sep 17 00:00:00 2001 From: Stephan Brunner Date: Tue, 1 Nov 2022 09:51:14 +0100 Subject: Use 64-bit interface statistics rather than doing custom 32-bit overflow handling. When a link has a relatively high throughput, the 32-bit packet and byte counters could overflow multiple times between accounting runs. To accommodate this limitation, directly use 64-bit interface statistics. This also gets rid of the internal giga-word counters. --- accel-pppd/include/ap_session.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'accel-pppd/include') diff --git a/accel-pppd/include/ap_session.h b/accel-pppd/include/ap_session.h index 12277185..629b58ee 100644 --- a/accel-pppd/include/ap_session.h +++ b/accel-pppd/include/ap_session.h @@ -110,14 +110,12 @@ struct ap_session int session_timeout; struct triton_timer_t timer; - uint32_t acct_rx_bytes; - uint32_t acct_tx_bytes; - uint32_t acct_input_gigawords; - uint32_t acct_output_gigawords; - uint32_t acct_rx_packets_i; - uint32_t acct_tx_packets_i; - uint32_t acct_rx_bytes_i; - uint32_t acct_tx_bytes_i; + uint64_t acct_rx_bytes; + uint64_t acct_tx_bytes; + uint64_t acct_rx_packets_i; + uint64_t acct_tx_packets_i; + uint64_t acct_rx_bytes_i; + uint64_t acct_tx_bytes_i; int acct_start; }; @@ -156,7 +154,7 @@ int ap_session_rename(struct ap_session *ses, const char *ifname, int len); int ap_session_vrf(struct ap_session *ses, const char *vrf_name, int len); #endif -int ap_session_read_stats(struct ap_session *ses, struct rtnl_link_stats *stats); +int ap_session_read_stats(struct ap_session *ses, struct rtnl_link_stats64 *stats); int ap_shutdown_soft(void (*cb)(void), int term); -- cgit v1.2.3