Skip to content

Commit 4054d87

Browse files
committed
WIP: quic: Pacing minor modifications (NOT SURE TO BE KEPT)
1 parent 06656ea commit 4054d87

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

include/haproxy/quic_pacing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ int quic_pacing_expired(const struct quic_pacer *pacer);
3939

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

42-
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent);
42+
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts);
4343

4444
#endif /* _HAPROXY_QUIC_PACING_H */

src/quic_pacing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ enum quic_tx_err quic_pacing_send(struct quic_pacer *pacer, struct quic_conn *qc
2323
return ret;
2424
}
2525

26-
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent)
26+
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts)
2727
{
2828
pacer->next = now_mono_time() + quic_pacing_ns_pkt(pacer) * sent;
2929
}

src/quic_tx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
480480
struct list send_list = LIST_HEAD_INIT(send_list);
481481
enum quic_tx_err ret = QUIC_TX_ERR_NONE;
482482
int max_dgram = 0, sent;
483+
ullong ns_pkts;
483484

484485
TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc);
485486
BUG_ON(qc->mux_state != QC_MUX_READY); /* Only MUX can uses this function so it must be ready. */
@@ -500,7 +501,8 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
500501

501502
if (pacer) {
502503
struct quic_cc *cc = &qc->path->cc;
503-
const ullong ns_pkts = cc->algo->pacing_delay_ns(cc);
504+
505+
ns_pkts = cc->algo->pacing_delay_ns(cc);
504506
max_dgram = global.tune.quic_frontend_max_tx_burst * 1000000 / (ns_pkts + 1) + 1;
505507
}
506508

@@ -513,7 +515,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms,
513515
else if (pacer) {
514516
if (max_dgram && max_dgram == sent && !LIST_ISEMPTY(frms))
515517
ret = QUIC_TX_ERR_AGAIN;
516-
quic_pacing_sent_done(pacer, sent);
518+
quic_pacing_sent_done(pacer, sent, ns_pkts);
517519
}
518520

519521
TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);

0 commit comments

Comments
 (0)