svn commit: r216672 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Wed Dec 22 19:04:15 UTC 2010
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
More information about the svn-src-head
mailing list