Home | History | Annotate | Download | only in netinet
History log of /src/sys/netinet/tcp_congctl.c
RevisionDateAuthorComments
 1.29  14-May-2024  andvar fix recently committed typos by msaitoh in few more places, as well as few more.
mainly s/contigous/contiguous/ and s/miliseconds/milliseconds/ in comments.
 1.28  31-Jul-2021  andvar s/threshhold/threshold
 1.27  09-Oct-2019  msaitoh branches: 1.27.12;
All of snd_wnd, snd_cwnd and snd_ssthresh in stuct tcpcb are u_long,
so use u_long and ulmin() instead of u_int and uimin(). Found by lgtm bot.

XXX TCP's sequence number is uint32_t, so it might be good to change some
entries in struct tcpcb to uint32_t instead of u_long. FreeBSD did it.
 1.26  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.25  03-May-2018  maxv branches: 1.25.2;
Remove now unused tcpip.h includes. Some were already unused before.
 1.24  29-Mar-2018  maxv Remove #ifdef INET. Same as tcp_input.c. Makes the code easier to
understand.

Also make tcp6_mtudisc() static in tcp_subr.c.
 1.23  02-Jan-2017  skrll branches: 1.23.14;
Restore behaviour to pre- tcp_congctl.c:1.18 for SACK. Further analysis
of the change is required.

OK kefren@

PR/51753 tcp SACK causes SSH disconnect
 1.22  13-Dec-2016  ozaki-r Remove unnecessary inclusions of nd6.h
 1.21  26-Apr-2016  ozaki-r branches: 1.21.2;
Sweep unnecessary route.h inclusions
 1.20  24-Aug-2015  pooka sprinkle _KERNEL_OPT
 1.19  18-Nov-2013  kefren branches: 1.19.4; 1.19.6; 1.19.8; 1.19.10;
Cubic changes:
* correct W(t) calculation
* check wmax limits
* change W_max in slow and fast retransmit
* correct rtt approximation
Reno:
* move comment I forgot behind after fast_retransmit() split
 1.18  12-Nov-2013  kefren * implement TCP CUBIC congestion control algorithm
* move tcp_sack_newack bits inside reno and newreno_fast_retransmit_newack
* notify ECN peer about cwnd shrink in [new]reno_slow_retransmit

Based on the patch proposed on tech-net@ on Nov 7 with minor improvments:
* adapt wmax for no-fast convergence case
* correct cbrt calculation for big window sizes (>750KB)
 1.17  25-Oct-2013  martin Mark a diagnostic-only variable
 1.16  08-Apr-2011  yamt branches: 1.16.4; 1.16.14; 1.16.18;
simplify code a little. no functional changes.
 1.15  28-Apr-2008  martin branches: 1.15.22; 1.15.28;
Remove clause 3 and 4 from TNF licenses
 1.14  29-Feb-2008  matt branches: 1.14.2; 1.14.4;
Rework tcp congctl selection code so that the congctl entries can be const.
Don't access tcp_congctl stuff outside of tcp_congctl.c, use routines to
update t_congctl. This code is slightly now more complicated.
 1.13  11-Jul-2007  xtraeme branches: 1.13.8; 1.13.24; 1.13.28;
Replace a simple lock with a mutex and make it static.
 1.12  16-Nov-2006  christos branches: 1.12.2; 1.12.6; 1.12.12;
__unused removal on arguments; approved by core.
 1.11  21-Oct-2006  yamt branches: 1.11.2;
constify.
 1.10  19-Oct-2006  yamt tcp_reno_newack: remove an __unused because it's now used.
 1.9  19-Oct-2006  yamt tcp_reno_newack: regardless of sysctl setting, use L=1*SMSS when
we are doing retransmission.
 1.8  19-Oct-2006  yamt implement RFC3465 appropriate byte counting.
from Kentaro A. Kurahone, with minor adjustments by me.
the ack prediction part of the original patch was omitted because
it's a separate change. reviewed by Rui Paulo.
 1.7  15-Oct-2006  rpaulo Move comments to proper places.
 1.6  15-Oct-2006  rpaulo Add a new tcp_congctl(9) structure member for congestion experienced callback.
