From 06749f3d6f75e12c44c179515dd7597efa290230 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 13 May 2022 11:27:06 +0200 Subject: [PATCH] MINOR: xprt_quic: adjust flow-control according to bufsize Redefine the initial local flow-control to enforce by us. Use bufsize as the maximum offset allowed to be received. This change is part of an adjustement on the Rx path. Mux buffer will be converted to a ncbuf. Flow-control parameters must ensure that we never receive a frame larger than the buffer. With this, all received frames will be stored in the MUX buffer. --- include/haproxy/xprt_quic.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index cca985c44..967a43d8d 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -463,17 +464,21 @@ static inline void quic_dflt_transport_params_cpy(struct quic_transport_params * static inline void quic_transport_params_init(struct quic_transport_params *p, int server) { + const uint64_t ncb_size = global.tune.bufsize - NCB_RESERVED_SZ; + const int max_streams_bidi = 100; + const int max_streams_uni = 3; + /* Default values (when absent) */ quic_dflt_transport_params_cpy(p); p->max_idle_timeout = 30000; - p->initial_max_data = 1 * 1024 * 1024; - p->initial_max_stream_data_bidi_local = 256 * 1024; - p->initial_max_stream_data_bidi_remote = 256 * 1024; - p->initial_max_stream_data_uni = 256 * 1024; - p->initial_max_streams_bidi = 100; - p->initial_max_streams_uni = 3; + p->initial_max_streams_bidi = max_streams_bidi; + p->initial_max_streams_uni = max_streams_uni; + p->initial_max_stream_data_bidi_local = ncb_size; + p->initial_max_stream_data_bidi_remote = ncb_size; + p->initial_max_stream_data_uni = ncb_size; + p->initial_max_data = (max_streams_bidi + max_streams_uni) * ncb_size; if (server) p->with_stateless_reset_token = 1;