]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: quic: Remove QUIC path manipulations out of the congestion controller
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 1 Mar 2022 16:06:50 +0000 (17:06 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 4 Mar 2022 16:47:32 +0000 (17:47 +0100)
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.

src/quic_cc_newreno.c
src/xprt_quic.c

index a9b505741704d02748734617decd4fcbe4c102f6..f11a2fee038b9cb096a78834f03b5d8dea3b2a47 100644 (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);
index 900b2bebec8c85467c37c80eb1b8dcffd83b7b48..555041089b153731cdc7e835105f8a2664918b64 100644 (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. */