Skip to content

Commit 69ab5a7

Browse files
committed
MINOR: quic: quic_cc modifications to support BBR
Add several callbacks to quic_cc_algo struct which are only called by BBR. ->get_drs() may be used to retrieve the delivery rate sampling information from an congestion algorithm struct (quic_cc). ->on_transmit() must be called before sending any packet a QUIC sender. ->on_ack_rcvd() must be called after having received an ACK. ->on_pkt_lost() must be called after having detected a packet loss. ->congestion_event() must be called after any congestion event detection Modify quic_cc.c to call ->event only if defined. This is not the case for BBR.
1 parent 93ad34e commit 69ab5a7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

include/haproxy/quic_cc-t.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include <haproxy/buf-t.h>
3333
#include <haproxy/quic_loss-t.h>
34+
#include <haproxy/quic_tx-t.h>
3435

3536
#define QUIC_CC_INFINITE_SSTHESH ((uint32_t)-1)
3637

@@ -136,6 +137,16 @@ struct quic_cc_algo {
136137
/* Defined only if pacing is used. */
137138
uint (*pacing_rate)(const struct quic_cc *cc);
138139
uint (*pacing_burst)(const struct quic_cc *cc);
140+
141+
struct quic_cc_drs *(*get_drs)(struct quic_cc *cc);
142+
void (*on_transmit)(struct quic_cc *cc);
143+
void (*drs_on_transmit)(struct quic_cc *cc, struct quic_tx_packet *pkt);
144+
void (*on_ack_rcvd)(struct quic_cc *cc, uint32_t acked, uint32_t delivered,
145+
uint32_t ack_rtt, uint32_t bytes_lost,
146+
unsigned int largest_pkt_sent_ts);
147+
void (*on_pkt_lost)(struct quic_cc *cc,
148+
struct quic_tx_packet *pkt, uint32_t lost_bytes);
149+
void (*congestion_event)(struct quic_cc *cc, uint32_t ts);
139150
};
140151

141152
#endif /* USE_QUIC */

src/quic_cc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222

2323
#include <haproxy/quic_cc.h>
24+
#include <haproxy/quic_pacing.h>
2425

2526
struct quic_cc_algo *default_quic_cc_algo = &quic_cc_algo_cubic;
2627

@@ -40,7 +41,8 @@ void quic_cc_init(struct quic_cc *cc,
4041
/* Send <ev> event to <cc> congestion controller. */
4142
void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev)
4243
{
43-
cc->algo->event(cc, ev);
44+
if (cc->algo->event)
45+
cc->algo->event(cc, ev);
4446
}
4547

4648
void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc)

0 commit comments

Comments
 (0)