Skip to content

Commit 78ee35f

Browse files
committed
BUG/MINOR: quic: Missing application limitation detection for BBR
The ->app_limited member of the delivery rate struct (quic_cc_drs) aim is to store the index of the last transmitted byte marked as application-limited so that to track the application-limited phases. During these phases, BBR must ignore delivery rate sample to properly estimate the delivery rate. Without such a patch, the Startup state could be exited very quickly with a very low estimated bottleneck bandwidth. This had a very bad impact on little objects with download time smaller than the expected Startup phase duration.
1 parent ea17de0 commit 78ee35f

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

include/haproxy/quic_cc-t.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct quic_cc_algo {
147147
void (*on_pkt_lost)(struct quic_cc *cc,
148148
struct quic_tx_packet *pkt, uint32_t lost_bytes);
149149
void (*congestion_event)(struct quic_cc *cc, uint32_t ts);
150+
void (*check_app_limited)(const struct quic_cc *cc, int sent);
150151
};
151152

152153
#endif /* USE_QUIC */

src/quic_cc_bbr.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,23 @@ uint bbr_pacing_burst(const struct quic_cc *cc)
14811481
return p->send_quantum / p->mtu;
14821482
}
14831483

1484+
/* Update the delivery rate sampling state about the application limitation. */
1485+
static void bbr_check_app_limited(const struct quic_cc *cc, int sent)
1486+
{
1487+
struct bbr *bbr = quic_cc_priv(cc);
1488+
struct quic_cc_drs *drs = &bbr->drs;
1489+
struct quic_cc_path *p = container_of(cc, struct quic_cc_path, cc);
1490+
1491+
if (p->in_flight >= p->cwnd) {
1492+
drs->is_cwnd_limited = 1;
1493+
}
1494+
else if (!sent) {
1495+
drs->app_limited = drs->delivered + p->in_flight;
1496+
if (!drs->app_limited)
1497+
drs->app_limited = p->mtu;
1498+
}
1499+
}
1500+
14841501
static inline const char *bbr_state_str(struct bbr *bbr)
14851502
{
14861503
switch (bbr->state) {
@@ -1525,6 +1542,7 @@ struct quic_cc_algo quic_cc_algo_bbr = {
15251542
.on_ack_rcvd = bbr_update_on_ack,
15261543
.congestion_event = bbr_congestion_event,
15271544
.on_pkt_lost = bbr_update_on_loss,
1545+
.check_app_limited = bbr_check_app_limited,
15281546
.state_cli = bbr_state_cli,
15291547
};
15301548

src/quic_tx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <haproxy/pool.h>
2020
#include <haproxy/trace.h>
21+
#include <haproxy/quic_cc_drs.h>
2122
#include <haproxy/quic_cid.h>
2223
#include <haproxy/quic_conn.h>
2324
#include <haproxy/quic_pacing.h>
@@ -506,6 +507,10 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
506507
TRACE_STATE("preparing data (from MUX)", QUIC_EV_CONN_TXPKT, qc);
507508
qel_register_send(&send_list, qc->ael, frms);
508509
sent = qc_send(qc, 0, &send_list, max_dgram);
510+
511+
if (pacer && qc->path->cc.algo->check_app_limited)
512+
qc->path->cc.algo->check_app_limited(&qc->path->cc, sent);
513+
509514
if (sent <= 0) {
510515
ret = QUIC_TX_ERR_FATAL;
511516
}

0 commit comments

Comments
 (0)