summaryrefslogtreecommitdiffstats
path: root/sys/contrib
Commit message (Collapse)AuthorAgeFilesLines
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-261-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-162-2/+2
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Fix mmap(2) on ZFS after some changes in VM subsystem.pjd2008-03-151-0/+4
| | | | | | | Submitted by: alc Reported by: kris (originally) and many others Tested with: fsx MFC after: 1 week
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-3/+3
| | | | | | | | | always curthread. As KPI gets broken by this patch, manpages and __FreeBSD_version will be updated by further commits. Tested by: Andrea Barberio <insomniac at slackware dot it>
* Introduce some functions in the vnode locks namespace and in the ffsattilio2008-02-241-4/+4
| | | | | | | | | | | | | | | namespace in order to handle lockmgr fields in a controlled way instead than spreading all around bogus stubs: - VN_LOCK_AREC() allows lock recursion for a specified vnode - VN_LOCK_ASHARE() allows lock sharing for a specified vnode In FFS land: - BUF_AREC() allows lock recursion for a specified buffer lock - BUF_NOREC() disallows recursion for a specified buffer lock Side note: union_subr.c::unionfs_node_update() is the only other function directly handling lockmgr fields. As this is not simple to fix, it has been left behind as "sole" exception.
* - Reduce how much ZFS caches by default. This is another change to mitigatepjd2008-01-241-4/+5
| | | | | | | 'kmem_map too small panics'. - Print two warnings if there is not enough memory and not enough address space. - Improve comment.
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-134-14/+14
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* This commit was generated by cvs2svn to compensate for changes in r175256,njl2008-01-121-3/+19
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Fix GPE livelock that occurs on HP/Compaq laptops, mostly in the thermalnjl2008-01-121-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zone code. The GPE handler method (i.e. _L00) generates various Notify events that need to be run to completion before the GPE is re-enabled. In ACPI-CA, we queue an asynch callback at the same priority as a Notify so that it will only run after all Notify handlers have completed. The callback re-enables the GPE afterwards. We also changed the priority of Notifies to be the same as GPEs, given the possibility that another GPE could arrive before the Notifies have completed and we don't want it to get queued ahead of the rest. The ACPI-CA change was submitted by Alexey Starikovskiy (SUSE) and will appear in a later release. Special thanks to him for helping track this bug down. MFC after: 1 week Tested by: jhb, Yousif Hassan <yousif / alumni.jmu.edu>
* | vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-106-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* | * Check endianness the FreeBSD way.jb2007-11-2812-30/+43
| | | | | | | | | | * Use LBOLT rather than lbolt to avoid a clash with a FreeBSD global variable.
* | Fix a prototype definition.jb2007-11-281-1/+1
| |
* | Check endianness the FreeBSD way.jb2007-11-281-1/+1
| |
* | Include an extra header to get this to compile cleanly.jb2007-11-281-0/+1
| |
* | Fix 3 issues relating to the use of "auth" rules in IPFilter, from sourceforge:darrenr2007-11-263-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | 1837014 Kernel panics after authentication of an outgoing packet 1836992 Potential bugs in packet auth code (w/patches) 1836967 Kernel panic when using auth rule with keep state and another reported only to FreeBSD by Andiry (see PR) PR: kern/118251 Submitted by: Andriy Syrovenko <andriys@gmail.com> Reviewed by: darrenr MFC after: 5 days
* | Bring back pf_if.c revs 1.8 and 1.6 also lost during last import:mlaier2007-11-211-0/+23
| | | | | | | | | | | | | | - Use correct time for tzero when compiled in - Don't use bogus interface addresses on ptp-interfaces with :0 MFC after: 3 days
* | Cleanup pf interface mangement - esp. remove EVENTHANDLER before unloadingmlaier2007-11-212-1/+31
| | | | | | | | | | | | | | the coresponding code. This was lost during 4.1 import. Reported by: ru MFC after: 3 days
* | Reloop OpenBSD rev. 1.563:mlaier2007-11-211-3/+11
| | | | | | | | | | | | | | | | | | In pf_test_fragment(), ignore protocol-specific criteria for packets of different protocols. Reported by: des Obtained from: OpenBSD MFC after: 3 days
* | Warn if kmem_map size is set to less than 512MB. Previous warning was a bitpjd2007-11-071-5/+5
| | | | | | | | | | | | | | pointless, because default is set to something around 300MB and also insufficient. MFC after: 3 days
* | Remove unused header.pjd2007-11-051-569/+0
| | | | | | | | MFC after: 3 days
* | If setting a state to anything but open state, close access to vdev.pjd2007-11-051-0/+11
| | | | | | | | | | | | | | This fixes replacing drive in place, eg. zpool replace tank da1 da1. Before it complained that device is already open. MFC after: 1 week
* | Initial Import of wpi driver based on p4 changeset 128641.benjsc2007-11-052-0/+2667
| | | | | | | | | | | | | | | | | | This import includes: o wpi Wireless driver for the Intel 3945 Wireless Lan Controller (802.11abg) (sys/dev/wpi) o Intel firmware revision 2.14.4 & associated LICENSE (sys/dev/contrib/wpi, sys/contrib/dev/wpi/LICENSE) o wpifw Firmware driver (sys/modules/wpifw) Approved by: mlaier, sam (co-mentors)
* | - Add sysctl for sizeof(znode_t), which will be used by fstat(1).lulf2007-11-021-0/+4
| | | | | | | | Approved by: pjd (mentor)
* | Call zil_commit() (if ZIL is not disabled) after every non-read requestpjd2007-11-011-11/+11
| | | | | | | | | | | | | | | | (BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is that Solaris calls it only for sync requests, but we can't say in GEOM is the request is sync or async, so we do it for every request. MFC after: 1 week
* | Apply a few changes from ipfilter-current:darrenr2007-10-307-44/+69
| | | | | | | | | | | | | | | | * Do not hold any locks over calls to copyin/copyout. * Clean up some #ifdefs * fix a possible mbuf leak when NAT fails on policy routed packets PR: 117216
* | Continue to move from generic network entry points in the TrustedBSD MACrwatson2007-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Framework by moving from mac_mbuf_create_netlayer() to more specific entry points for specific network services: - mac_netinet_firewall_reply() to be used when replying to in-bound TCP segments in pf and ipfw (etc). - Rename mac_netinet_icmp_reply() to mac_netinet_icmp_replyinplace() and add mac_netinet_icmp_reply(), reflecting that in some cases we overwrite a label in place, but in others we apply the label to a new mbuf. Obtained from: TrustedBSD Project
* | Rename 'mac_mbuf_create_from_firewall' to 'mac_netinet_firewall_send' asrwatson2007-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | we move towards netinet as a pseudo-object for the MAC Framework. Rename 'mac_create_mbuf_linklayer' to 'mac_mbuf_create_linklayer' to reflect general object-first ordering preference. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
* | Properly drop the pf mutex around all copyout (consistency still protectedmlaier2007-10-242-1/+9
| | | | | | | | | | | | | | by the sx) and avoid a WITNESS panic. Overlooked during last import. Reported and tested by: Max N. Boyarov MFC after: 3 days
* | Merge first in a series of TrustedBSD MAC Framework KPI changesrwatson2007-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from Mac OS X Leopard--rationalize naming for entry points to the following general forms: mac_<object>_<method/action> mac_<object>_check_<method/action> The previous naming scheme was inconsistent and mostly reversed from the new scheme. Also, make object types more consistent and remove spaces from object types that contain multiple parts ("posix_sem" -> "posixsem") to make mechanical parsing easier. Introduce a new "netinet" object type for certain IPv4/IPv6-related methods. Also simplify, slightly, some entry point names. All MAC policy modules will need to be recompiled, and modules not updates as part of this commit will need to be modified to conform to the new KPI. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
* | Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-204-8/+8
| | | | | | | | | | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* | Pullup IPFilter 4.1.28 from the vendor branch into HEAD.darrenr2007-10-1816-585/+863
| | | | | | | | MFC after: 7 days
* | This commit was generated by cvs2svn to compensate for changes in r172771,darrenr2007-10-186-64/+88
|\ \ | | | | | | | | | which included commits to RCS files with non-trunk default branches.
| * | Import IPFilter 4.1.28darrenr2007-10-1822-650/+953
| | |
* | | ZFS_LOG adds a newline by itself.thompsa2007-10-141-1/+1
| | | | | | | | | | | | Pointed out by: pjd
* | | Print the ZFS ereport to the console if vfs.zfs.debug is set to help diagnosethompsa2007-10-141-0/+1
| | | | | | | | | | | | | | | | | | problems with zfs-on-root since devd isnt running yet. Reviewed by: pjd
* | | Fix lock leak leading to the 'System call <name> returning with 1 locks held'pjd2007-10-041-0/+2
| | | | | | | | | | | | | | | | | | | | | panic. Reported by: kris Approved by: re (kensmith)
* | | Ok I hope I got it right this time.cognet2007-09-272-0/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After discussion with Sam, switch back to use firmware(9) instead of having the firmware in hex format. Put the binary firmware uuencoded into sys/contrib/dev/npe, and slap a LICENSE file, as found on the Intel website. Approved by: re (blanket), mux (mentor) MFC After: 1 week
* | | This commit was generated by cvs2svn to compensate for changes in r172314,jkim2007-09-242-10/+15
|\ \ \ | | |/ | |/| | | | which included commits to RCS files with non-trunk default branches.
| * | Fix global lock recursion bug.jkim2007-09-242-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was part of ACPI-CA 20070508 release and the following is excerpt from its change log: Fixed a problem where the Global Lock handle was not properly updated if a thread that acquired the Global Lock via executing AML code then attempted to acquire the lock via the AcpiAcquireGlobalLock interface. Reported by Joe Liu. Approved by: re (kensmith) Tested by: ambrisko Obtained from: Intel
* | | Now that we have CDDLed code in the tree, add CDDL license.pjd2007-09-231-0/+384
| | | | | | | | | | | | | | | Discussed with: core Approved by: re (kensmith)
* | | Reduce the limit of vnodes on i386 when ZFS is loaded to 3/4 of the originalpjd2007-09-101-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | value, so we don't run out of KVA. The default vnodes limit fits better for UFS, but ZFS allocated more file system specific memory for a vnode than UFS. Don't touch vnodes limit if we detect it was tuned by system administrator and restore original value when ZFS is unloaded. This isn't final fix, but before we implement something better, this will help to stabilize ZFS under heavy load on i386. Approved by: re (bmah)
* | | After dfr@ vnode leak fix, we can allow ARC to consume more memory.pjd2007-09-101-2/+2
| | | | | | | | | | | | | | | Tested by: kris Approved by: re (bmah)
* | | Use CTLFLAG_RDTUN for tunable sysctls.pjd2007-09-011-2/+2
| | | | | | | | | | | | Approved by: re (bmah)
* | | When checking the sequence number of a TCP header embedded in andhartmei2007-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICMP error message, do not access th_flags. The field is beyond the first eight bytes of the header that are required to be present and were pulled up in the mbuf. A random value of th_flags can have TH_SYN set, which made the sequence number comparison not apply the window scaling factor, which led to legitimate ICMP(v6) packets getting blocked with "BAD ICMP" debug log messages (if enabled with pfctl -xm), thus breaking PMTU discovery. Triggering the bug requires TCP window scaling to be enabled (sysctl net.inet.tcp.rfc1323, enabled by default) on both end- points of the TCP connection. Large scaling factors increase the probability of triggering the bug. PR: kern/115413: [ipv6] ipv6 pmtu not working Tested by: Jacek Zapala Reviewed by: mlaier Approved by: re (kensmith)
* | | Replace references to NET_CALLOUT_MPSAFE with CALLOUT_MPSAFE, and removerwatson2007-07-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | definition of NET_CALLOUT_MPSAFE, which is no longer required now that debug.mpsafenet has been removed. The once over: bz Approved by: re (kensmith)
* | | Update assertion after revision 1.23.pjd2007-07-241-1/+1
| | | | | | | | | | | | | | | Reviewed by: dfr Approved by: re (rwatson)
* | | Fix a bug where the callout might not be initialized before being used.njl2007-07-121-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rev 1.9 introduced another path where machclk_freq would be initialized before the rest of setup was done (i.e. initializing the callout). Make the one-time initialization a separate function and make init_machclk() able to be called multiple times, any time. We depend on tsc_freq first being updated from the highest priority eventhandler, thus we run last and call init_machclk() to set machclk_freq. Also, don't initialize static variables to 0. Tested by: Eygene Ryabinkin Approved by: re
* | | This commit was generated by cvs2svn to compensate for changes in r171364,harti2007-07-111-7/+7
|\ \ \ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches.
| * | | Vendor patch to remove some __inline qualifiers on non-static functionsharti2007-07-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | because they seem to cause warnings in gcc-4.2. Submitted by: mjacob Approved by: re
* | | | Correct a reference-counting mistake in the ZFS code which led to abnormaldfr2007-07-092-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | memory usage and pessimal cache performance. Reviewed by: pjd Approved by: re (rwatson)
OpenPOWER on IntegriCloud