Skip to content

Commit

Permalink
WIP: quic: minor modifs for BBR (to be merged)
Browse files Browse the repository at this point in the history
  • Loading branch information
haproxyFred committed Nov 19, 2024
1 parent a400cfb commit acde64f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/quic_cc_bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,10 +1292,10 @@ static void bbr_update_control_parameters(struct bbr *bbr,
bbr_set_cwnd(bbr, p, acked);
}

static inline int in_recovery_period(struct bbr *bbr, uint32_t ts)
static inline int in_recovery_period(struct quic_cc_path *p, uint32_t ts)
{
return tick_isset(bbr->recovery_start_ts) ||
tick_is_le(ts, bbr->recovery_start_ts);
return tick_isset(p->recovery_start_ts) ||
tick_is_le(ts, p->recovery_start_ts);
}

static void bbr_handle_recovery(struct bbr *bbr, struct quic_cc_path *p,
Expand All @@ -1304,7 +1304,7 @@ static void bbr_handle_recovery(struct bbr *bbr, struct quic_cc_path *p,
{
if (bbr->in_loss_recovery) {
if (tick_isset(largest_pkt_sent_ts) &&
!in_recovery_period(bbr, largest_pkt_sent_ts)) {
!in_recovery_period(p, largest_pkt_sent_ts)) {
bbr->in_loss_recovery = 0;
bbr->round_count_at_recovery = UINT64_MAX;
bbr_restore_cwnd(bbr, p);
Expand All @@ -1321,6 +1321,7 @@ static void bbr_handle_recovery(struct bbr *bbr, struct quic_cc_path *p,
bbr->round_start ? bbr->round_count : bbr->round_count + 1;
bbr_save_cwnd(bbr, p);
p->cwnd = p->in_flight + MAX(acked, p->mtu);
p->recovery_start_ts = bbr->recovery_start_ts;
bbr->recovery_start_ts = TICK_ETERNITY;
}

Expand Down Expand Up @@ -1448,7 +1449,7 @@ static void bbr_congestion_event(struct quic_cc *cc, uint32_t ts)
struct bbr *bbr = quic_cc_priv(&p->cc);

if (bbr->in_loss_recovery ||
tick_isset(bbr->recovery_start_ts) || in_recovery_period(bbr, ts))
tick_isset(bbr->recovery_start_ts) || in_recovery_period(p, ts))
return;

bbr->recovery_start_ts = ts;
Expand Down

0 comments on commit acde64f

Please sign in to comment.