diff options
author | Paul Winder <paul@winders.demon.co.uk> | 2020-04-21 10:13:47 +0100 |
---|---|---|
committer | Paul Winder <paul@winders.demon.co.uk> | 2020-04-24 08:09:39 +0100 |
commit | f1ee6ec32e6dc51b77619a27816d945ad64a5378 (patch) | |
tree | b4344a37f23d0d3e5f8adb1cc690696991a91349 /usr/src/uts/common/inet/cc | |
parent | 3b0b0a4e9ef34199357e064b48f2dd2e9ff1c9a2 (diff) | |
download | illumos-gate-f1ee6ec32e6dc51b77619a27816d945ad64a5378.tar.gz |
12581 sockets using cubic congestion control can block
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/inet/cc')
-rw-r--r-- | usr/src/uts/common/inet/cc/cc_cubic.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr/src/uts/common/inet/cc/cc_cubic.c b/usr/src/uts/common/inet/cc/cc_cubic.c index 6071409e30..bb26a2358d 100644 --- a/usr/src/uts/common/inet/cc/cc_cubic.c +++ b/usr/src/uts/common/inet/cc/cc_cubic.c @@ -265,7 +265,7 @@ cubic_cb_init(struct cc_var *ccv) { struct cubic *cubic_data; - cubic_data = kmem_alloc(sizeof (struct cubic), KM_NOSLEEP); + cubic_data = kmem_zalloc(sizeof (struct cubic), KM_NOSLEEP); if (cubic_data == NULL) return (ENOMEM); @@ -368,6 +368,15 @@ cubic_post_recovery(struct cc_var *ccv) >> CUBIC_SHIFT; } + /* + * There is a risk that if the cwnd becomes less than mss, and + * we do not get enough acks to drive it back up beyond mss, + * we will stop transmitting data altogether. + * + * The Cubic RFC defines values in terms of units of mss. Therefore + * we must make sure we have at least 1 mss to make progress + * since the algorthm is written that way. + */ mss = CCV(ccv, tcp_mss); if (IN_FASTRECOVERY(ccv->flags)) { @@ -385,9 +394,11 @@ cubic_post_recovery(struct cc_var *ccv) CCV(ccv, tcp_cwnd) = MAX(pipe, mss) + mss; } else { /* Update cwnd based on beta and adjusted max_cwnd. */ - CCV(ccv, tcp_cwnd) = max(1, ((CUBIC_BETA * + CCV(ccv, tcp_cwnd) = max(mss, ((CUBIC_BETA * cubic_data->max_cwnd) >> CUBIC_SHIFT)); } + } else { + CCV(ccv, tcp_cwnd) = max(mss, CCV(ccv, tcp_cwnd)); } cubic_data->t_last_cong = gethrtime(); |