summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_base.c
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-1/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Introduce an M_ASSERTPKTHDR() macro which performs the very common taskdes2003-04-081-2/+1
| | | | | | | of asserting that an mbuf has a packet header. Use it instead of hand- rolled versions wherever applicable. Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-1/+1
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Add two loader tuneables that allow one to change the maximum number ofharti2003-03-021-1/+11
| | | | | | | | | | | | | | | | | | queue items that can be allocated by netgraph and the number of free queue items that are cached on a private list. Netgraph places an upper limit on the number of queue items it may allocate. When there is a large number of netgraph messages travelling through the system (100k/sec and more) there is a high probability, that messages get queued at the nodes and netgraph runs out of queue items. In this case the data flow through netgraph gets blocked. The tuneable for the number of free items lets one trade memory for performance. The tunables are also available as read-only sysctls. PR: kern/47393 Reviewed by: julian Approved by: jake (mentor)
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Don't use "NULL" when "0" is really meant.archie2002-08-221-2/+2
|
* Make the consumers of the linker_load_file() function usemux2002-08-021-1/+1
| | | | | | | | | | | | | linker_load_module() instead. This fixes a bug where the kernel was unable to properly locate and load a kernel module in vfs_mount() (and probably in the netgraph code as well since it was using the same function). This is because the linker_load_file() does not properly search the module path. Problem found by: peter Reviewed by: peter Thanks to: peter
* Fix GCC warnings caused by initializing a zero length array. In the process,archie2002-05-311-3/+3
| | | | | | | simply things a bit by getting rid of 'struct ng_parse_struct_info' which was useless because it only contained one field. MFC after: 2 weeks
* Fix warnings: deprecated use of label at end of compound statementpeter2002-05-241-0/+1
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-6/+6
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Official timeout routines for netgraph nodes that know how tojulian2002-03-051-0/+62
| | | | | | use (and abuse) the node locking system. MFC after: 1 week
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-5/+5
| | | | also don't use ANSI string concatenation.
* Fix two typosbrian2001-08-211-2/+2
|
* Add an external function to unlink a netgraph type from the types list.julian2001-07-231-0/+20
|
* remember to set the return address in a message whenjulian2001-07-141-0/+1
| | | | | | | | | sending it along a hook. PR: 27906 Submitted by: Harti Brandt <brandt@fokus.gmd.de> no MFC as code is different in 4.x
* netgraph.h:julian2001-03-101-18/+56
| | | | | | | | | | | | | | | | | | | Change a prototype. Add a function version of ng_ref_node() when debugging so a breakpoint can be set on it. ng_base.c: add 'node' as an argument to ng_apply_item so that it is up to the caller to take over and release the item's reference on the node. If the release reports back that the node went away due to the reference going to 0, the caller should cease referencing the now defunct node. (e.g. the item was a 'kill node' message). Alter ng_unref_node to report back the residual references as a result. ng_pptpgre.c: Don't reference a node after we dropped a reference to it. (What if it was the last?) Fixes a node leak reported by Harti Brandt <brandt@fokus.gmd.de> which was due to an incorrect earlier attempt to fix the "accessing node after dropping the last reference" problem.
* Cleanups to Macros for sending data between netgraph nodes.julian2001-03-031-1/+0
|
* Shuffle netgraph mutexes a bit and hold a reference on a nodejulian2001-02-281-2/+4
| | | | from the function that is calling the destructor.
* Allow a changed MAC address to show up in ifconfig by changing itjulian2001-02-261-1/+1
| | | | in the ifaddr list as well. Also change an error return in the base system.
* Add knowledge of the netgraph spinlocks into the Witness code.julian2001-02-241-5/+12
| | | | Well, at least I think that's how it's done.
* Shuffle sysctls a bit (thankyou whoever made them dynamic for modules)julian2001-02-231-0/+4
| | | | | | | | | | | | and add a sysctl to pppoe to activate non standard ethertypes so that idiot ISPs (apparently in France) who use equipment from idiot suppliers (rumour says 3com) who use nonstandard ethertypes can still connect. "yep, sure we do pppoe, we use a different identifier to that dictated in the standard, but sure it's pppoe!" sysctl -w net.graph.stupid_isp=1 enables the changeover.
* Preceed/preceeding are not english words. Use precede and preceding.asmodai2001-02-181-1/+1
|
* Change and clean the mutex lock interface.bmilekic2001-02-091-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Make netgraph modules refuse to link with modules of a different ABI version.julian2001-02-051-1/+2
| | | | | | also try implement teh documented behaviour in socket nodes so that when there is only one hook, an unaddressed write/send will DTRT and send the data to that hook.
* Clean up reference counting with relation to queued packets and the worklist,julian2001-02-011-133/+102
| | | | | | and while I'm there, clean up the worklist insertion and removal. Inspired by: Harti Brandt <brandt@fokus.gmd.de>
* Add the ability to declare ore-ride methods on a per-hook basisjulian2001-01-311-15/+32
| | | | | | for the rcvdata() and rcvmsg() methods. Also bring the man page up to sync with my last commit. (and this one)
* Implement direct support for semipersistant nodes.julian2001-01-301-183/+146
| | | | | | | | | | | | | (e.g. ethernet nodes are persistent until you rip out the hardware) Use this support in the ethernet and sample nodes. Add some more abstraction on the 'item's so that node and hook reference counting can be checked easier. Slight man page correction. Make pppoe type dependent on ethernet type. Clean up node shutdown a little. Move a mutex from MTX_SPIN to MTX_DEF (oops) Fix small ref-counting bug. remove warning on one2many type.
* Only clear the 'free' bit if we were successful in getting a queue item off ↵julian2001-01-251-2/+6
| | | | | | the free list. Found by: Harti Brandt (address unknown)
* Don't crash the kernel if the user tries to load a netgraphjulian2001-01-241-4/+10
| | | | module with the wrong version number.
* Add MTX_SPIN to an mtx_init(julian2001-01-221-1/+1
|
* remove stupid braino (recursive mutex)julian2001-01-211-16/+20
| | | | tripped over by: PHK
* Add a generic "queued function callin" mechanismjulian2001-01-141-188/+380
| | | | | | Use it to implement (hopefully) SMP safe node/hook addition and removal. Fix some debug stuff.
* remove debug sysctljulian2001-01-111-1/+4
| | | | slight tweek to hook removal. (or is that tweak?)
* Make hook deletion SMP safe.julian2001-01-111-52/+88
|
* Add an exported function ng_rmhook_self() that removes a hookjulian2001-01-111-4/+101
| | | | | | | | from a node, but does it via the locking queue, thus ensuring that the node is locked when it's hook is removed. Add 'deadnode' and 'deadhook' structures for when a node or hook is invalidated but not yet freed. (not yet freed)
* Unbreak compilation.archie2001-01-111-1/+1
|
* Changes to stop zombie nodes showing up in active node lists.julian2001-01-101-21/+34
| | | | Also some changes resulting from debug work done earlier.
* Bad julian.. forgot to destroy mutex before freeing thejulian2001-01-081-0/+1
| | | | structure it was part of!
* Part 2 of the netgraph rewrite.julian2001-01-081-257/+475
| | | | | | This is mostly cosmetic changes, (though I caught a bug or two while makeing them) Reviewed by: archie@freebsd.org
* Rewrite of netgraph to start getting ready for SMP.julian2001-01-061-604/+1580
| | | | | | | | This version is functional and is aproaching solid.. notice I said APROACHING. There are many node types I cannot test I have tested: echo hole ppp socket vjc iface tee bpf async tty The rest compile and "Look" right. More changes to follow. DEBUGGING is enabled in this code to help if people have problems.
* Divorce the kernel binary ABI version number from the messagejulian2000-12-181-1/+15
| | | | | | | | | format version number. (userland programs should not need to be recompiled when the netgraph kernel internal ABI is changed. Also fix modules that don;t handle the fact that a caller may not supply a return message pointer. (benign at the moment because the calling code checks, but that will change)
* oops that commit included a local hack... take it out..julian2000-12-121-1/+1
|
* Reviewed by: Archie@freebsd.orgjulian2000-12-121-78/+110
| | | | | | | | | | | | | This clears out my outstanding netgraph changes. There is a netgraph change of design in the offing and this is to some extent a superset of soem of the new functionality and some of the old functionality that may be removed. This code works as before, but allows some new features that I want to work with and evaluate. It is the basis for a version of netgraph with integral locking for SMP use. This is running on my test machine with no new problems :-)
* Add splhigh()s to protect against a race conditionjulian2000-12-021-7/+17
| | | | | | | | that shows up when running with ethernet bridging at high speed. Submitted by: Chris Csanady <ccsanady@iastate.edu> (and extended by me)
* Add the use of M_ZERO to netgraph.dwmalone2000-11-181-4/+2
| | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Submitted by: archie Approved by: archie
* Since neither archie nor I work at Whistle any more, change our emailjulian2000-10-241-2/+2
| | | | | | addresses to be the more usefu @freebsd.org ones so we can keep getting bug-reports. - man pages to follow..
* Use a bigger buffer for NGM_BINARY2ASCII conversion, to handle reallyarchie2000-08-101-1/+1
| | | | long ASCII control messages.
* Allocate memory with M_NOWAIT instead of M_WAITOK, because it's possiblearchie2000-07-201-5/+5
| | | | | | for these routines to be called from an interrupt context. PR: kern/20057
* Experiemntal ascii based device configuration mechanism.phk2000-07-031-0/+8
| | | | This may or may not survive, decision will be made well before 5.0-R
* Back out the previous change to the queue(3) interface.jake2000-05-261-3/+3
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
OpenPOWER on IntegriCloud