diff --git a/src/quic_cc_newreno.c b/src/quic_cc_newreno.c index a9b505741..f11a2fee0 100644 --- a/src/quic_cc_newreno.c +++ b/src/quic_cc_newreno.c @@ -48,7 +48,6 @@ static void quic_cc_nr_ss_cb(struct quic_cc *cc, struct quic_cc_event *ev) path = container_of(cc, struct quic_path, cc); switch (ev->type) { case QUIC_CC_EVT_ACK: - path->in_flight -= ev->ack.acked; /* Do not increase the congestion window in recovery period. */ if (ev->ack.time_sent <= cc->algo_state.nr.recovery_start_time) return; @@ -61,7 +60,6 @@ static void quic_cc_nr_ss_cb(struct quic_cc *cc, struct quic_cc_event *ev) break; case QUIC_CC_EVT_LOSS: - path->in_flight -= ev->loss.lost_bytes; cc->algo_state.nr.cwnd = QUIC_MAX(cc->algo_state.nr.cwnd >> 1, path->min_cwnd); path->cwnd = cc->algo_state.nr.ssthresh = cc->algo_state.nr.cwnd; /* Exit to congestion avoidance. */ @@ -84,7 +82,6 @@ static void quic_cc_nr_ca_cb(struct quic_cc *cc, struct quic_cc_event *ev) path = container_of(cc, struct quic_path, cc); switch (ev->type) { case QUIC_CC_EVT_ACK: - path->in_flight -= ev->ack.acked; /* Do not increase the congestion window in recovery period. */ if (ev->ack.time_sent <= cc->algo_state.nr.recovery_start_time) goto out; @@ -98,7 +95,6 @@ static void quic_cc_nr_ca_cb(struct quic_cc *cc, struct quic_cc_event *ev) break; case QUIC_CC_EVT_LOSS: - path->in_flight -= ev->loss.lost_bytes; if (ev->loss.newest_time_sent > cc->algo_state.nr.recovery_start_time) { cc->algo_state.nr.recovery_start_time = ev->loss.now_ms; cc->algo_state.nr.cwnd = QUIC_MAX(cc->algo_state.nr.cwnd >> 1, path->min_cwnd); diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 900b2bebe..555041089 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -1595,6 +1595,7 @@ static inline void qc_treat_newly_acked_pkts(struct quic_conn *qc, list_for_each_entry_safe(pkt, tmp, newly_acked_pkts, list) { pkt->pktns->tx.in_flight -= pkt->in_flight_len; qc->path->prep_in_flight -= pkt->in_flight_len; + qc->path->in_flight -= pkt->in_flight_len; if (pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) qc->path->ifae_pkts--; ev.ack.acked = pkt->in_flight_len; @@ -1641,6 +1642,7 @@ static inline void qc_release_lost_pkts(struct quic_conn *qc, lost_bytes += pkt->in_flight_len; pkt->pktns->tx.in_flight -= pkt->in_flight_len; qc->path->prep_in_flight -= pkt->in_flight_len; + qc->path->in_flight -= pkt->in_flight_len; if (pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) qc->path->ifae_pkts--; /* Treat the frames of this lost packet. */