FreeBSD kernel IPv4 code
cc_newreno.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
5 * The Regents of the University of California.
6 * Copyright (c) 2007-2008,2010,2014
7 * Swinburne University of Technology, Melbourne, Australia.
8 * Copyright (c) 2009-2010 Lawrence Stewart <lstewart@freebsd.org>
9 * Copyright (c) 2010 The FreeBSD Foundation
10 * All rights reserved.
11 *
12 * This software was developed at the Centre for Advanced Internet
13 * Architectures, Swinburne University of Technology, by Lawrence Stewart, James
14 * Healy and David Hayes, made possible in part by a grant from the Cisco
15 * University Research Program Fund at Community Foundation Silicon Valley.
16 *
17 * Portions of this software were developed at the Centre for Advanced
18 * Internet Architectures, Swinburne University of Technology, Melbourne,
19 * Australia by David Hayes under sponsorship from the FreeBSD Foundation.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43/*
44 * This software was first released in 2007 by James Healy and Lawrence Stewart
45 * whilst working on the NewTCP research project at Swinburne University of
46 * Technology's Centre for Advanced Internet Architectures, Melbourne,
47 * Australia, which was made possible in part by a grant from the Cisco
48 * University Research Program Fund at Community Foundation Silicon Valley.
49 * More details are available at:
50 * http://caia.swin.edu.au/urp/newtcp/
51 *
52 * Dec 2014 garmitage@swin.edu.au
53 * Borrowed code fragments from cc_cdg.c to add modifiable beta
54 * via sysctls.
55 *
56 */
57
58#include <sys/cdefs.h>
59__FBSDID("$FreeBSD$");
60
61#include <sys/param.h>
62#include <sys/kernel.h>
63#include <sys/malloc.h>
64#include <sys/module.h>
65#include <sys/socket.h>
66#include <sys/lock.h>
67#include <sys/mutex.h>
68#include <sys/socketvar.h>
69#include <sys/sysctl.h>
70#include <sys/systm.h>
71
72#include <net/vnet.h>
73
74#include <net/route.h>
75#include <net/route/nhop.h>
76
77#include <netinet/in_pcb.h>
78#include <netinet/in.h>
79#include <netinet/in_pcb.h>
80#include <netinet/tcp.h>
81#include <netinet/tcp_seq.h>
82#include <netinet/tcp_var.h>
83#include <netinet/tcp_log_buf.h>
84#include <netinet/tcp_hpts.h>
85#include <netinet/cc/cc.h>
88
89static void newreno_cb_destroy(struct cc_var *ccv);
90static void newreno_ack_received(struct cc_var *ccv, uint16_t type);
91static void newreno_after_idle(struct cc_var *ccv);
92static void newreno_cong_signal(struct cc_var *ccv, uint32_t type);
93static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf);
94static void newreno_newround(struct cc_var *ccv, uint32_t round_cnt);
95static void newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas);
96static int newreno_cb_init(struct cc_var *ccv, void *);
97static size_t newreno_data_sz(void);
98
99
100VNET_DECLARE(uint32_t, newreno_beta);
101#define V_newreno_beta VNET(newreno_beta)
102VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80;
103#define V_newreno_beta_ecn VNET(newreno_beta_ecn)
104
106 .name = "newreno",
107 .cb_destroy = newreno_cb_destroy,
108 .ack_received = newreno_ack_received,
109 .after_idle = newreno_after_idle,
110 .cong_signal = newreno_cong_signal,
111 .post_recovery = newreno_cc_post_recovery,
112 .ctl_output = newreno_ctl_output,
113 .newround = newreno_newround,
114 .rttsample = newreno_rttsample,
115 .cb_init = newreno_cb_init,
116 .cc_data_sz = newreno_data_sz,
117};
118
119static void
120newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod, uint32_t flex1)
121{
122 /*
123 * Types of logs (mod value)
124 * 1 - rtt_thresh in flex1, checking to see if RTT is to great.
125 * 2 - rtt is too great, rtt_thresh in flex1.
126 * 3 - CSS is active incr in flex1
127 * 4 - A new round is beginning flex1 is round count
128 * 5 - A new RTT measurement flex1 is the new measurement.
129 * 6 - We enter CA ssthresh is also in flex1.
130 * 7 - Socket option to change hystart executed opt.val in flex1.
131 * 8 - Back out of CSS into SS, flex1 is the css_baseline_minrtt
132 * 9 - We enter CA, via an ECN mark.
133 * 10 - We enter CA, via a loss.
134 * 11 - We have slipped out of SS into CA via cwnd growth.
135 * 12 - After idle has re-enabled hystart++
136 */
137 struct tcpcb *tp;
138
139 if (hystart_bblogs == 0)
140 return;
141 tp = ccv->ccvc.tcp;
142 if (tp->t_logstate != TCP_LOG_STATE_OFF) {
143 union tcp_log_stackspecific log;
144 struct timeval tv;
145
146 memset(&log, 0, sizeof(log));
147 log.u_bbr.flex1 = flex1;
149 log.u_bbr.flex3 = nreno->css_lastround_minrtt;
150 log.u_bbr.flex4 = nreno->css_rttsample_count;
151 log.u_bbr.flex5 = nreno->css_entered_at_round;
152 log.u_bbr.flex6 = nreno->css_baseline_minrtt;
153 /* We only need bottom 16 bits of flags */
154 log.u_bbr.flex7 = nreno->newreno_flags & 0x0000ffff;
155 log.u_bbr.flex8 = mod;
156 log.u_bbr.epoch = nreno->css_current_round;
157 log.u_bbr.timeStamp = tcp_get_usecs(&tv);
159 log.u_bbr.pkts_out = nreno->css_last_fas;
160 log.u_bbr.delivered = nreno->css_lowrtt_fas;
161 log.u_bbr.pkt_epoch = ccv->flags;
162 TCP_LOG_EVENTP(tp, NULL,
163 &tp->t_inpcb->inp_socket->so_rcv,
164 &tp->t_inpcb->inp_socket->so_snd,
165 TCP_HYSTART, 0,
166 0, &log, false, &tv);
167 }
168}
169
170static size_t
172{
173 return (sizeof(struct newreno));
174}
175
176static int
177newreno_cb_init(struct cc_var *ccv, void *ptr)
178{
179 struct newreno *nreno;
180
182 if (ptr == NULL) {
183 ccv->cc_data = malloc(sizeof(struct newreno), M_CC_MEM, M_NOWAIT);
184 if (ccv->cc_data == NULL)
185 return (ENOMEM);
186 } else
187 ccv->cc_data = ptr;
188 nreno = (struct newreno *)ccv->cc_data;
189 /* NB: nreno is not zeroed, so initialise all fields. */
190 nreno->beta = V_newreno_beta;
192 /*
193 * We set the enabled flag so that if
194 * the socket option gets strobed and
195 * we have not hit a loss
196 */
198 /* At init set both to infinity */
199 nreno->css_lastround_minrtt = 0xffffffff;
200 nreno->css_current_round_minrtt = 0xffffffff;
201 nreno->css_current_round = 0;
202 nreno->css_baseline_minrtt = 0xffffffff;
203 nreno->css_rttsample_count = 0;
204 nreno->css_entered_at_round = 0;
205 nreno->css_fas_at_css_entry = 0;
206 nreno->css_lowrtt_fas = 0;
207 nreno->css_last_fas = 0;
208 return (0);
209}
210
211static void
213{
214 free(ccv->cc_data, M_CC_MEM);
215}
216
217static void
219{
220 struct newreno *nreno;
221
222 nreno = ccv->cc_data;
223 if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) &&
224 (ccv->flags & CCF_CWND_LIMITED)) {
225 u_int cw = CCV(ccv, snd_cwnd);
226 u_int incr = CCV(ccv, t_maxseg);
227
228 /*
229 * Regular in-order ACK, open the congestion window.
230 * Method depends on which congestion control state we're
231 * in (slow start or cong avoid) and if ABC (RFC 3465) is
232 * enabled.
233 *
234 * slow start: cwnd <= ssthresh
235 * cong avoid: cwnd > ssthresh
236 *
237 * slow start and ABC (RFC 3465):
238 * Grow cwnd exponentially by the amount of data
239 * ACKed capping the max increment per ACK to
240 * (abc_l_var * maxseg) bytes.
241 *
242 * slow start without ABC (RFC 5681):
243 * Grow cwnd exponentially by maxseg per ACK.
244 *
245 * cong avoid and ABC (RFC 3465):
246 * Grow cwnd linearly by maxseg per RTT for each
247 * cwnd worth of ACKed data.
248 *
249 * cong avoid without ABC (RFC 5681):
250 * Grow cwnd linearly by approximately maxseg per RTT using
251 * maxseg^2 / cwnd per ACK as the increment.
252 * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to
253 * avoid capping cwnd.
254 */
255 if (cw > CCV(ccv, snd_ssthresh)) {
257 /*
258 * We have slipped into CA with
259 * CSS active. Deactivate all.
260 */
261 /* Turn off the CSS flag */
262 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
263 /* Disable use of CSS in the future except long idle */
264 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED;
265 newreno_log_hystart_event(ccv, nreno, 11, CCV(ccv, snd_ssthresh));
266 }
267 if (V_tcp_do_rfc3465) {
268 if (ccv->flags & CCF_ABC_SENTAWND)
269 ccv->flags &= ~CCF_ABC_SENTAWND;
270 else
271 incr = 0;
272 } else
273 incr = max((incr * incr / cw), 1);
274 } else if (V_tcp_do_rfc3465) {
275 /*
276 * In slow-start with ABC enabled and no RTO in sight?
277 * (Must not use abc_l_var > 1 if slow starting after
278 * an RTO. On RTO, snd_nxt = snd_una, so the
279 * snd_nxt == snd_max check is sufficient to
280 * handle this).
281 *
282 * XXXLAS: Find a way to signal SS after RTO that
283 * doesn't rely on tcpcb vars.
284 */
285 uint16_t abc_val;
286
287 if (ccv->flags & CCF_USE_LOCAL_ABC)
288 abc_val = ccv->labc;
289 else
290 abc_val = V_tcp_abc_l_var;
291 if ((ccv->flags & CCF_HYSTART_ALLOWED) &&
293 ((nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) == 0)) {
294 /*
295 * Hystart is allowed and still enabled and we are not yet
296 * in CSS. Lets check to see if we can make a decision on
297 * if we need to go into CSS.
298 */
300 (nreno->css_current_round_minrtt != 0xffffffff) &&
301 (nreno->css_lastround_minrtt != 0xffffffff)) {
302 uint32_t rtt_thresh;
303
304 /* Clamp (minrtt_thresh, lastround/8, maxrtt_thresh) */
305 rtt_thresh = (nreno->css_lastround_minrtt >> 3);
306 if (rtt_thresh < hystart_minrtt_thresh)
307 rtt_thresh = hystart_minrtt_thresh;
308 if (rtt_thresh > hystart_maxrtt_thresh)
309 rtt_thresh = hystart_maxrtt_thresh;
310 newreno_log_hystart_event(ccv, nreno, 1, rtt_thresh);
311 if (nreno->css_current_round_minrtt >= (nreno->css_lastround_minrtt + rtt_thresh)) {
312 /* Enter CSS */
314 nreno->css_fas_at_css_entry = nreno->css_lowrtt_fas;
315 /*
316 * The draft (v4) calls for us to set baseline to css_current_round_min
317 * but that can cause an oscillation. We probably shoudl be using
318 * css_lastround_minrtt, but the authors insist that will cause
319 * issues on exiting early. We will leave the draft version for now
320 * but I suspect this is incorrect.
321 */
324 newreno_log_hystart_event(ccv, nreno, 2, rtt_thresh);
325 }
326 }
327 }
328 if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max))
329 incr = min(ccv->bytes_this_ack,
330 ccv->nsegs * abc_val *
331 CCV(ccv, t_maxseg));
332 else
333 incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg));
334
335 /* Only if Hystart is enabled will the flag get set */
338 newreno_log_hystart_event(ccv, nreno, 3, incr);
339 }
340 }
341 /* ABC is on by default, so incr equals 0 frequently. */
342 if (incr > 0)
343 CCV(ccv, snd_cwnd) = min(cw + incr,
344 TCP_MAXWIN << CCV(ccv, snd_scale));
345 }
346}
347
348static void
350{
351 struct newreno *nreno;
352
353 nreno = ccv->cc_data;
355 if ((nreno->newreno_flags & CC_NEWRENO_HYSTART_ENABLED) == 0) {
356 /*
357 * Re-enable hystart if we have been idle.
358 */
359 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
361 newreno_log_hystart_event(ccv, nreno, 12, CCV(ccv, snd_ssthresh));
362 }
363}
364
365/*
366 * Perform any necessary tasks before we enter congestion recovery.
367 */
368static void
370{
371 struct newreno *nreno;
372 uint32_t beta, beta_ecn, cwin, factor;
373 u_int mss;
374
375 cwin = CCV(ccv, snd_cwnd);
376 mss = tcp_fixed_maxseg(ccv->ccvc.tcp);
377 nreno = ccv->cc_data;
378 beta = (nreno == NULL) ? V_newreno_beta : nreno->beta;;
379 beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn;
380 /*
381 * Note that we only change the backoff for ECN if the
382 * global sysctl V_cc_do_abe is set <or> the stack itself
383 * has set a flag in our newreno_flags (due to pacing) telling
384 * us to use the lower valued back-off.
385 */
386 if ((type == CC_ECN) &&
387 (V_cc_do_abe ||
388 ((nreno != NULL) && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN_ENABLED))))
389 factor = beta_ecn;
390 else
391 factor = beta;
392
393 /* Catch algos which mistakenly leak private signal types. */
394 KASSERT((type & CC_SIGPRIVMASK) == 0,
395 ("%s: congestion signal type 0x%08x is private\n", __func__, type));
396
397 cwin = max(((uint64_t)cwin * (uint64_t)factor) / (100ULL * (uint64_t)mss),
398 2) * mss;
399
400 switch (type) {
401 case CC_NDUPACK:
403 /* Make sure the flags are all off we had a loss */
404 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED;
405 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
406 newreno_log_hystart_event(ccv, nreno, 10, CCV(ccv, snd_ssthresh));
407 }
408 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
409 if (IN_CONGRECOVERY(CCV(ccv, t_flags) &&
411 CCV(ccv, snd_ssthresh) =
412 ((uint64_t)CCV(ccv, snd_ssthresh) *
413 (uint64_t)beta) / (uint64_t)beta_ecn;
414 }
415 if (!IN_CONGRECOVERY(CCV(ccv, t_flags)))
416 CCV(ccv, snd_ssthresh) = cwin;
417 ENTER_RECOVERY(CCV(ccv, t_flags));
418 }
419 break;
420 case CC_ECN:
422 /* Make sure the flags are all off we had a loss */
423 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED;
424 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
425 newreno_log_hystart_event(ccv, nreno, 9, CCV(ccv, snd_ssthresh));
426 }
427 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
428 CCV(ccv, snd_ssthresh) = cwin;
429 CCV(ccv, snd_cwnd) = cwin;
430 ENTER_CONGRECOVERY(CCV(ccv, t_flags));
431 }
432 break;
433 case CC_RTO:
434 CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd),
435 CCV(ccv, snd_cwnd)) / 2 / mss,
436 2) * mss;
437 CCV(ccv, snd_cwnd) = mss;
438 break;
439 }
440}
441
442static int
443newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf)
444{
445 struct newreno *nreno;
446 struct cc_newreno_opts *opt;
447
448 if (sopt->sopt_valsize != sizeof(struct cc_newreno_opts))
449 return (EMSGSIZE);
450
451 if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo)
452 return (ENOPROTOOPT);
453
454 nreno = (struct newreno *)ccv->cc_data;
455 opt = buf;
456 switch (sopt->sopt_dir) {
457 case SOPT_SET:
458 switch (opt->name) {
459 case CC_NEWRENO_BETA:
460 nreno->beta = opt->val;
461 break;
463 if ((!V_cc_do_abe) && ((nreno->newreno_flags & CC_NEWRENO_BETA_ECN) == 0))
464 return (EACCES);
465 nreno->beta_ecn = opt->val;
467 break;
468 default:
469 return (ENOPROTOOPT);
470 }
471 break;
472 case SOPT_GET:
473 switch (opt->name) {
474 case CC_NEWRENO_BETA:
475 opt->val = (nreno == NULL) ?
476 V_newreno_beta : nreno->beta;
477 break;
479 opt->val = (nreno == NULL) ?
481 break;
482 default:
483 return (ENOPROTOOPT);
484 }
485 break;
486 default:
487 return (EINVAL);
488 }
489
490 return (0);
491}
492
493static int
494newreno_beta_handler(SYSCTL_HANDLER_ARGS)
495{
496 int error;
497 uint32_t new;
498
499 new = *(uint32_t *)arg1;
500 error = sysctl_handle_int(oidp, &new, 0, req);
501 if (error == 0 && req->newptr != NULL ) {
502 if (arg1 == &VNET_NAME(newreno_beta_ecn) && !V_cc_do_abe)
503 error = EACCES;
504 else if (new == 0 || new > 100)
505 error = EINVAL;
506 else
507 *(uint32_t *)arg1 = new;
508 }
509
510 return (error);
511}
512
513static void
514newreno_newround(struct cc_var *ccv, uint32_t round_cnt)
515{
516 struct newreno *nreno;
517
518 nreno = (struct newreno *)ccv->cc_data;
519 /* We have entered a new round */
521 nreno->css_current_round_minrtt = 0xffffffff;
522 nreno->css_rttsample_count = 0;
523 nreno->css_current_round = round_cnt;
525 ((round_cnt - nreno->css_entered_at_round) >= hystart_css_rounds)) {
526 /* Enter CA */
527 if (ccv->flags & CCF_HYSTART_CAN_SH_CWND) {
528 /*
529 * We engage more than snd_ssthresh, engage
530 * the brakes!! Though we will stay in SS to
531 * creep back up again, so lets leave CSS active
532 * and give us hystart_css_rounds more rounds.
533 */
534 if (ccv->flags & CCF_HYSTART_CONS_SSTH) {
535 CCV(ccv, snd_ssthresh) = ((nreno->css_lowrtt_fas + nreno->css_fas_at_css_entry) / 2);
536 } else {
537 CCV(ccv, snd_ssthresh) = nreno->css_lowrtt_fas;
538 }
539 CCV(ccv, snd_cwnd) = nreno->css_fas_at_css_entry;
540 nreno->css_entered_at_round = round_cnt;
541 } else {
542 CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd);
543 /* Turn off the CSS flag */
544 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
545 /* Disable use of CSS in the future except long idle */
546 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED;
547 }
548 newreno_log_hystart_event(ccv, nreno, 6, CCV(ccv, snd_ssthresh));
549 }
551 newreno_log_hystart_event(ccv, nreno, 4, round_cnt);
552}
553
554static void
555newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas)
556{
557 struct newreno *nreno;
558
559 nreno = (struct newreno *)ccv->cc_data;
560 if (rxtcnt > 1) {
561 /*
562 * Only look at RTT's that are non-ambiguous.
563 */
564 return;
565 }
566 nreno->css_rttsample_count++;
567 nreno->css_last_fas = fas;
568 if (nreno->css_current_round_minrtt > usec_rtt) {
569 nreno->css_current_round_minrtt = usec_rtt;
570 nreno->css_lowrtt_fas = nreno->css_last_fas;
571 }
573 (nreno->css_current_round_minrtt != 0xffffffff) &&
574 (nreno->css_lastround_minrtt != 0xffffffff)) {
575 /*
576 * We were in CSS and the RTT is now less, we
577 * entered CSS erroneously.
578 */
579 nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS;
580 newreno_log_hystart_event(ccv, nreno, 8, nreno->css_baseline_minrtt);
581 nreno->css_baseline_minrtt = 0xffffffff;
582 }
584 newreno_log_hystart_event(ccv, nreno, 5, usec_rtt);
585}
586
587SYSCTL_DECL(_net_inet_tcp_cc_newreno);
588SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno,
589 CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
590 "New Reno related settings");
591
592SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta,
593 CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
594 &VNET_NAME(newreno_beta), 3, &newreno_beta_handler, "IU",
595 "New Reno beta, specified as number between 1 and 100");
596
597SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_ecn,
598 CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
599 &VNET_NAME(newreno_beta_ecn), 3, &newreno_beta_handler, "IU",
600 "New Reno beta ecn, specified as number between 1 and 100");
601
uint32_t hystart_css_growth_div
Definition: cc.c:90
uint32_t hystart_maxrtt_thresh
Definition: cc.c:88
uint32_t hystart_css_rounds
Definition: cc.c:91
void newreno_cc_post_recovery(struct cc_var *ccv)
Definition: cc.c:384
uint32_t hystart_bblogs
Definition: cc.c:92
uint32_t hystart_minrtt_thresh
Definition: cc.c:87
uint32_t hystart_n_rttsamples
Definition: cc.c:89
void newreno_cc_after_idle(struct cc_var *ccv)
Definition: cc.c:415
#define CC_NDUPACK
Definition: cc.h:137
#define CCF_CWND_LIMITED
Definition: cc.h:109
#define V_cc_abe_frlossreduce
Definition: cc.h:70
#define V_cc_do_abe
Definition: cc.h:67
#define CCF_USE_LOCAL_ABC
Definition: cc.h:110
#define CC_ECN
Definition: cc.h:134
#define CCF_HYSTART_CAN_SH_CWND
Definition: cc.h:119
#define CCF_HYSTART_ALLOWED
Definition: cc.h:118
#define CC_ALGO(tp)
Definition: cc.h:210
#define CCF_ABC_SENTAWND
Definition: cc.h:108
#define CC_ACK
Definition: cc.h:123
#define CC_SIGPRIVMASK
Definition: cc.h:139
#define CC_RTO
Definition: cc.h:135
#define CCF_HYSTART_CONS_SSTH
Definition: cc.h:120
#define CCV(ccv, what)
Definition: cc_module.h:59
static void newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod, uint32_t flex1)
Definition: cc_newreno.c:120
static int newreno_cb_init(struct cc_var *ccv, void *)
Definition: cc_newreno.c:177
#define V_newreno_beta
Definition: cc_newreno.c:101
static void newreno_ack_received(struct cc_var *ccv, uint16_t type)
Definition: cc_newreno.c:218
static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf)
Definition: cc_newreno.c:443
VNET_DECLARE(uint32_t, newreno_beta)
SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta, CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &VNET_NAME(newreno_beta), 3, &newreno_beta_handler, "IU", "New Reno beta, specified as number between 1 and 100")
struct cc_algo newreno_cc_algo
Definition: cc_newreno.c:105
static void newreno_cb_destroy(struct cc_var *ccv)
Definition: cc_newreno.c:212
static size_t newreno_data_sz(void)
Definition: cc_newreno.c:171
__FBSDID("$FreeBSD$")
DECLARE_CC_MODULE(newreno, &newreno_cc_algo)
SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno, CTLFLAG_RW|CTLFLAG_MPSAFE, NULL, "New Reno related settings")
static void newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas)
Definition: cc_newreno.c:555
static void newreno_newround(struct cc_var *ccv, uint32_t round_cnt)
Definition: cc_newreno.c:514
VNET_DEFINE(uint32_t, newreno_beta_ecn)
SYSCTL_DECL(_net_inet_tcp_cc_newreno)
static void newreno_after_idle(struct cc_var *ccv)
Definition: cc_newreno.c:349
static int newreno_beta_handler(SYSCTL_HANDLER_ARGS)
Definition: cc_newreno.c:494
#define V_newreno_beta_ecn
Definition: cc_newreno.c:103
static void newreno_cong_signal(struct cc_var *ccv, uint32_t type)
Definition: cc_newreno.c:369
MODULE_VERSION(newreno, 2)
#define CC_NEWRENO_HYSTART_ENABLED
Definition: cc_newreno.h:58
#define CC_NEWRENO_HYSTART_IN_CSS
Definition: cc_newreno.h:59
#define CC_NEWRENO_BETA
Definition: cc_newreno.h:54
#define CC_NEWRENO_BETA_ECN
Definition: cc_newreno.h:55
#define CC_NEWRENO_BETA_ECN_ENABLED
Definition: cc_newreno.h:60
__uint32_t uint32_t
Definition: in.h:62
__uint16_t uint16_t
Definition: in.h:57
__uint8_t uint8_t
Definition: in.h:52
#define INP_WLOCK_ASSERT(inp)
Definition: in_pcb.h:529
Definition: cc.h:146
char name[TCP_CA_NAME_MAX]
Definition: cc.h:147
uint32_t val
Definition: cc_newreno.h:51
Definition: cc.h:93
union cc_var::ccv_container ccvc
void * cc_data
Definition: cc.h:94
int bytes_this_ack
Definition: cc.h:95
uint8_t labc
Definition: cc.h:104
uint16_t nsegs
Definition: cc.h:103
uint32_t flags
Definition: cc.h:97
struct socket * inp_socket
Definition: in_pcb.h:254
uint32_t css_current_round
Definition: cc_newreno.h:43
uint32_t css_lastround_minrtt
Definition: cc_newreno.h:40
uint32_t newreno_flags
Definition: cc_newreno.h:37
uint32_t css_last_fas
Definition: cc_newreno.h:46
uint32_t css_baseline_minrtt
Definition: cc_newreno.h:38
uint32_t beta
Definition: cc_newreno.h:35
uint32_t css_fas_at_css_entry
Definition: cc_newreno.h:44
uint32_t css_lowrtt_fas
Definition: cc_newreno.h:45
uint32_t beta_ecn
Definition: cc_newreno.h:36
uint32_t css_current_round_minrtt
Definition: cc_newreno.h:39
uint32_t css_rttsample_count
Definition: cc_newreno.h:41
uint32_t css_entered_at_round
Definition: cc_newreno.h:42
uint32_t flex3
Definition: tcp_log_buf.h:87
uint32_t timeStamp
Definition: tcp_log_buf.h:81
uint32_t flex5
Definition: tcp_log_buf.h:89
uint32_t lt_epoch
Definition: tcp_log_buf.h:83
uint32_t flex2
Definition: tcp_log_buf.h:86
uint32_t pkt_epoch
Definition: tcp_log_buf.h:101
uint32_t flex4
Definition: tcp_log_buf.h:88
uint32_t flex1
Definition: tcp_log_buf.h:85
uint16_t flex7
Definition: tcp_log_buf.h:94
uint32_t flex6
Definition: tcp_log_buf.h:90
uint32_t pkts_out
Definition: tcp_log_buf.h:84
uint32_t delivered
Definition: tcp_log_buf.h:80
uint8_t flex8
Definition: tcp_log_buf.h:100
uint32_t epoch
Definition: tcp_log_buf.h:82
Definition: tcp_var.h:132
uint32_t t_logstate
Definition: tcp_var.h:138
struct cc_var * ccv
Definition: tcp_var.h:241
struct inpcb * t_inpcb
Definition: tcp_var.h:134
static __inline uint32_t tcp_get_usecs(struct timeval *tv)
Definition: tcp_hpts.h:198
@ TCP_LOG_STATE_OFF
Definition: tcp_log_buf.h:244
#define TCP_LOG_EVENTP(tp, th, rxbuf, txbuf, eventid, errornum, len, stackinfo, th_hostorder, tv)
Definition: tcp_log_buf.h:346
@ TCP_HYSTART
Definition: tcp_log_buf.h:238
u_int tcp_fixed_maxseg(const struct tcpcb *tp)
Definition: tcp_subr.c:3587
#define IN_CONGRECOVERY(t_flags)
Definition: tcp_var.h:534
#define IN_FASTRECOVERY(t_flags)
Definition: tcp_var.h:530
#define IN_RECOVERY(t_flags)
Definition: tcp_var.h:538
#define ENTER_RECOVERY(t_flags)
Definition: tcp_var.h:539
#define V_tcp_do_rfc3465
Definition: tcp_var.h:1044
#define ENTER_CONGRECOVERY(t_flags)
Definition: tcp_var.h:535
#define V_tcp_abc_l_var
Definition: tcp_var.h:1031
struct tcpcb * tcp
Definition: cc.h:100
struct tcp_log_bbr u_bbr
Definition: tcp_log_buf.h:108