CLEANUP: quic: Remove QUIC path manipulations out of the congestion controller

QUIC connection path in flight bytes is a variable which should not be manipulated
by the congestion controller. This latter aim is to compute the congestion window.
So, we pass it as less as parameters as possible to do so.
This commit is contained in:
Frédéric Lécaille 2022-03-01 17:06:50 +01:00 committed by Amaury Denoyelle
parent 4d3d36b670
commit ba9db40b07
2 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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. */