summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_rmx.c
Commit message (Collapse)AuthorAgeFilesLines
* Time out routes created by redirect.ru2004-12-061-1/+4
|
* Introduce tcp_hostcache and remove the tcp specific metrics fromandre2003-11-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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)
* Remove RTF_PRCLONING from routing table and adjust users of itandre2003-11-201-14/+5
| | | | | | | | | | | | accordingly. The define is left intact for ABI compatibility with userland. This is a pre-step for the introduction of tcp_hostcache. The network stack remains fully useable with this change. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
* Remove the global one-level rtcache variable and associatedandre2003-11-141-7/+0
| | | | | | | | complex locking and rework ip_rtaddr() to do its own rtlookup. Adopt all its callers to this and make ip_output() callable with NULL rt pointer. Reviewed by: sam (mentor)
* Remove bogus RTFREE that was added in rev 1.47. The rmx code operatessam2003-11-031-3/+2
| | | | | | | | | directly on the radix tree and does not hold any routing table refernces. This fixes the reference counting problems that manifested itself as a panic during unmount of filesystems that were mounted by NFS over an interface that had been removed. Supported by: FreeBSD Foundation
* Overhaul routing table entry cleanup by introducing a new rtexpungesam2003-10-301-24/+9
| | | | | | | | | | | | routine that takes a locked routing table reference and removes all references to the entry in the various data structures. This eliminates instances of recursive locking and also closes races where the lock on the entry had to be dropped prior to calling rtrequest(RTM_DELETE). This also cleans up confusion where the caller held a reference to an entry that might have been reclaimed (and in some cases used that reference). Supported by: FreeBSD Foundation
* Lock ip forwarding route cache. While we're at it, remove the globalsam2003-10-141-6/+3
| | | | | | | variable ipforward_rt by introducing an ip_forward_cacheinval() call to use to invalidate the cache. Supported by: FreeBSD Foundation
* Locking for updates to routing table entries. Each rtentry gets a mutexsam2003-10-041-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
* Get cosmetic changes out of the way before I add routing table SMP locks.hsu2003-02-101-56/+47
|
* SMP locking for radix nodes.hsu2002-12-241-0/+8
|
* Remove __P.alfred2002-03-191-1/+1
|
* Centralize satosin(), sintosa() and ifatoia() macros in <netinet/in.h>jlemon2001-09-291-2/+0
| | | | Remove local definitions.
* In in_ifadown(), differentiate between whether the interface goesru2001-05-111-8/+12
| | | | | | | down or interface address is deleted. Only delete static routes in the latter case. Reported by: Alexander Leidinger <Alexander@leidinger.net>
* Invalidate cached forwarding route (ipforward_rt) whenever a new routeru2001-03-191-0/+12
| | | | | | | | is added to the routing table, otherwise we may end up using the wrong route when forwarding. PR: kern/10778 Reviewed by: silence on -net
* net/route.c:ru2001-03-151-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A route generated from an RTF_CLONING route had the RTF_WASCLONED flag set but did not have a reference to the parent route, as documented in the rtentry(9) manpage. This prevented such routes from being deleted when their parent route is deleted. Now, for example, if you delete an IP address from a network interface, all ARP entries that were cloned from this interface route are flushed. This also has an impact on netstat(1) output. Previously, dynamically created ARP cache entries (RTF_STATIC flag is unset) were displayed as part of the routing table display (-r). Now, they are only printed if the -a option is given. netinet/in.c, netinet/in_rmx.c: When address is removed from an interface, also delete all routes that point to this interface and address. Previously, for example, if you changed the address on an interface, outgoing IP datagrams might still use the old address. The only solution was to delete and re-add some routes. (The problem is easily observed with the route(8) command.) Note, that if the socket was already bound to the local address before this address is removed, new datagrams generated from this socket will still be sent from the old address. PR: kern/20785, kern/21914 Reviewed by: wollman (the idea)
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-8/+9
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* Converted the last instance of hzto() to tvtohz().bde1998-08-051-3/+3
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* A fix for a link down route cleanup panic, when the route cleanuppeter1998-03-271-1/+10
| | | | | | pulls the rug out from underneath itself. Obtained from: wollman (a few months ago, I've been using this for ages)
* Back out DIAGNOSTIC changes.eivind1998-02-061-3/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+3
|
* Removed unused #includes.bde1997-08-021-12/+1
|
* Fix the mechanism for choosing wehether to save the slow-start thresholdwollman1997-02-141-18/+1
| | | | | | | | | | in the route. This allows us to remove the unconditional setting of the pipesize in the route, which should mean that SO_SNDBUF and SO_RCVBUF should actually work again. While we're at it: - Convert udp_usrreq from `mondo switch statement from Hell' to new-style. - Delete old TCP mondo switch statement from Hell, which had previously been diked out.
* Provide PRC_IFDOWN and PRC_IFUP support for IP. Now, when an interfacewollman1997-02-131-1/+49
| | | | | | | | is administratively downed, all routes to that interface (including the interface route itself) which are not static will be deleted. When it comes back up, and addresses remaining will have their interface routes re-added. This solves the problem where, for example, an Ethernet interface is downed by traffic continues to flow by way of ARP entries.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Put the 'debug' messages of the type:nate1996-06-201-1/+3
| | | | | | | /kernel: in_rtqtimo: adjusted rtq_reallyold to 1066 /kernel: in_rtqtimo: adjusted rtq_reallyold to 710 inside of #ifdef DIAGNOSTIC to avoid the support questions from folks asking what this means.
* Add three new route flags to help determine what sort of addresswollman1996-05-061-4/+33
| | | | | | | | | | | | | | | | | | | | | | the destination represents. For IP: - Iff it is a host route, RTF_LOCAL and RTF_BROADCAST indicate local (belongs to this host) and broadcast addresses, respectively. - For all routes, RTF_MULTICAST is set if the destination is multicast. The RTF_BROADCAST flag is used by ip_output() to eliminate a call to in_broadcast() in a common case; this gives about 1% in our packet-generation experiments. All three flags might be used (although they aren't now) to determine whether a packet can be forwarded; a given host route can represent a forwardable address if: (rt->rt_flags & (RTF_HOST | RTF_LOCAL | RTF_BROADCAST | RTF_MULTICAST)) == RTF_HOST Obviously, one still has to do all the work if a host route is not present, but this code allows one to cache the results of such a lookup if rtalloc1() is called without masking RTF_PRCLONING.
* Delete #if 0 block containing remnants of pre-MTU discovery rmx_mtuwollman1996-04-261-17/+1
| | | | initialization.
* First piece of fixing ppp/proxy arp problem:fenner1996-01-231-2/+28
| | | | | | | If an attempt to add a route fails because an "ARP table" entry is in the way, remove the ARP entry and retry the add. Reviewed by: nate
* Actually call in_rtqdrain()as was originally intended.wollman1995-12-191-5/+2
|
* Path MTU Discovery is now standard.wollman1995-12-051-8/+8
|
* Completed function declarations and/or added prototypes.bde1995-12-021-1/+4
|
* New style sysctl & staticize alot of stuff.phk1995-11-141-6/+8
|
* Start adding new style sysctl here too.phk1995-11-091-5/+17
|
* Second batch of cleanup changes.phk1995-10-291-2/+1
| | | | | This time mostly making a lot of things static and some unused variables here and there.
* Initial back-end support for IP MTU discovery, gated on MTUDISC. The supportwollman1995-09-181-1/+9
| | | | for TCP has yet to be written.
* tcp_input.c - keep track of how many times a route contained a cached rttwollman1995-07-101-2/+39
| | | | | | | | | or ssthresh that we were able to use tcp_var.h - declare tcpstat entries for above; declare tcp_{send,recv}space in_rmx.c - fill in the MTU and pipe sizes with the defaults TCP would have used anyway in the absence of values here
* Fix an error in the comparison direction of the ap->updating case ofwollman1995-06-211-2/+2
| | | | | | in_rtqkill(). Submitted by: W. Richard Stevens
* Remove trailing whitespace.rgrimes1995-05-301-7/+7
|
* Removed redundant newlines that were in some panic strings.dg1995-03-191-2/+2
|
* Added missing newlines to calls to log().dg1995-02-201-3/+3
|
* After dynamically reducing rtq_reallyold, have in_rtqkill() reduce thewollman1995-02-141-4/+14
| | | | | | expiration timer of anything which would expire later than that. (There should be a way to call this from ip_sysctl() as well, but there currently isn't.)
* Attempt to make the host route cache a bit smarter under conditions ofwollman1995-02-141-10/+73
| | | | | | | | | | | | | high load: 1) If there ever get to be more than net.inet.ip.rtmaxcache entries in the cache, in_rtqtimo() will reduce net.inet.ip.rtexpire by 1/3 and do another round, unles net.inet.ip.rtexpire is less than net.inet.ip.rtminexpire, and never more than once in ten minutes (rtq_timeout). 2) If net.inet.ip.rtexpire is set to zero, don't bother to cache anything.
* Change caching strategy somewhat:wollman1995-01-231-12/+17
| | | | | | | | 1) Don't clone routes to multicast destinations; there is nothing useful to be gained in this case. 2) Reduce default expiration timer to one hour. Busy sites will still likely want to reduce this, but for ordinary users this is a reasonable value to use.
* Avoid a serious race by blocking netisrs while walking the route tree.wollman1994-12-211-6/+6
| | | | (IWBRNI we could just block IP netisrs...)
* Update calls to rtalloc1(). Also merge rt_prflags with rt_flags.wollman1994-12-131-13/+24
|
* Delete old, confusing comment.wollman1994-12-021-9/+1
|
* Add a check to make sure that we don't fiddle with the NFS routing tableswollman1994-12-021-10/+3
| | | | | as well (bleah!). Also, increase the interval to the real-life value and eliminate debugging printfs. This will be standard once tested by others.
* Add latest version of ``advanced route metric management'' :-)wollman1994-12-011-18/+71
| | | | | As before, this is currently conditionalized on options IN_RMX until I'm sure it's working.
OpenPOWER on IntegriCloud