PERFORCE change 163464 for review

Fang Wang fangwang at FreeBSD.org
Thu Jun 4 03:19:25 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=163464

Change 163464 by fangwang at fangwang_utobsd on 2009/06/04 03:19:11

	Initialize tcpcb uto variables in tcp_newtcpcb.
	Add uto up limit and low limit global variables and relative macro defines.
	Initialize global uto variables in tcp_init.

Affected files ...

.. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_subr.c#2 edit
.. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_timer.c#2 edit
.. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_timer.h#2 edit

Differences ...

==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_subr.c#2 (text+ko) ====

@@ -403,6 +403,8 @@
 	tcp_rexmit_slop = TCPTV_CPU_VAR;
 	tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
 	tcp_tcbhashsize = hashsize;
+	tcp_uto_min = TCPTV_UTOMIN;
+	tcp_uto_max = TCPTV_UTOMAX;
 
 #ifdef INET6
 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr))
@@ -739,6 +741,14 @@
 	tp->t_rcvtime = ticks;
 	tp->t_bw_rtttime = ticks;
 	/*
+	 * Init TCP user timeout (RFC5482) variables. We don't use UTO by default,
+	 * but we make it available if a UTO request received or set it through
+	 * setsockopt system call.
+	 */
+	tp->uto_impl = 0;
+	tp->uto_changeable = 1;
+	tp->uto_enable = 1;
+	/*
 	 * IPv4 TTL initialization is necessary for an IPv6 socket as well,
 	 * because the socket may be bound to an IPv6 wildcard address,
 	 * which may match an IPv4-mapped IPv6 address.

==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_timer.c#2 (text+ko) ====

@@ -111,6 +111,12 @@
 SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW,
     &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout");
 
+int	tcp_uto_min;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, uto_min, CTLTYPE_INT|CTLFLAG_RW,
+    &tcp_uto_min, 0, sysctl_msec_to_ticks, "I", "Minimun user timeout");
+int	tcp_uto_max;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, uto_max, CTLTYPE_INT|CTLFLAG_RW,
+    &tcp_uto_max, 0, sysctl_msec_to_ticks, "I", "Maximum user timeout");
 
 static int	tcp_keepcnt = TCPTV_KEEPCNT;
 	/* max idle probes */

==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_timer.h#2 (text+ko) ====

@@ -91,6 +91,9 @@
 
 #define TCPTV_FINWAIT2_TIMEOUT (60*hz)         /* FIN_WAIT_2 timeout if no receiver */
 
+#define TCPTV_UTOMIN	(120*hz)		/* min user timeout */
+#define TCPTV_UTOMAX	(720*hz)		/* max user timeout */
+
 /*
  * Minimum retransmit timer is 3 ticks, for algorithmic stability.
  * TCPT_RANGESET() will add another TCPTV_CPU_VAR to deal with


More information about the p4-projects mailing list