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>
This commit is contained in:
Garrett Wollman 1995-06-19 16:45:33 +00:00
parent 4112bc7874
commit 9167720192
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9263
3 changed files with 12 additions and 3 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */
};
/*