From owner-svn-src-head@FreeBSD.ORG Wed Dec 22 19:04:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D161065679; Wed, 22 Dec 2010 19:04:14 +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 BE00F8FC1D; Wed, 22 Dec 2010 19:04:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBMJ4EgS031932; Wed, 22 Dec 2010 19:04:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBMJ4Ep9031929; Wed, 22 Dec 2010 19:04:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012221904.oBMJ4Ep9031929@svn.freebsd.org> From: Michael Tuexen Date: Wed, 22 Dec 2010 19:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216672 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 22 Dec 2010 19:04:15 -0000 Author: tuexen Date: Wed Dec 22 19:04:14 2010 New Revision: 216672 URL: http://svn.freebsd.org/changeset/base/216672 Log: Provide a possibility to configure the inital congestion window to the value defined in RFC 4960. MFC after: 3 months. Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Dec 22 19:01:48 2010 (r216671) +++ head/sys/netinet/sctp_cc_functions.c Wed Dec 22 19:04:14 2010 (r216672) @@ -53,15 +53,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; SDT_PROBE(sctp, cwnd, net, init, Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Wed Dec 22 19:01:48 2010 (r216671) +++ head/sys/netinet/sctp_sysctl.h Wed Dec 22 19:04:14 2010 (r216672) @@ -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