summaryrefslogtreecommitdiffstats
path: root/sys/net/netisr.c
Commit message (Collapse)AuthorAgeFilesLines
* Correctly unregister a netisr by clearing the ni->ni_queue field to NULL asandre2004-10-111-0/+1
| | | | | | | | | well. This field is actually used by various netisr functions to determine the availablility of the specified netisr. This uncomplete unregister leads directly to a crash when the KLD unregistering the netisr is unloaded. Submitted by: Sam <sah@softcardsystems.com> MFC after: 3 days
* Correct a comment typo: s/Note/Not/.rwatson2004-09-031-1/+1
| | | | Pointed out by: kensmith
* Correct typo in printf() warning.rwatson2004-08-281-1/+1
| | | | Submitted by: Pawel Worach <pawel.worach at telia.com>
* Change the default disposition of debug.mpsafenet from 0 to 1, whichrwatson2004-08-281-3/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | will cause the network stack to operate without the Giant lock by default. This change has the potential to improve performance by increasing parallelism and decreasing latency in network processing. Due to the potential exposure of existing or new bugs, the following compatibility functionality is maintained: - It is still possible to disable Giant-free operation by setting debug.mpsafenet to 0 in loader.conf. - Add "options NET_WITH_GIANT", which will restore the default value of debug.mpsafenet to 0, and is intended for use on systems compiled with known unsafe components, or where a more conservative configuration is desired. - Add a new declaration, NET_NEEDS_GIANT("componentname"), which permits kernel components to declare dependence on Giant over the network stack. If the declaration is made by a preloaded module or a compiled in component, the disposition of debug.mpsafenet will be set to 0 and a warning concerning performance degraded operation printed to the console. If it is declared by a loadable kernel module after boot, a warning is displayed but the disposition cannot be changed. This is implemented by defining a new SYSINIT() value, SI_SUB_SETTINGS, which is intended for the processing of configuration choices after tunables are read in and the console is available to generate errors, but before much else gets going. This compatibility behavior will go away when we've finished the last of the locking work and are confident that operation is correct.
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-271-3/+5
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* Comment clarifying debug_mpsafenet.rwatson2004-07-181-4/+5
|
* o add a flags parameter to netisr_register that is used to specifysam2003-11-081-39/+45
| | | | | | | | | | | | | | | | whether or not the isr needs to hold Giant when running; Giant-less operation is also controlled by the setting of debug_mpsafenet o mark all netisr's except NETISR_IP as needing Giant o add a GIANT_REQUIRED assertion to the top of netisr's that need Giant o pickup Giant (when debug_mpsafenet is 1) inside ip_input before calling up with a packet o change netisr handling so swi_net runs w/o Giant; instead we grab Giant before invoking handlers based on whether the handler needs Giant o change netisr handling so that netisr's that are marked MPSAFE may have multiple instances active at a time o add netisr statistics for packets dropped because the isr is inactive Supported by: FreeBSD Foundation
* o make debug_mpsafenet globally visiblesam2003-11-051-0/+10
| | | | | | | | o move it from subr_bus.c to netisr.c where it more properly belongs o add NET_PICKUP_GIANT and NET_DROP_GIANT macros that will be used to grab Giant as needed when MPSAFE operation is enabled Supported by: FreeBSD Foundation
* When direct dispatching an netisr (net.isr.enable=1), if there are alreadyrwatson2003-10-031-13/+21
| | | | | | | | | | | | | | | | | | any queued packets for the isr, process those packets before the newly submitted packet, maintaining ordering of all packets being delivered to the netisr. Remove the bypass counter since we don't bypass anymore. Leave the comment about possible problems and options since later performance optimization may change the strategy for addressing ordering problems here. Specifically, this maintains the strong isr ordering guarantee; additional parallelism and lower latency may be possible by moving to weaker guarantees (per-interface, for example). We will probably at some point also want to remove the one instance netisr dispatch limit currently enforced by a mutex, but it's not clear that's 100% safe yet, even in the netperf branch. Reviewed by: sam, others
* Create a tunable for net.isr.enable so that it may be set fromrwatson2003-10-021-0/+1
| | | | inception, rather than having to wait for the boot to finish.
* Temporarily turn net.isr.enable back off again until patches torwatson2003-10-011-1/+1
| | | | correct potential nits in packet ordering are resolved.
* Enable net.isr.enable by default, causing "delivery to completion"rwatson2003-10-011-1/+1
| | | | | | | | | | | | | | | (direct dispatch) in interrupt threads when the netisr in question isn't already active. If a netisr is already active, or direct dispatch is already in progress, we queue the packet for later delivery. Previously, this option was disabled by default. I have measured 20%+ performance improvements in IP packet forwarding with this enabled. Please report any problems ASAP, especially relating to stack depth or out-of-order packet processing. Discussed with: jlemon, peter Sponsored by: DARPA, Network Associates Laboratories
* Discard the packet if the netisr queue is null instead of panicing, forjlemon2003-03-081-2/+8
| | | | the benefit of modules which are compiled differently than the kernel.
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-58/+187
| | | | | | | | | | 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
* Moved netisr code from kern/kern_intr.c to net/netisr.c as threatened in ajake2002-09-221-0/+116
comment.
OpenPOWER on IntegriCloud