Skip to content

Commit b453399

Browse files
committed
WIP: quic: quic_cc modifications for BBR
1 parent 62e9580 commit b453399

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

include/haproxy/quic_cc-t.h

Lines changed: 16 additions & 1 deletion
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

@@ -56,6 +57,8 @@ enum quic_cc_algo_state_type {
5657
};
5758

5859
enum quic_cc_event_type {
60+
/* TX done */
61+
QUIC_CC_EVT_TX,
5962
/* ACK receipt. */
6063
QUIC_CC_EVT_ACK,
6164
/* Packet loss. */
@@ -70,7 +73,9 @@ struct quic_cc_event {
7073
struct ack {
7174
uint64_t acked;
7275
uint64_t pn;
76+
unsigned int bytes_lost;
7377
unsigned int time_sent;
78+
unsigned int rtt;
7479
} ack;
7580
struct loss {
7681
unsigned int time_sent;
@@ -90,7 +95,7 @@ struct quic_cc {
9095
/* <conn> is there only for debugging purpose. */
9196
struct quic_conn *qc;
9297
struct quic_cc_algo *algo;
93-
uint32_t priv[116];
98+
uint32_t priv[120];
9499
};
95100

96101
struct quic_cc_path {
@@ -129,6 +134,16 @@ struct quic_cc_algo {
129134
void (*state_trace)(struct buffer *buf, const struct quic_cc *cc);
130135
void (*state_cli)(struct buffer *buf, const struct quic_cc_path *path);
131136
void (*hystart_start_round)(struct quic_cc *cc, uint64_t pn);
137+
struct quic_cc_drs *(*get_drs)(struct quic_cc *cc);
138+
void (*on_transmit)(struct quic_cc *cc);
139+
void (*drs_on_transmit)(struct quic_cc *cc, struct quic_tx_packet *pkt);
140+
void (*on_ack_rcvd)(struct quic_cc *cc, uint32_t acked, uint32_t delivered,
141+
uint32_t ack_rtt, uint32_t bytes_lost,
142+
unsigned int largest_pkt_sent_ts);
143+
void (*on_pkt_lost)(struct quic_cc *cc,
144+
struct quic_tx_packet *pkt, uint32_t lost_bytes);
145+
void (*congestion_event)(struct quic_cc *cc, uint32_t ts);
146+
unsigned long long (*pacing_delay_ns)(const struct quic_cc *cc);
132147
};
133148

134149
#endif /* USE_QUIC */

include/haproxy/quic_cc.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ static inline void quic_cc_event_trace(struct buffer *buf, const struct quic_cc_
5656
{
5757
chunk_appendf(buf, " event=");
5858
switch (ev->type) {
59+
case QUIC_CC_EVT_TX:
60+
chunk_appendf(buf, "tx done");
61+
break;
5962
case QUIC_CC_EVT_ACK:
6063
chunk_appendf(buf, "ack acked=%llu time_sent:%dms",
6164
(unsigned long long)ev->ack.acked, TICKS_TO_MS(tick_remain(ev->ack.time_sent, now_ms)));
@@ -95,7 +98,7 @@ static inline void quic_cc_path_init(struct quic_cc_path *path, int ipv4, unsign
9598
path->ifae_pkts = 0;
9699
quic_cc_init(&path->cc, algo, qc);
97100
path->delivery_rate = 0;
98-
path->send_quantum = path->mtu * 10;
101+
path->send_quantum = 64 * 1024;
99102
}
100103

101104
/* Return the remaining <room> available on <path> QUIC path for prepared data

src/quic_cc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ void quic_cc_init(struct quic_cc *cc,
4040
/* Send <ev> event to <cc> congestion controller. */
4141
void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev)
4242
{
43-
cc->algo->event(cc, ev);
43+
if (cc->algo->event)
44+
cc->algo->event(cc, ev);
4445
}
4546

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

0 commit comments

Comments
 (0)