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.
This commit is contained in:
Amaury Denoyelle 2022-05-13 11:27:06 +02:00
parent b5ca943ff9
commit 06749f3d6f

View File

@ -33,6 +33,7 @@
#include <haproxy/buf.h> #include <haproxy/buf.h>
#include <haproxy/chunk.h> #include <haproxy/chunk.h>
#include <haproxy/ncbuf-t.h>
#include <haproxy/net_helper.h> #include <haproxy/net_helper.h>
#include <haproxy/openssl-compat.h> #include <haproxy/openssl-compat.h>
#include <haproxy/ticks.h> #include <haproxy/ticks.h>
@ -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, static inline void quic_transport_params_init(struct quic_transport_params *p,
int server) 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) */ /* Default values (when absent) */
quic_dflt_transport_params_cpy(p); quic_dflt_transport_params_cpy(p);
p->max_idle_timeout = 30000; p->max_idle_timeout = 30000;
p->initial_max_data = 1 * 1024 * 1024; p->initial_max_streams_bidi = max_streams_bidi;
p->initial_max_stream_data_bidi_local = 256 * 1024; p->initial_max_streams_uni = max_streams_uni;
p->initial_max_stream_data_bidi_remote = 256 * 1024; p->initial_max_stream_data_bidi_local = ncb_size;
p->initial_max_stream_data_uni = 256 * 1024; p->initial_max_stream_data_bidi_remote = ncb_size;
p->initial_max_streams_bidi = 100; p->initial_max_stream_data_uni = ncb_size;
p->initial_max_streams_uni = 3; p->initial_max_data = (max_streams_bidi + max_streams_uni) * ncb_size;
if (server) if (server)
p->with_stateless_reset_token = 1; p->with_stateless_reset_token = 1;