summaryrefslogtreecommitdiffstats
path: root/sys/nfs
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r291527rmacklem2015-12-141-0/+1
| | | | | | | | | | | | | | | | Add kernel support to the NFS server for the "-manage-gids" option that will be added to the nfsuserd daemon in a future commit. It modifies the cache used by NFSv4 for name<-->id translation (both username/uid and group/gid) to support this. When "-manage-gids" is set, the server looks up each uid for the RPC and uses the list of groups cached in the server instead of the list of groups provided in the RPC request. The cached group list is acquired for the cache by the nfsuserd daemon via getgrouplist(3). This avoids the 16 groups limit for the list in the RPC request. Since the cache is now used for every RPC when "-manage-gids" is enabled, the code also modifies the cache to use a separate mutex for each hash list instead of a single global mutex.
* MFC r267479:mav2014-06-221-19/+21
| | | | Fix/improve fhe_stats sysctl output.
* MFC r267221, r267278:mav2014-06-221-7/+3
| | | | | | | Introduce new per-thread lock to protect the list of requests. This allows to slightly simplify svc_run_internal() code: if we processed all the requests in a queue, then we know that new one will not appear.
* Merge r262763, r262767, r262771, r262806 from head:glebius2014-03-211-1/+1
| | | | | | | | | | - Remove rt_metrics_lite and simply put its members into rtentry. - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode.
* MFC r260097:mav2014-01-222-76/+76
| | | | | | | Move most of NFS file handle affinity code out of the heavily congested global RPC thread pool lock and protect it with own set of locks. On synthetic benchmarks this improves peak NFS request rate by 40%.
* MFC r259765:mav2014-01-222-5/+2
| | | | | | | | | | | | Fix RPC server threads file handle affinity to work better with ZFS. Instead of taking 8 specific bytes of file handle to identify file during RPC thread affitinity handling, use trivial hash of the full file handle. ZFS's struct zfid_short does not have padding field after the length field, as result, originally picked 8 bytes are loosing lower 16 bits of object ID, causing many false matches and unneeded requests affinity to same thread. This fix substantially improves NFS server latency and scalability in SPEC NFS benchmark by more flexible use of multiple NFS threads.
* MFC r259659, r259662:mav2014-01-221-16/+1
| | | | | | | | | | | | | Remove several linear list traversals per request from RPC server code. Do not insert active ports into pool->sp_active list if they are success- fully assigned to some thread. This makes that list include only ports that really require attention, and so traversal can be reduced to simple taking the first one. Remove idle thread from pool->sp_idlethreads list when assigning some work (port of requests) to it. That again makes possible to replace list traversals with simple taking the first element.
* Changes to allow using BOOTP_NFSROOT and mounting an nfs root filesystemian2013-07-311-19/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other than the one specified by the BOOTP server. This configures NFS using the BOOTP protocol while also respecting other root-path options such as setting vfs.root.mountfrom in the environment or using the RB_DFLTROOT boot option. It allows you to override the root path provided by the server, or to supply a root path when the server provides IP configuration but no root path info. This maintains the historical BOOTP_NFSROOT behavior of panicking on a failure to mount the root path provided by the server, unless you've provided an alternative via the ROOTDEVNAME kernel option or by setting vfs.root.mountfrom. The behavior of panicking when given no other options is preserved because it amounts to a bit of a retry loop that could eventually recover from a transient network or server problem. The user can now override the root path from loader(8) even if the kernel is compiled with BOOTP_NFSROOT. If vfs.root.mountfrom is set in the environment it is used unconditionally -- it always overrides the BOOTP info. If it begins with [old]nfs: then the BOOTP code uses it instead of the server-provided info. If it specifies some other filesystem then the bootp code will not panic like it used to and the code in vfs_mountroot.c will invoke the right filesystem to do the mount. If the kernel is compiled with the ROOTDEVNAME option, then that name is used by the BOOTP code if either * The server doesn't provide a pathname. * The boothowto flags include RB_DFLTROOT. The latter allows the user to compile in alternate path in ROOTDEVNAME such as ufs:/dev/da0s1a and boot from that path by setting boot_dftlroot=1 in loader(8) or using the '-r' option in boot(8). The one thing not provided here is automatic failover from a server-provided path to a compiled-in one without the user manually requesting that. The code just isn't currently structured in a way that makes that possible with a lot of rewrite. I think the ability to set vfs.root.mountfrom and to use ROOTDEVNAME automatically when the server doesn't provide a name covers the most common needs. A set of patches submitted by Lars Eggert provided the part I couldn't figure out by myself when I tried to do this last year; many thanks. Reviewed by: rodrigc
* Move the NFS FHA (File Handle Affinity) code from sys/nfsserver token2013-04-172-0/+668
| | | | | | | | sys/nfs, since it is now shared by the two NFS servers. Suggested by: rmacklem Sponsored by: Spectra Logic MFC after: 2 weeks
* Use m_get() and m_getcl() instead of compat macros.glebius2013-03-151-2/+2
|
* Functions m_getm2() and m_get2() have different order of arguments,glebius2013-03-121-1/+1
| | | | | | | and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later.
* Use m_get2() to get mbuf of appropriate size.glebius2013-03-121-3/+1
| | | | Sponsored by: Nginx, Inc.
* Remove the unused nfs_curusec().jhb2013-01-172-10/+0
|
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-052-8/+8
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Add an nfssvc() option to the kernel for the new NFS clientrmacklem2012-12-022-2/+10
| | | | | | | | which dumps out the actual options being used by an NFS mount. This will be used to implement a "-m" option for nfsstat(1). Reviewed by: alfred MFC after: 2 weeks
* Add two new options to the nfssvc(2) syscall that allowrmacklem2012-10-142-1/+4
| | | | | | | | | | processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Reviewed by: kib MFC after: 2 weeks
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* - Typo fixgonzo2012-08-161-3/+6
| | | | | | - style(9) fix Spotted by: kib@, Andrey Zonov
* Merge somewhat modified r230399 from projects/armv6:gonzo2012-08-161-0/+16
| | | | | | | | | | Add timeout to wait for network controllers to appear when netbooting. USB ethernet adapter initialization usually is delayed and they're not available immidiately after autoconfiguration. So we need to wait a bit before giving up Reviewed by: stas@
* Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:bz2012-02-171-4/+3
| | | | | | | | | | | | Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days
* Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl()glebius2011-12-131-236/+177
| | | | | | | | | | | | | usage, but end up with more changes. - Use SIOCAIFADDR instead of old rusty SIOCSIFADDR, SIOCSIFBRDADDR and SIOCSIFNETMASK. - Use queue(9) instead of hand made stailq. - Use one socket for all ifioctl() and send/receive operations. - Use __func__ instead of cut-n-paste in logging and panics. - Axe some dead or strange code. Tested by: gonzo, Stefan Bethke <stb lassitu.de>
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-2/+3
| | | | This means that their use is restricted to a single C file.
* In order to maximize the re-usability of kernel code in user space thiskmacy2011-09-161-1/+1
| | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
* Set proper root device name when legacy NFS client is compiled into kernel.gber2011-06-291-0/+4
| | | | Approved by: cognet (mentor)
* Change the sysctl naming for the old and new NFS clientsrmacklem2011-05-151-1/+1
| | | | | to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes the default nfs client use vfs.nfs.xxx after r221124.
* Move sys/nfsclient/nfs_kdtrace.h to sys/nfs/nfs_kdtrace.h sormacklem2011-05-061-0/+120
| | | | it can be used by the new NFS client as well as the old one.
* Modify the NFS nfssvc(2) syscall so that it allowsrmacklem2011-05-051-3/+6
| | | | | | anyone to get the statistics for the new NFS subsystem. MFC after: 2 weeks
* Add kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATSrmacklem2011-05-041-0/+2
| | | | | | | so that they can be used by nfsstat(1) to implement the "-z" option for the new NFS subsystem. MFC after: 2 weeks
* Revert r221306, since NFSSVC_ZEROSTATS zero'd both client andrmacklem2011-05-041-1/+0
| | | | | server stats, when separate modifiers for NFSSVC_GETSTATS for each of client and server stats is what it required by nfsstat(1).
* Implemented a mount option "nocto" that disables cache coherencyru2011-05-041-0/+2
| | | | | | | | checking at open time. It may improve performance for read-only NFS mounts. Use deliberately. MFC after: 1 week Reviewed by: rmacklem, jhb (earlier version)
* Add the kernel support needed to zero out the nfsstatsrmacklem2011-05-011-0/+1
| | | | | | | structure for the new NFS subsystem. This will be used by nfsstats.c to implement the "-z" option. MFC after: 2 weeks
* Fix the experimental NFS client so that it does not boguslyrmacklem2011-04-255-0/+2907
| | | | | | | | | | | | | | set the f_flags field of "struct statfs". This had the interesting effect of making the NFSv4 mounts "disappear" after r221014, since NFSMNT_NFSV4 and MNT_IGNORE became the same bit. Move the files used for a diskless NFS root from sys/nfsclient to sys/nfs in preparation for them to be used by both NFS clients. Also, move the declaration of the three global data structures from sys/nfsclient/nfs_vfsops.c to sys/nfs/nfs_diskless.c so that they are defined when either client uses them. Reviewed by: jhb MFC after: 2 weeks
* Modify the experimental NFSv4 server so that it posts a SIGUSR2rmacklem2011-01-142-1/+2
| | | | | | | | | | | signal to the master nfsd daemon whenever the stable restart file has been modified. This will allow the master nfsd daemon to maintain an up to date backup copy of the file. This is enabled via the nfssvc() syscall, so that older nfsd daemons will not be signaled. Reviewed by: jhb MFC after: 1 week
* Fix the nlm so that it no longer depends on the regularrmacklem2011-01-032-2/+5
| | | | | | | | nfs client and, as such, can be loaded for the experimental nfs client without the regular client. Reviewed by: jhb MFC after: 2 weeks
* Fix the type of the 3rd argument for nm_getinfo so that it worksrmacklem2010-10-191-1/+1
| | | | | | | for architectures like sparc64. Suggested by: kib MFC after: 2 weeks
* Modify the NFS clients and the NLM so that the NLM can be usedrmacklem2010-10-193-5/+60
| | | | | | | | | | | | | by both clients. Since the NLM uses various fields of the nfsmount structure, those fields were extracted and put in a separate nfs_mountcommon structure stored in sys/nfs/nfs_mountcommon.h. This structure also has a function pointer for a function that extracts the required information from the mount point and nfs vnode for that particular client, for information stored differently by the clients. Reviewed by: jhb MFC after: 2 weeks
* Move sys/nfsclient/nfs_lock.c into sys/nfs and build it as a separatermacklem2010-07-242-0/+486
| | | | | | | | | | | module that can be used by both the regular and experimental nfs clients. This fixes the problem reported by jh@ where /dev/nfslock would be registered twice when both nfs clients were used. I also defined the size of the lm_fh field to be the correct value, as it should be the maximum size of an NFSv3 file handle. Reviewed by: jh MFC after: 2 weeks
* Factor out the code shared between NFS client and server into its ownmarius2010-02-161-5/+15
| | | | | | | | module. With r203732 it became apparent that creating the sysctl nodes twice causes at least a warning, however the whole code shouldn't be present twice in the first place. Discussed with: rmacklem
* - Move nfs_realign() from the NFS client to the shared NFS code andmarius2010-02-092-0/+68
| | | | | | | | | | | | | | | | | remove the NFS server version in order to reduce code duplication. The shared version now uses a second parameter how, which is passed on to m_get(9) and m_getcl(9) as the server used M_WAIT while the client requires M_DONTWAIT, and replaces the the previously unused parameter hsiz. - Change nfs_realign() to use nfsm_aligned() so as with other NFS code the alignment check isn't actually performed on platforms without strict alignment requirements for performance reasons because as the comment suggests unaligned data only occasionally occurs with TCP. - Change fha_extract_info() to use nfs_realign() with M_DONTWAIT rather than M_WAIT because it's called with the RPC sp_lock held. Reviewed by: jhb, rmacklem MFC after: 1 week
* Some style(9) fixesmarius2010-02-092-22/+24
|
* Revert rev 192323 (nfs_common.c only):marcel2009-07-121-3/+2
| | | | | | | | | | | | | | | | | The D-cache flushing added here was to deal with I-cache incoherency observed on ia64. However, the problem was in the implementation of pmap_enter_object() for ia64: it was missing I-cache coherency logic for prefaulted pages. After this got added in rev 195625, testing showed that no D-cache flushing was required. The SIGILL that was observed on Book-E (see commit log for rev 192323) ended up not being related to I-cache incoherency, but was found to be caused by bad memory. This discovery further undermined the need for D-cache flushing in the NFS I/O code, triggering the reversal. Approved by: re (kensmith)
* Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.dfr2009-06-302-109/+0
| | | | Approved by: re
* Replace AUDIT_ARG() with variable argument macros with a set more morerwatson2009-06-271-1/+1
| | | | | | | | | | | | | | specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week
* Add cpu_flush_dcache() for use after non-DMA based I/O so that amarcel2009-05-181-2/+3
| | | | | | | | | | | | | | | | | | | | | possible future I-cache coherency operation can succeed. On ARM for example the L1 cache can be (is) virtually mapped, which means that any I/O that uses temporary mappings will not see the I-cache made coherent. On ia64 a similar behaviour has been observed. By flushing the D-cache, execution of binaries backed by md(4) and/or NFS work reliably. For Book-E (powerpc), execution over NFS exhibits SIGILL once in a while as well, though cpu_flush_dcache() hasn't been implemented yet. Doing an explicit D-cache flush as part of the non-DMA based I/O read operation eliminates the need to do it as part of the I-cache coherency operation itself and as such avoids pessimizing the DMA-based I/O read operations for which D-cache are already flushed/invalidated. It also allows future optimizations whereby the bcopy() followed by the D-cache flush can be integrated in a single operation, which could be implemented using on-chips DMA engines, by-passing the D-cache altogether.
* Adding sys/nfs/nfssvc.h and sys/nfs/nfs_nfssvc.c in preparation forrmacklem2009-04-072-0/+220
| | | | | | | | | | | sharing of the nfssvc() system call between nfsserver and the nfsv4 server. Building of nfs_nfssvc.c will be committed later, at the time the .c files in sys/nfsserver are updated. To do so now would result in nfssvc() multiply defined. Submitted by: rmacklem Reviewed by: dfr Approved by: kib (mentor)
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.ru2008-03-251-2/+2
| | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
* NFSv4 client:rees2006-11-281-15/+17
| | | | | Add support for va_birthtime Fix va_ctime to use TIME_METADATA, not TIME_CREATE
* Fixes for NFS crashes on architectures that require strict alignment.ps2005-07-142-3/+18
| | | | | | | | | | - Fix nfsm_disct() so that after pulling up data, the remaining data is aligned if necessary. - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the mbuf (instead of casting m_data to a uint32). Submitted by: Pyun YongHyeon Reviewed by: Mohan Srinivasan
* /* -> /*- for license, minor formatting changesimp2005-01-075-5/+5
|
OpenPOWER on IntegriCloud