MINOR: quic: extend quic-cc-algo optional parameters

Modify quic-cc-algo for better extensability of optional parameters
parsing. This will be useful to support a new parameter for maximum
allowed pacing burst size.

Take this opportunity to refine quic-cc-algo documentation. Optional
parameters are now presented as a list which would be soon extended.
This commit is contained in:
Amaury Denoyelle 2024-11-19 15:38:53 +01:00
parent a6504c9cfb
commit 6dfc8fbf1d
2 changed files with 31 additions and 13 deletions

View File

@ -17035,15 +17035,19 @@ proto <name>
instance, it is possible to force the http/2 on clear TCP by specifying "proto instance, it is possible to force the http/2 on clear TCP by specifying "proto
h2" on the bind line. h2" on the bind line.
quic-cc-algo { cubic | newreno | nocc } quic-cc-algo { cubic | newreno | nocc }[(<args,...>)]
quic-cc-algo { cubic | newreno | nocc }(<max_window>)
This is a QUIC specific setting to select the congestion control algorithm This is a QUIC specific setting to select the congestion control algorithm
for any connection attempts to the configured QUIC listeners. They are similar for any connection attempts to the configured QUIC listeners. They are similar
to those used by TCP. An optional value in bytes may be used to specify the to those used by TCP.
maximum window size. It must be greater than 10k and smaller than 4g.
Default value: cubic Default value: cubic
Default window value: "tune.quic.frontend.default-max-window-size"
For further customization, a list of parameters can be specified after the
algorithm token. It must be written between parenthesis, separated by a comma
operator. Each argument is optional and can be empty if needed. Here is the
mandatory order of each parameters :
- maximum window size in bytes. It must be greater than 10k and smaller than
4g. By default "tune.quic.frontend.default-max-window-size" value is used.
Example: Example:
# newreno congestion control algorithm # newreno congestion control algorithm

View File

@ -119,21 +119,35 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
} }
if (*arg++ == '(') { if (*arg++ == '(') {
unsigned long cwnd;
char *end_opt; char *end_opt;
cwnd = parse_window_size(args[cur_arg], arg, &end_opt, err); if (*arg == ')')
if (!cwnd) goto out;
goto fail;
if (*end_opt != ')') { if (*arg != ',') {
memprintf(err, "'%s' : expects %s(<max window>)", args[cur_arg + 1], algo); unsigned long cwnd = parse_window_size(args[cur_arg], arg, &end_opt, err);
goto fail; if (!cwnd)
goto fail;
conf->max_cwnd = cwnd;
if (*end_opt == ')') {
goto out;
}
else if (*end_opt != ',') {
memprintf(err, "'%s' : cannot parse max-window argument for '%s' algorithm", args[cur_arg], algo);
goto fail;
}
arg = end_opt;
} }
conf->max_cwnd = cwnd; if (*++arg != ')') {
memprintf(err, "'%s' : too many argument for '%s' algorithm", args[cur_arg], algo);
goto fail;
}
} }
out:
conf->quic_cc_algo = cc_algo; conf->quic_cc_algo = cc_algo;
return 0; return 0;