From 9167720192eaec7a82a3b86491d13fcb5ab1b070 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Mon, 19 Jun 1995 16:45:33 +0000 Subject: [PATCH] Now that we've gone to all sorts of effort to allow TCP to cache some of its connection parameters, we want to keep statistics on how often this actually happens to see whether there is any work that needs to be done in TCP itself. Suggested by: John Wroclawski --- sys/netinet/tcp_subr.c | 5 ++++- sys/netinet/tcp_timewait.c | 5 ++++- sys/netinet/tcp_var.h | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 381824de0eb5..b2f96a2100cf 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.10 1995/04/09 01:29:26 davidg Exp $ + * $Id: tcp_subr.c,v 1.11 1995/05/30 08:09:58 rgrimes Exp $ */ #include @@ -333,6 +333,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_rtt + i) / 2; else rt->rt_rmx.rmx_rtt = i; + tcpstat.tcps_cachedrtt++; } if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) { i = tp->t_rttvar * @@ -342,6 +343,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_rttvar + i) / 2; else rt->rt_rmx.rmx_rttvar = i; + tcpstat.tcps_cachedrttvar++; } /* * update the pipelimit (ssthresh) if it has been updated @@ -366,6 +368,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_ssthresh + i) / 2; else rt->rt_rmx.rmx_ssthresh = i; + tcpstat.tcps_cachedssthresh++; } } #endif /* RTV_RTT */ diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 381824de0eb5..b2f96a2100cf 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.10 1995/04/09 01:29:26 davidg Exp $ + * $Id: tcp_subr.c,v 1.11 1995/05/30 08:09:58 rgrimes Exp $ */ #include @@ -333,6 +333,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_rtt + i) / 2; else rt->rt_rmx.rmx_rtt = i; + tcpstat.tcps_cachedrtt++; } if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) { i = tp->t_rttvar * @@ -342,6 +343,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_rttvar + i) / 2; else rt->rt_rmx.rmx_rttvar = i; + tcpstat.tcps_cachedrttvar++; } /* * update the pipelimit (ssthresh) if it has been updated @@ -366,6 +368,7 @@ tcp_close(tp) (rt->rt_rmx.rmx_ssthresh + i) / 2; else rt->rt_rmx.rmx_ssthresh = i; + tcpstat.tcps_cachedssthresh++; } } #endif /* RTV_RTT */ diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 56d9f3e949d7..c5f35d3b675c 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_var.h 8.3 (Berkeley) 4/10/94 - * $Id: tcp_var.h,v 1.10 1995/03/16 18:15:07 bde Exp $ + * $Id: tcp_var.h,v 1.11 1995/04/09 01:29:29 davidg Exp $ */ #ifndef _NETINET_TCP_VAR_H_ @@ -277,6 +277,9 @@ struct tcpstat { u_long tcps_predack; /* times hdr predict ok for acks */ u_long tcps_preddat; /* times hdr predict ok for data pkts */ u_long tcps_pcbcachemiss; + u_long tcps_cachedrtt; /* times cached RTT in route updated */ + u_long tcps_cachedrttvar; /* times cached rttvar updated */ + u_long tcps_cachedssthresh; /* times cached ssthresh updated */ }; /*