mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Move rate estimate from 64-bits to 32-bits, saving some bytes.
This commit is contained in:
@@ -149,7 +149,7 @@ pub struct FlowbeeData {
|
||||
/// Packets transmitted
|
||||
pub packets_sent: [u64; 2],
|
||||
/// Rate estimate
|
||||
pub rate_estimate_bps: [u64; 2],
|
||||
pub rate_estimate_bps: [u32; 2],
|
||||
/// TCP Retransmission count (also counts duplicates)
|
||||
pub tcp_retransmits: [u32; 2],
|
||||
/// Most recent RTT
|
||||
|
||||
@@ -50,7 +50,7 @@ struct flow_data_t {
|
||||
// Bytes at the next rate estimate
|
||||
__u64 next_count_bytes[2];
|
||||
// Rate estimate
|
||||
__u64 rate_estimate_bps[2];
|
||||
__u32 rate_estimate_bps[2];
|
||||
// Sequence number of the last packet
|
||||
__u32 last_sequence[2];
|
||||
// Acknowledgement number of the last packet
|
||||
@@ -292,8 +292,8 @@ static __always_inline void process_tcp(
|
||||
|
||||
if (
|
||||
tsecr == data->tsval[other_rate_index] &&
|
||||
(data->rate_estimate_bps[rate_index] > HALF_MBPS_IN_BYTES_PER_SECOND ||
|
||||
data->rate_estimate_bps[other_rate_index] > HALF_MBPS_IN_BYTES_PER_SECOND )
|
||||
(data->rate_estimate_bps[rate_index] > 0 ||
|
||||
data->rate_estimate_bps[other_rate_index] > 0 )
|
||||
) {
|
||||
__u64 elapsed = dissector->now - data->ts_change_time[other_rate_index];
|
||||
if (elapsed < TWO_SECONDS_IN_NANOS) {
|
||||
|
||||
@@ -42,7 +42,7 @@ pub struct FlowbeeData {
|
||||
/// Bytes at the next rate estimate
|
||||
pub next_count_bytes: [u64; 2],
|
||||
/// Rate estimate
|
||||
pub rate_estimate_bps: [u64; 2],
|
||||
pub rate_estimate_bps: [u32; 2],
|
||||
/// Sequence number of the last packet
|
||||
pub last_sequence: [u32; 2],
|
||||
/// Acknowledgement number of the last packet
|
||||
|
||||
Reference in New Issue
Block a user