Skip to content

Commit

Permalink
fixup! restore cwnd rollback only for in-flight packets
Browse files Browse the repository at this point in the history
Previously we would only rollback cwnd updates due to spurious losses
for in-flight packets (while still updating threshold and stats for all
spurious losses) as that could mean there was no prior state to rollback
to.

The refactor made rollbacks happen for all spurious losses, so this
restores that (we still want to update threshold and stats for not
in-flight spurious losses too).
  • Loading branch information
ghedo committed May 2, 2024
1 parent 297e04f commit 194b849
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion quiche/src/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ struct AckedDetectionResult {
spurious_losses: usize,
spurious_pkt_thresh: Option<u64>,
has_ack_eliciting: bool,
has_in_flight_spurious_loss: bool,
}

struct LossDetectionResult {
Expand All @@ -121,6 +122,7 @@ impl RecoveryEpoch {
let mut spurious_losses = 0;
let mut spurious_pkt_thresh = None;
let mut has_ack_eliciting = false;
let mut has_in_flight_spurious_loss = false;

let largest_acked = self.largest_acked_packet.unwrap();

Expand Down Expand Up @@ -154,6 +156,10 @@ impl RecoveryEpoch {
spurious_pkt_thresh
.get_or_insert(largest_acked - unacked.pkt_num + 1);
unacked.time_acked = Some(now);

if unacked.in_flight {
has_in_flight_spurious_loss = true;
}
} else {
if unacked.in_flight {
self.in_flight_count -= 1;
Expand Down Expand Up @@ -192,6 +198,7 @@ impl RecoveryEpoch {
spurious_losses,
spurious_pkt_thresh,
has_ack_eliciting,
has_in_flight_spurious_loss,
}
}

Expand Down Expand Up @@ -666,6 +673,7 @@ impl Recovery {
spurious_losses,
spurious_pkt_thresh,
has_ack_eliciting,
has_in_flight_spurious_loss,
} = self.epochs[epoch].detect_and_remove_acked_packets(
now,
ranges,
Expand All @@ -681,7 +689,7 @@ impl Recovery {
}

// Undo congestion window update.
if spurious_losses > 0 {
if has_in_flight_spurious_loss {
(self.cc_ops.rollback)(self);
}

Expand Down

0 comments on commit 194b849

Please sign in to comment.