Needed by HSTCP.
 1.5  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.4  10-Oct-2006  rpaulo tcp_reno_newack(): bring the exact original code.
tcp_newreno_newack(): call tcp_reno_newack() if partialacks < 0.
 1.3  10-Oct-2006  yamt tcp_reno_newack/tcp_newreno_newack: remove stale comments.
 1.2  10-Oct-2006  yamt tcp_newreno_newack: actually inflate cwnd as it used to do.
 1.1  09-Oct-2006  rpaulo Modular (I tried ;-) TCP congestion control API. Whenever certain conditions
happen in the TCP stack, this interface calls the specified callback to
handle the situation according to the currently selected congestion
control algorithm.
A new sysctl node was created: net.inet.tcp.congctl.{available,selected}
with obvious meanings.
The old net.inet.tcp.newreno MIB was removed.
The API is discussed in tcp_congctl(9).

In the near future, it will be possible to selected a congestion control
algorithm on a per-socket basis.

Discussed on tech-net and reviewed by <yamt>.
 1.11.2.3  10-Dec-2006  yamt sync with head.
 1.11.2.2  22-Oct-2006  yamt sync with head
 1.11.2.1  21-Oct-2006  yamt file tcp_congctl.c was added on branch yamt-splraiseipl on 2006-10-22 06:07:28 +0000
 1.12.12.1  15-Jul-2007  ad Sync with head.
 1.12.6.4  17-Mar-2008  yamt sync with head.
 1.12.6.3  03-Sep-2007  yamt sync with head.
 1.12.6.2  30-Dec-2006  yamt sync with head.
 1.12.6.1  16-Nov-2006  yamt file tcp_congctl.c was added on branch yamt-lazymbuf on 2006-12-30 20:50:33 +0000
 1.12.2.2  18-Nov-2006  ad Sync with head.
 1.12.2.1  16-Nov-2006  ad file tcp_congctl.c was added on branch newlock2 on 2006-11-18 21:39:36 +0000
 1.13.28.2  02-Jun-2008  mjf Sync with HEAD.
 1.13.28.1  03-Apr-2008  mjf Sync with HEAD.
 1.13.24.1  24-Mar-2008  keiichi sync with head.
 1.13.8.1  23-Mar-2008  matt sync with HEAD
 1.14.4.1  16-May-2008  yamt sync with head.
 1.14.2.1  18-May-2008  yamt sync with head.
 1.15.28.1  06-Jun-2011  jruoho Sync with HEAD.
 1.15.22.1  21-Apr-2011  rmind sync with head
 1.16.18.1  18-May-2014  rmind sync with head
 1.16.14.2  03-Dec-2017  jdolecek update from HEAD
 1.16.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.10.1  18-Jan-2017  skrll Sync with netbsd-5
 1.19.8.1  05-Jan-2017  martin Pull up following revision(s) (requested by skrll in ticket #1347):
sys/netinet/tcp_congctl.c: revision 1.23
Restore behaviour to pre- tcp_congctl.c:1.18 for SACK. Further analysis
of the change is required.
OK kefren@
PR/51753 tcp SACK causes SSH disconnect
 1.19.6.3  05-Feb-2017  skrll Sync with HEAD
 1.19.6.2  29-May-2016  skrll Sync with HEAD
 1.19.6.1  22-Sep-2015  skrll Sync with HEAD
 1.19.4.1  05-Jan-2017  martin Pull up following revision(s) (requested by skrll in ticket #1347):
sys/netinet/tcp_congctl.c: revision 1.23
Restore behaviour to pre- tcp_congctl.c:1.18 for SACK. Further analysis
of the change is required.
OK kefren@
PR/51753 tcp SACK causes SSH disconnect
 1.21.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.23.14.3  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.23.14.2  21-May-2018  pgoyette Sync with HEAD
 1.23.14.1  30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.25.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.25.2.1  10-Jun-2019  christos Sync with HEAD
 1.27.12.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed