Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jan 2011 21:05:22 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218039 - head/sys/netinet
Message-ID:  <201101282105.p0SL5MHZ000167@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Fri Jan 28 21:05:21 2011
New Revision: 218039
URL: http://svn.freebsd.org/changeset/base/218039

Log:
  Keep track of the real last RTT on each net.
  This will be used for Data Center congestion
  control, we won't want to engage it in the
  ECN code unless we KNOW that the RTT is less
  than 500us.
  
  MFC after:	1 week

Modified:
  head/sys/netinet/sctp_structs.h
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_structs.h
==============================================================================
--- head/sys/netinet/sctp_structs.h	Fri Jan 28 21:03:32 2011	(r218038)
+++ head/sys/netinet/sctp_structs.h	Fri Jan 28 21:05:21 2011	(r218039)
@@ -266,7 +266,7 @@ struct sctp_nets {
 	uint32_t tos_flowlabel;
 
 	struct timeval start_time;	/* time when this net was created */
-
+	struct timeval last_measured_rtt;
 	uint32_t marked_retrans;/* number or DATA chunks marked for timer
 				 * based retransmissions */
 	uint32_t marked_fastretrans;

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Fri Jan 28 21:03:32 2011	(r218038)
+++ head/sys/netinet/sctputil.c	Fri Jan 28 21:05:21 2011	(r218039)
@@ -2500,6 +2500,13 @@ sctp_calculate_rto(struct sctp_tcb *stcb
 	/************************/
 	/* get the current time */
 	(void)SCTP_GETTIME_TIMEVAL(&now);
+
+	/*
+	 * Record the real time of the last RTT for use in DC-CC.
+	 */
+	net->last_measured_rtt = now;
+	timevalsub(&net->last_measured_rtt, old);
+
 	/* compute the RTT value */
 	if ((u_long)now.tv_sec > (u_long)old->tv_sec) {
 		calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101282105.p0SL5MHZ000167>