From owner-svn-src-stable@FreeBSD.ORG Fri Feb 10 07:21:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B490106564A; Fri, 10 Feb 2012 07:21:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F350E8FC08; Fri, 10 Feb 2012 07:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A7LTIp059664; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7LTQt059661; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100721.q1A7LTQt059661@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231353 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:21:30 -0000 Author: tuexen Date: Fri Feb 10 07:21:29 2012 New Revision: 231353 URL: http://svn.freebsd.org/changeset/base/231353 Log: MFC r216672: Provide a possibility to configure the inital congestion window to the value defined in RFC 4960. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:21:29 2012 (r231353) @@ -52,15 +52,19 @@ sctp_set_initial_cc_param(struct sctp_tc uint32_t cwnd_in_mtu; assoc = &stcb->asoc; - /* - * We take the minimum of the burst limit and the initial congestion - * window. The initial congestion window is at least two times the - * MTU. - */ cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); - if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) - cwnd_in_mtu = assoc->max_burst; - net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + if (cwnd_in_mtu == 0) { + /* Using 0 means that the value of RFC 4960 is used. */ + net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit and the initial + * congestion window. + */ + if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) + cwnd_in_mtu = assoc->max_burst; + net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } net->ssthresh = assoc->peers_rwnd; if (SCTP_BASE_SYSCTL(sctp_logging_level) & Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:21:29 2012 (r231353) @@ -500,7 +500,7 @@ struct sctp_sysctl { /* Initial congestion window in MTU */ #define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" -#define SCTPCTL_INITIAL_CWND_MIN 1 +#define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3