From 5f6783094d3e61f2e7c58e3d9f7553b570ac4fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 2 Mar 2022 15:33:06 +0100 Subject: [PATCH] CLEANUP: quic: Remove useless definitions from quic_cc_event struct Since the persistent congestion detection is done out of the congestion controllers, there is no need to pass them information through quic_cc_event struct. We remove its useless members. Also remove qc_cc_loss_event() which is no more used. --- include/haproxy/quic_cc-t.h | 4 ---- include/haproxy/quic_cc.h | 6 +----- src/xprt_quic.c | 24 ------------------------ 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/include/haproxy/quic_cc-t.h b/include/haproxy/quic_cc-t.h index f869dda0b..78af6a587 100644 --- a/include/haproxy/quic_cc-t.h +++ b/include/haproxy/quic_cc-t.h @@ -60,11 +60,7 @@ struct quic_cc_event { unsigned int time_sent; } ack; struct loss { - unsigned int now_ms; - unsigned int max_ack_delay; - size_t lost_bytes; unsigned int time_sent; - unsigned int period; } loss; }; }; diff --git a/include/haproxy/quic_cc.h b/include/haproxy/quic_cc.h index 048a03a62..54c54d2d8 100644 --- a/include/haproxy/quic_cc.h +++ b/include/haproxy/quic_cc.h @@ -57,11 +57,7 @@ static inline void quic_cc_event_trace(struct buffer *buf, const struct quic_cc_ (unsigned long long)ev->ack.acked, ev->ack.time_sent); break; case QUIC_CC_EVT_LOSS: - chunk_appendf(buf, "loss now_ms=%u max_ack_delay=%u lost_bytes=%llu" - " time_sent=%u period=%u", - ev->loss.now_ms, ev->loss.max_ack_delay, - (unsigned long long)ev->loss.lost_bytes, - ev->loss.time_sent, ev->loss.period); + chunk_appendf(buf, "now_ms=%u time_sent=%u", now_ms, ev->loss.time_sent); break; case QUIC_CC_EVT_ECN_CE: chunk_appendf(buf, "ecn_ce"); diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 797324045..fee009c5f 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -1558,30 +1558,6 @@ static inline void free_quic_tx_pkts(struct list *pkts) } } -/* Send a packet loss event nofification to the congestion controller - * attached to connection with the number of lost bytes, - * , the oldest lost packet and newest lost packet - * at current time. - * Always succeeds. - */ -static inline void qc_cc_loss_event(struct quic_conn *qc, - unsigned int lost_bytes, - unsigned int newest_time_sent, - unsigned int period, - unsigned int now_us) -{ - struct quic_cc_event ev = { - .type = QUIC_CC_EVT_LOSS, - .loss.now_ms = now_ms, - .loss.max_ack_delay = qc->max_ack_delay, - .loss.lost_bytes = lost_bytes, - .loss.time_sent = newest_time_sent, - .loss.period = period, - }; - - quic_cc_event(&qc->path->cc, &ev); -} - /* Send a packet ack event nofication for each newly acked packet of * list and free them. * Always succeeds.