From owner-p4-projects@FreeBSD.ORG Thu Jun 4 03:19:25 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B5AE1065673; Thu, 4 Jun 2009 03:19:25 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6A20106566B for ; Thu, 4 Jun 2009 03:19:24 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 99B098FC0C for ; Thu, 4 Jun 2009 03:19:24 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n543JO2H090066 for ; Thu, 4 Jun 2009 03:19:24 GMT (envelope-from fangwang@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n543JOII090064 for perforce@freebsd.org; Thu, 4 Jun 2009 03:19:24 GMT (envelope-from fangwang@FreeBSD.org) Date: Thu, 4 Jun 2009 03:19:24 GMT Message-Id: <200906040319.n543JOII090064@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fangwang@FreeBSD.org using -f From: Fang Wang To: Perforce Change Reviews Cc: Subject: PERFORCE change 163464 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 03:19:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=163464 Change 163464 by fangwang@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