Skip to content

Commit

Permalink
WIP: quic: Pacing minor modifications (NOT SURE TO BE KEPT)
Browse files Browse the repository at this point in the history
  • Loading branch information
haproxyFred committed Oct 31, 2024
1 parent a047e53 commit 92110ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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 */
2 changes: 1 addition & 1 deletion 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;
}
6 changes: 4 additions & 2 deletions src/quic_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,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 @@ -500,7 +501,8 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,

if (pacer) {
struct quic_cc *cc = &qc->path->cc;
const ullong ns_pkts = cc->algo->pacing_delay_ns(cc);

ns_pkts = cc->algo->pacing_delay_ns(cc);
max_dgram = global.tune.quic_frontend_max_tx_burst * 1000000 / (ns_pkts + 1) + 1;
}

Expand All @@ -513,7 +515,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 92110ad

Please sign in to comment.