Skip to content

Commit 6dfc8fb

Browse files
committed
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.
1 parent a6504c9 commit 6dfc8fb

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

doc/configuration.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17035,15 +17035,19 @@ proto <name>
1703517035
instance, it is possible to force the http/2 on clear TCP by specifying "proto
1703617036
h2" on the bind line.
1703717037

17038-
quic-cc-algo { cubic | newreno | nocc }
17039-
quic-cc-algo { cubic | newreno | nocc }(<max_window>)
17038+
quic-cc-algo { cubic | newreno | nocc }[(<args,...>)]
1704017039
This is a QUIC specific setting to select the congestion control algorithm
1704117040
for any connection attempts to the configured QUIC listeners. They are similar
17042-
to those used by TCP. An optional value in bytes may be used to specify the
17043-
maximum window size. It must be greater than 10k and smaller than 4g.
17041+
to those used by TCP.
1704417042

1704517043
Default value: cubic
17046-
Default window value: "tune.quic.frontend.default-max-window-size"
17044+
17045+
For further customization, a list of parameters can be specified after the
17046+
algorithm token. It must be written between parenthesis, separated by a comma
17047+
operator. Each argument is optional and can be empty if needed. Here is the
17048+
mandatory order of each parameters :
17049+
- maximum window size in bytes. It must be greater than 10k and smaller than
17050+
4g. By default "tune.quic.frontend.default-max-window-size" value is used.
1704717051

1704817052
Example:
1704917053
# newreno congestion control algorithm

src/cfgparse-quic.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,35 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
119119
}
120120

121121
if (*arg++ == '(') {
122-
unsigned long cwnd;
123122
char *end_opt;
124123

125-
cwnd = parse_window_size(args[cur_arg], arg, &end_opt, err);
126-
if (!cwnd)
127-
goto fail;
124+
if (*arg == ')')
125+
goto out;
128126

129-
if (*end_opt != ')') {
130-
memprintf(err, "'%s' : expects %s(<max window>)", args[cur_arg + 1], algo);
131-
goto fail;
127+
if (*arg != ',') {
128+
unsigned long cwnd = parse_window_size(args[cur_arg], arg, &end_opt, err);
129+
if (!cwnd)
130+
goto fail;
131+
132+
conf->max_cwnd = cwnd;
133+
134+
if (*end_opt == ')') {
135+
goto out;
136+
}
137+
else if (*end_opt != ',') {
138+
memprintf(err, "'%s' : cannot parse max-window argument for '%s' algorithm", args[cur_arg], algo);
139+
goto fail;
140+
}
141+
arg = end_opt;
132142
}
133143

134-
conf->max_cwnd = cwnd;
144+
if (*++arg != ')') {
145+
memprintf(err, "'%s' : too many argument for '%s' algorithm", args[cur_arg], algo);
146+
goto fail;
147+
}
135148
}
136149

150+
out:
137151
conf->quic_cc_algo = cc_algo;
138152
return 0;
139153

0 commit comments

Comments
 (0)