Skip to content

Commit 5d1c7b1

Browse files
committed
revert to only using bytes from InFlight for congestion event
1 parent 1b239ab commit 5d1c7b1

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

quinn-proto/src/congestion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Logic for controlling the rate at which data is sent
22
33
use crate::Instant;
4-
use crate::connection::{InFlight, RttEstimator};
4+
use crate::connection::RttEstimator;
55
use std::any::Any;
66
use std::sync::Arc;
77

@@ -55,7 +55,7 @@ pub trait Controller: Send + Sync {
5555
fn on_end_acks(
5656
&mut self,
5757
now: Instant,
58-
in_flight: &InFlight,
58+
in_flight: u64,
5959
app_limited: bool,
6060
largest_packet_num_acked: Option<u64>,
6161
) {

quinn-proto/src/congestion/bbr3/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ mod max_filter;
33
use crate::RttEstimator;
44
use crate::congestion::bbr3::max_filter::MaxFilter;
55
use crate::congestion::{Controller, ControllerFactory, ControllerMetrics};
6-
use crate::connection::InFlight;
76
use crate::{Duration, Instant};
87
use rand::{Rng, SeedableRng};
98
use rand_pcg::Pcg32;
@@ -1467,11 +1466,11 @@ impl Controller for Bbr3 {
14671466
fn on_end_acks(
14681467
&mut self,
14691468
_now: Instant,
1470-
in_flight: &InFlight,
1469+
in_flight: u64,
14711470
app_limited: bool,
14721471
largest_packet_num_acked: Option<u64>,
14731472
) {
1474-
self.inflight = in_flight.bytes;
1473+
self.inflight = in_flight;
14751474
if let Some(largest_packet_num) = largest_packet_num_acked {
14761475
if app_limited && self.delivered > self.app_limited {
14771476
self.app_limited = largest_packet_num;

quinn-proto/src/connection/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mod packet_crypto;
6161
use packet_crypto::{PrevCrypto, ZeroRttCrypto};
6262

6363
mod paths;
64-
pub use paths::{InFlight, RttEstimator};
64+
pub use paths::RttEstimator;
6565
use paths::{PathData, PathResponses};
6666

6767
pub(crate) mod qlog;
@@ -1512,7 +1512,7 @@ impl Connection {
15121512

15131513
self.path.congestion.on_end_acks(
15141514
now,
1515-
&self.path.in_flight,
1515+
self.path.in_flight.bytes,
15161516
self.app_limited,
15171517
self.spaces[space].largest_acked_packet,
15181518
);

quinn-proto/src/connection/paths.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,18 +421,18 @@ struct PathResponse {
421421

422422
/// Summary statistics of packets that have been sent on a particular path, but which have not yet
423423
/// been acked or deemed lost
424-
pub struct InFlight {
424+
pub(super) struct InFlight {
425425
/// Sum of the sizes of all sent packets considered "in flight" by congestion control
426426
///
427427
/// The size does not include IP or UDP overhead. Packets only containing ACK frames do not
428428
/// count towards this to ensure congestion control does not impede congestion feedback.
429-
pub bytes: u64,
429+
pub(super) bytes: u64,
430430
/// Number of packets in flight containing frames other than ACK and PADDING
431431
///
432432
/// This can be 0 even when bytes is not 0 because PADDING frames cause a packet to be
433433
/// considered "in flight" by congestion control. However, if this is nonzero, bytes will always
434434
/// also be nonzero.
435-
pub ack_eliciting: u64,
435+
pub(super) ack_eliciting: u64,
436436
}
437437

438438
impl InFlight {

quinn-proto/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ pub use bloom_token_log::BloomTokenLog;
4545
mod connection;
4646
pub use crate::connection::{
4747
Chunk, Chunks, ClosedStream, Connection, ConnectionError, ConnectionStats, Datagrams, Event,
48-
FinishError, FrameStats, InFlight, PathStats, ReadError, ReadableError, RecvStream,
49-
RttEstimator, SendDatagramError, SendStream, ShouldTransmit, StreamEvent, Streams, UdpStats,
50-
WriteError, Written,
48+
FinishError, FrameStats, PathStats, ReadError, ReadableError, RecvStream, RttEstimator,
49+
SendDatagramError, SendStream, ShouldTransmit, StreamEvent, Streams, UdpStats, WriteError,
50+
Written,
5151
};
5252
#[cfg(feature = "qlog")]
5353
pub use connection::qlog::QlogStream;

0 commit comments

Comments
 (0)