From 3e11492c99838bde39e6cce3887cb8ad7c2b6b3b Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 24 Oct 2024 15:53:17 +0200 Subject: [PATCH] MINOR: quic: define quic_pacing module Add a new module quic_pacing. A new structure quic_pacer is defined. This will be used as a pacing engine to implement smooth emission of QUIC data. --- Makefile | 2 +- include/haproxy/quic_conn.h | 1 + include/haproxy/quic_pacing-t.h | 11 +++++++++++ include/haproxy/quic_pacing.h | 15 +++++++++++++++ src/quic_pacing.c | 1 + 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 include/haproxy/quic_pacing-t.h create mode 100644 include/haproxy/quic_pacing.h create mode 100644 src/quic_pacing.c diff --git a/Makefile b/Makefile index 5ace584836..4a8066daa0 100644 --- a/Makefile +++ b/Makefile @@ -653,7 +653,7 @@ OPTIONS_OBJS += src/quic_rx.o src/mux_quic.o src/h3.o src/quic_tx.o \ src/cfgparse-quic.o src/qmux_trace.o src/qpack-enc.o \ src/qpack-tbl.o src/h3_stats.o src/quic_stats.o \ src/quic_fctl.o src/cbuf.o src/quic_rules.o \ - src/quic_token.o + src/quic_token.o src/quic_pacing.o endif ifneq ($(USE_QUIC_OPENSSL_COMPAT:0=),) diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index ebff291864..31f0c086f8 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include diff --git a/include/haproxy/quic_pacing-t.h b/include/haproxy/quic_pacing-t.h new file mode 100644 index 0000000000..2315c2f65e --- /dev/null +++ b/include/haproxy/quic_pacing-t.h @@ -0,0 +1,11 @@ +#ifndef _HAPROXY_QUIC_PACING_T_H +#define _HAPROXY_QUIC_PACING_T_H + +#include +#include + +struct quic_pacer { + const struct quic_cc *cc; /* Congestion controler algo used for this connection */ +}; + +#endif /* _HAPROXY_QUIC_PACING_T_H */ diff --git a/include/haproxy/quic_pacing.h b/include/haproxy/quic_pacing.h new file mode 100644 index 0000000000..5ef11a5319 --- /dev/null +++ b/include/haproxy/quic_pacing.h @@ -0,0 +1,15 @@ +#ifndef _HAPROXY_QUIC_PACING_H +#define _HAPROXY_QUIC_PACING_H + +#include + +#include +#include + +static inline void quic_pacing_init(struct quic_pacer *pacer, + const struct quic_cc *cc) +{ + pacer->cc = cc; +} + +#endif /* _HAPROXY_QUIC_PACING_H */ diff --git a/src/quic_pacing.c b/src/quic_pacing.c new file mode 100644 index 0000000000..faee5e81c2 --- /dev/null +++ b/src/quic_pacing.c @@ -0,0 +1 @@ +#include