summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-06-19 16:45:33 +0000
committerwollman <wollman@FreeBSD.org>1995-06-19 16:45:33 +0000
commita1aa4b6c803d61e08c672ed170fb6dd85a00772f (patch)
tree393189ae6d0573852a4a88c1ad9cf03f1c79436b
parent4e33c8eed30fa60dfd518a6a7fdf5c7eceeabd57 (diff)
downloadFreeBSD-src-a1aa4b6c803d61e08c672ed170fb6dd85a00772f.zip
FreeBSD-src-a1aa4b6c803d61e08c672ed170fb6dd85a00772f.tar.gz
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 <jtw@lcs.mit.edu>
-rw-r--r--sys/netinet/tcp_subr.c5
-rw-r--r--sys/netinet/tcp_timewait.c5
-rw-r--r--sys/netinet/tcp_var.h5
3 files changed, 12 insertions, 3 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 381824d..b2f96a2 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 <sys/param.h>
@@ -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 381824d..b2f96a2 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 <sys/param.h>
@@ -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 56d9f3e..c5f35d3 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 */
};
/*
OpenPOWER on IntegriCloud