Date: Thu, 28 Jan 2016 21:30:49 +0000 (UTC) From: Hiren Panchasara <hiren@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295015 - stable/10/sys/netinet Message-ID: <201601282130.u0SLUnYs022950@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hiren Date: Thu Jan 28 21:30:49 2016 New Revision: 295015 URL: https://svnweb.freebsd.org/changeset/base/295015 Log: MFC r294840 Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 seconds and 60 seconds, respectively. Turn them into sysctls that can be tuned live. The default values of 5 seconds and 60 seconds have been retained. Modified: stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_output.c Thu Jan 28 21:30:49 2016 (r295015) @@ -1608,7 +1608,7 @@ tcp_setpersist(struct tcpcb *tp) * Start/restart persistance timer. */ TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], - TCPTV_PERSMIN, TCPTV_PERSMAX); + tcp_persmin, tcp_persmax); tcp_timer_activate(tp, TT_PERSIST, tt); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_subr.c Thu Jan 28 21:30:49 2016 (r295015) @@ -400,6 +400,8 @@ tcp_init(void) tcp_rexmit_min = TCPTV_MIN; if (tcp_rexmit_min < 1) tcp_rexmit_min = 1; + tcp_persmin = TCPTV_PERSMIN; + tcp_persmax = TCPTV_PERSMAX; tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_timer.c Thu Jan 28 21:30:49 2016 (r295015) @@ -71,6 +71,14 @@ __FBSDID("$FreeBSD$"); #include <netinet/tcp_debug.h> #endif +int tcp_persmin; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmin, 0, sysctl_msec_to_ticks, "I", "minimum persistence interval"); + +int tcp_persmax; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmax, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmax, 0, sysctl_msec_to_ticks, "I", "maximum persistence interval"); + int tcp_keepinit; SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW, &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection"); Modified: stable/10/sys/netinet/tcp_timer.h ============================================================================== --- stable/10/sys/netinet/tcp_timer.h Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_timer.h Thu Jan 28 21:30:49 2016 (r295015) @@ -78,7 +78,7 @@ #define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ #define TCPTV_SRTTDFLT ( 3*hz) /* assumed RTT if no info */ -#define TCPTV_PERSMIN ( 5*hz) /* retransmit persistence */ +#define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ #define TCPTV_KEEP_INIT ( 75*hz) /* initial connect keepalive */ @@ -174,6 +174,8 @@ struct tcp_timer { #define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) #define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) +extern int tcp_persmin; /* minimum persist interval */ +extern int tcp_persmax; /* maximum persist interval */ extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601282130.u0SLUnYs022950>