Skip to content

Commit

Permalink
WIP: quic: quic_tx modifications for BBR.
Browse files Browse the repository at this point in the history
  • Loading branch information
haproxyFred committed Nov 15, 2024
1 parent f8a6850 commit 0c55838
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/haproxy/quic_pacing.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ int quic_pacing_expired(const struct quic_pacer *pacer);

enum quic_tx_err quic_pacing_send(struct quic_pacer *pacer, struct quic_conn *qc);

void quic_pacing_sent_done(struct quic_pacer *pacer, int sent);
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts);

#endif /* _HAPROXY_QUIC_PACING_H */
4 changes: 2 additions & 2 deletions src/quic_pacing.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum quic_tx_err quic_pacing_send(struct quic_pacer *pacer, struct quic_conn *qc
return ret;
}

void quic_pacing_sent_done(struct quic_pacer *pacer, int sent)
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts)
{
pacer->next = now_mono_time() + quic_pacing_ns_pkt(pacer) * sent;
pacer->next = now_mono_time() + sent * ns_pkts;
}
12 changes: 9 additions & 3 deletions src/quic_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ static int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx)
qc->path->ifae_pkts++;
if (qc->flags & QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ)
qc_idle_timer_rearm(qc, 0, 0);
if (cc->algo->on_transmit)
cc->algo->on_transmit(cc);
if (cc->algo->drs_on_transmit)
cc->algo->drs_on_transmit(cc, pkt);
}
if (!(qc->flags & QUIC_FL_CONN_CLOSING) &&
(pkt->flags & QUIC_FL_TX_PACKET_CC)) {
Expand Down Expand Up @@ -476,6 +480,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
struct list send_list = LIST_HEAD_INIT(send_list);
enum quic_tx_err ret = QUIC_TX_ERR_NONE;
int max_dgram = 0, sent;
ullong ns_pkts;

TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc);
BUG_ON(qc->mux_state != QC_MUX_READY); /* Only MUX can uses this function so it must be ready. */
Expand All @@ -495,8 +500,9 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
}

if (pacer) {
const ullong ns_pkts = quic_pacing_ns_pkt(pacer);
max_dgram = global.tune.quic_frontend_max_tx_burst * 1000000 / (ns_pkts + 1) + 1;
struct quic_cc *cc = &qc->path->cc;

ns_pkts = cc->algo->pacing_delay_ns(cc, &max_dgram);
}

TRACE_STATE("preparing data (from MUX)", QUIC_EV_CONN_TXPKT, qc);
Expand All @@ -508,7 +514,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
else if (pacer) {
if (max_dgram && max_dgram == sent && !LIST_ISEMPTY(frms))
ret = QUIC_TX_ERR_AGAIN;
quic_pacing_sent_done(pacer, sent);
quic_pacing_sent_done(pacer, sent, ns_pkts);
}

TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);
Expand Down

0 comments on commit 0c55838

Please sign in to comment.