diff options
author | andre <andre@FreeBSD.org> | 2003-11-20 20:07:39 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2003-11-20 20:07:39 +0000 |
commit | 6164d7c280688f20cf827e8374984c6e0175fab0 (patch) | |
tree | f947a08d66395dd498056038f0c360783fa281c7 /sys/netinet/ip_input.c | |
parent | 6dca20de0718f19b3cdc5a7d5ebb71cd54b2374e (diff) | |
download | FreeBSD-src-6164d7c280688f20cf827e8374984c6e0175fab0.zip FreeBSD-src-6164d7c280688f20cf827e8374984c6e0175fab0.tar.gz |
Introduce tcp_hostcache and remove the tcp specific metrics from
the routing table. Move all usage and references in the tcp stack
from the routing table metrics to the tcp hostcache.
It caches measured parameters of past tcp sessions to provide better
initial start values for following connections from or to the same
source or destination. Depending on the network parameters to/from
the remote host this can lead to significant speedups for new tcp
connections after the first one because they inherit and shortcut
the learning curve.
tcp_hostcache is designed for multiple concurrent access in SMP
environments with high contention and is hash indexed by remote
ip address.
It removes significant locking requirements from the tcp stack with
regard to the routing table.
Reviewed by: sam (mentor), bms
Reviewed by: -net, -current, core@kame.net (IPv6 parts)
Approved by: re (scottl)
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index df67d22..3d528f4 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1612,22 +1612,22 @@ struct in_ifaddr * ip_rtaddr(dst) struct in_addr dst; { + struct route sro; struct sockaddr_in *sin; struct in_ifaddr *ifa; - struct route ro; - bzero(&ro, sizeof(ro)); - sin = (struct sockaddr_in *)&ro.ro_dst; + sro.ro_rt = NULL; + sin = (struct sockaddr_in *)&sro.ro_dst; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_addr = dst; - rtalloc_ign(&ro, RTF_CLONING); + rtalloc_ign(&sro, RTF_CLONING); - if (ro.ro_rt == 0) + if (sro.ro_rt == NULL) return ((struct in_ifaddr *)0); - ifa = ifatoia(ro.ro_rt->rt_ifa); - RTFREE(ro.ro_rt); + ifa = ifatoia(sro.ro_rt->rt_ifa); + RTFREE(sro.ro_rt); return ifa; } @@ -1879,7 +1879,7 @@ ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop) struct route ro; struct rtentry *rt; - bzero(&ro, sizeof(ro)); + ro.ro_rt = NULL; sin = (struct sockaddr_in *)&ro.ro_dst; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); |