summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2011-01-28 21:05:21 +0000
committerrrs <rrs@FreeBSD.org>2011-01-28 21:05:21 +0000
commitf218f28d16e190f3b25a10dd8764440ba9110c42 (patch)
tree1139cb5cb785414e3e0feb9a0e84626e43b550c1 /sys/netinet
parent747546166f1055f5d23ef661fbc30e355f1d6fec (diff)
downloadFreeBSD-src-f218f28d16e190f3b25a10dd8764440ba9110c42.zip
FreeBSD-src-f218f28d16e190f3b25a10dd8764440ba9110c42.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_structs.h2
-rw-r--r--sys/netinet/sctputil.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h
index be2c213..62326be 100644
--- a/sys/netinet/sctp_structs.h
+++ b/sys/netinet/sctp_structs.h
@@ -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;
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 6e01627..617494c 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -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;
OpenPOWER on IntegriCloud