Clean up unused bandwidth entry in the TCP hostcache.
Submitted by: Jason Wolfe (j at nitrology dot com) Reviewed by: rrs, hiren Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D4154
This commit is contained in:
parent
3b5966d10f
commit
4d16338223
@ -32,8 +32,8 @@
|
||||
* table to a dedicated structure indexed by the remote IP address. It keeps
|
||||
* information on the measured TCP parameters of past TCP sessions to allow
|
||||
* better initial start values to be used with later connections to/from the
|
||||
* same source. Depending on the network parameters (delay, bandwidth, max
|
||||
* MTU, congestion window) between local and remote sites, this can lead to
|
||||
* same source. Depending on the network parameters (delay, max MTU,
|
||||
* congestion window) between local and remote sites, this can lead to
|
||||
* significant speed-ups for new TCP connections after the first one.
|
||||
*
|
||||
* Due to the tcp_hostcache, all TCP-specific metrics information in the
|
||||
@ -440,7 +440,6 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_lite *hc_metrics_lite)
|
||||
hc_metrics_lite->rmx_ssthresh = hc_entry->rmx_ssthresh;
|
||||
hc_metrics_lite->rmx_rtt = hc_entry->rmx_rtt;
|
||||
hc_metrics_lite->rmx_rttvar = hc_entry->rmx_rttvar;
|
||||
hc_metrics_lite->rmx_bandwidth = hc_entry->rmx_bandwidth;
|
||||
hc_metrics_lite->rmx_cwnd = hc_entry->rmx_cwnd;
|
||||
hc_metrics_lite->rmx_sendpipe = hc_entry->rmx_sendpipe;
|
||||
hc_metrics_lite->rmx_recvpipe = hc_entry->rmx_recvpipe;
|
||||
@ -555,14 +554,6 @@ tcp_hc_update(struct in_conninfo *inc, struct hc_metrics_lite *hcml)
|
||||
(hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2;
|
||||
TCPSTAT_INC(tcps_cachedssthresh);
|
||||
}
|
||||
if (hcml->rmx_bandwidth != 0) {
|
||||
if (hc_entry->rmx_bandwidth == 0)
|
||||
hc_entry->rmx_bandwidth = hcml->rmx_bandwidth;
|
||||
else
|
||||
hc_entry->rmx_bandwidth =
|
||||
(hc_entry->rmx_bandwidth + hcml->rmx_bandwidth) / 2;
|
||||
/* TCPSTAT_INC(tcps_cachedbandwidth); */
|
||||
}
|
||||
if (hcml->rmx_cwnd != 0) {
|
||||
if (hc_entry->rmx_cwnd == 0)
|
||||
hc_entry->rmx_cwnd = hcml->rmx_cwnd;
|
||||
@ -612,7 +603,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS)
|
||||
SBUF_INCLUDENUL);
|
||||
|
||||
sbuf_printf(&sb,
|
||||
"\nIP address MTU SSTRESH RTT RTTVAR BANDWIDTH "
|
||||
"\nIP address MTU SSTRESH RTT RTTVAR "
|
||||
" CWND SENDPIPE RECVPIPE HITS UPD EXP\n");
|
||||
|
||||
#define msec(u) (((u) + 500) / 1000)
|
||||
@ -621,8 +612,8 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS)
|
||||
TAILQ_FOREACH(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket,
|
||||
rmx_q) {
|
||||
sbuf_printf(&sb,
|
||||
"%-15s %5lu %8lu %6lums %6lums %9lu %8lu %8lu %8lu "
|
||||
"%4lu %4lu %4i\n",
|
||||
"%-15s %5lu %8lu %6lums %6lums %8lu %8lu %8lu %4lu "
|
||||
"%4lu %4i\n",
|
||||
hc_entry->ip4.s_addr ? inet_ntoa(hc_entry->ip4) :
|
||||
#ifdef INET6
|
||||
ip6_sprintf(ip6buf, &hc_entry->ip6),
|
||||
@ -635,7 +626,6 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS)
|
||||
(RTM_RTTUNIT / (hz * TCP_RTT_SCALE))),
|
||||
msec(hc_entry->rmx_rttvar *
|
||||
(RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))),
|
||||
hc_entry->rmx_bandwidth * 8,
|
||||
hc_entry->rmx_cwnd,
|
||||
hc_entry->rmx_sendpipe,
|
||||
hc_entry->rmx_recvpipe,
|
||||
|
@ -57,7 +57,6 @@ struct hc_metrics {
|
||||
u_long rmx_ssthresh; /* outbound gateway buffer limit */
|
||||
u_long rmx_rtt; /* estimated round trip time */
|
||||
u_long rmx_rttvar; /* estimated rtt variance */
|
||||
u_long rmx_bandwidth; /* estimated bandwidth */
|
||||
u_long rmx_cwnd; /* congestion window */
|
||||
u_long rmx_sendpipe; /* outbound delay-bandwidth product */
|
||||
u_long rmx_recvpipe; /* inbound delay-bandwidth product */
|
||||
|
@ -335,7 +335,6 @@ struct hc_metrics_lite { /* must stay in sync with hc_metrics */
|
||||
u_long rmx_ssthresh; /* outbound gateway buffer limit */
|
||||
u_long rmx_rtt; /* estimated round trip time */
|
||||
u_long rmx_rttvar; /* estimated rtt variance */
|
||||
u_long rmx_bandwidth; /* estimated bandwidth */
|
||||
u_long rmx_cwnd; /* congestion window */
|
||||
u_long rmx_sendpipe; /* outbound delay-bandwidth product */
|
||||
u_long rmx_recvpipe; /* inbound delay-bandwidth product */
|
||||
|
Loading…
Reference in New Issue
Block a user