From owner-svn-src-head@freebsd.org Sat Nov 16 11:37:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1714A1C2BCE; Sat, 16 Nov 2019 11:37:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47FY9L4gPyz3Bw1; Sat, 16 Nov 2019 11:37:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 844C4C97; Sat, 16 Nov 2019 11:37:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAGBbQ9I094554; Sat, 16 Nov 2019 11:37:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAGBbQ2G094553; Sat, 16 Nov 2019 11:37:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201911161137.xAGBbQ2G094553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 16 Nov 2019 11:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354772 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 354772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Nov 2019 11:37:27 -0000 Author: tuexen Date: Sat Nov 16 11:37:26 2019 New Revision: 354772 URL: https://svnweb.freebsd.org/changeset/base/354772 Log: Implement a tCP CUBIC-specific after idle reaction. This patch addresses a very common case of frequent application stalls, where TCP runs idle and looses the state of the network. Submitted by: Richard Scheffenegger Reviewed by: Cheng Cui Differential Revision: https://reviews.freebsd.org/D18954 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Sat Nov 16 11:10:09 2019 (r354771) +++ head/sys/netinet/cc/cc_cubic.c Sat Nov 16 11:37:26 2019 (r354772) @@ -78,6 +78,7 @@ static int cubic_mod_init(void); static void cubic_post_recovery(struct cc_var *ccv); static void cubic_record_rtt(struct cc_var *ccv); static void cubic_ssthresh_update(struct cc_var *ccv); +static void cubic_after_idle(struct cc_var *ccv); struct cubic { /* Cubic K in fixed point form with CUBIC_SHIFT worth of precision. */ @@ -112,6 +113,7 @@ struct cc_algo cubic_cc_algo = { .conn_init = cubic_conn_init, .mod_init = cubic_mod_init, .post_recovery = cubic_post_recovery, + .after_idle = cubic_after_idle, }; static void @@ -192,7 +194,24 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) } } +/* + * This is a Cubic specific implementation of after_idle. + * - Reset cwnd by calling New Reno implementation of after_idle. + * - Reset t_last_cong. + */ static void +cubic_after_idle(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + newreno_cc_algo.after_idle(ccv); + cubic_data->t_last_cong = ticks; +} + + +static void cubic_cb_destroy(struct cc_var *ccv) { free(ccv->cc_data, M_CUBIC); @@ -287,9 +306,6 @@ cubic_conn_init(struct cc_var *ccv) static int cubic_mod_init(void) { - - cubic_cc_algo.after_idle = newreno_cc_algo.after_idle; - return (0); }