summaryrefslogtreecommitdiffstats
path: root/sys/nfs
Commit message (Collapse)AuthorAgeFilesLines
* MFC r303382:kib2016-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | Provide the getboottime(9) and getboottimebin(9) KPI. MFC r303387: Prevent parallel tc_windup() calls. Keep boottime in timehands, and adjust it from tc_windup(). MFC notes: The boottime and boottimebin globals are still exported from the kernel dyn symbol table in stable/11, but their declarations are removed from sys/time.h. This preserves KBI but not KPI, while all in-tree consumers are converted to getboottime(). The variables are updated after tc_setclock_mtx is dropped, which gives approximately same unlocked bugs as before. The boottime and boottimebin locals in several sys/kern_tc.c functions were renamed by adding the '_x' suffix to avoid name conficts.
* NFS: spelling fixes on comments.pfg2016-04-292-2/+2
| | | | No funcional change.
* Do not try to install a default route for each interface found, becauseian2016-03-271-17/+42
| | | | | | | | | | | | | | | | | only the first one will actually work and all the others just result in errors (which would get printed but otherwise ignored). Instead, wait until we make a choice of which interface will be used to mount the rootfs, and install the default route associated with it (if any). After doing the md_mount() call to obtain the needed info, remove the default route again, and transcribe the route info into the nfs_diskless structure. If the system eventually chooses to mount the nfs rootfs, the default route will be installed again when the nfs_diskless code re-initializes the interface. The theory here is that since we can only have one default route, the one most likely to be correct for mounting the rootfs is the one that was delivered along with the rootpath option.
* Stop setting the default route to the IP of the interface itself when theian2016-03-271-5/+1
| | | | | | | | | | | | | | bootp/dhcp server doesn't provide a router option. Doing so prevents setting defaultrouter=<ip> in rc.conf (it fails because there's already a bogus default route installed by bootpc_init). When an admin wants to use this style of proxy arp on an interface, the proper mechanism is to set the "use-lease-addr-for-default-route" flag in the dhcp server config. That causes the lease address to be delivered in the routers option, and the normal handling of the routers option will then install the self-ip as the default route. PR: 187094
* Switch bootpc_adjust_interface() from returning int to void. Its one callerian2016-03-271-6/+4
| | | | | | doesn't check for errors, and all the errors that can happen result in it calling panic anyway, except for one that's really more of a warning (and is going to disappear on an upcoming commit anyway).
* Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootpian2016-03-271-1/+2
| | | | | | | | | | | | | | | | server (and not when it came from a fallback method such as the ROOTDEVNAME option). This makes the code in bootpc_init() choose the first interface that provided a rootpath name. Previously it was choosing the first interface that got an IP address, which could be on a different and potentially unreachable subnet than the server providing the rootfs. If the rootpath name actually does come from a fallback source, then the code continues to use the first interface in the list that got configured. Note that this wasn't directly reported in the PR cited below, but was discovered while working on that PR. PR: 187094
* If the dhcp server provides an interface-mtu option, parse the value andian2016-03-211-1/+21
| | | | | | | | | | set that mtu on the interface. These changes are based on the patch submitted by Robert Blayzor in the PR, but I changed things around a bit, so the blame for any mistakes belongs to me. PR: 187094
* It appears nfs_mountroot() will use the env var "boot.netif.mtu" if itian2016-03-201-0/+1
| | | | exists, so mention that along with all the other boot.netif vars.
* MFP r287070,r287073: split radix implementation and route table structure.melifaro2016-01-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | There are number of radix consumers in kernel land (pf,ipfw,nfs,route) with different requirements. In fact, first 3 don't have _any_ requirements and first 2 does not use radix locking. On the other hand, routing structure do have these requirements (rnh_gen, multipath, custom to-be-added control plane functions, different locking). Additionally, radix should not known anything about its consumers internals. So, radix code now uses tiny 'struct radix_head' structure along with internal 'struct radix_mask_head' instead of 'struct radix_node_head'. Existing consumers still uses the same 'struct radix_node_head' with slight modifications: they need to pass pointer to (embedded) 'struct radix_head' to all radix callbacks. Routing code now uses new 'struct rib_head' with different locking macro: RADIX_NODE_HEAD prefix was renamed to RIB_ (which stands for routing information base). New net/route_var.h header was added to hold routing subsystem internal data. 'struct rib_head' was placed there. 'struct rtentry' will also be moved there soon.
* Add kernel support to the NFS server for the "-manage-gids"rmacklem2015-11-301-0/+1
| | | | | | | | | | | | | | | | | | | 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. Suggested by: jpaetzel Tested by: jpaetzel MFC after: 2 weeks
* Wait up to 10 seconds for late-initializing network interfaces to arrive.ian2015-09-261-0/+9
| | | | Reviewed by: rmacklem
* Avoid closing unallocated socket in case socreate fails.kan2015-02-281-1/+1
| | | | | | Found by: Brainy Code Scanner Reported by: Maxime Villard <max@M00nBSD.net> MFC after: 2 weeks
* Remove the old NFS client and server from head,rmacklem2014-12-232-410/+0
| | | | | | | | | | | | which means that the NFSCLIENT and NFSSERVER kernel options will no longer work. This commit only removes the kernel components. Removal of unused code in the user utilities will be done later. This commit does not include an addition to UPDATING, but that will be committed in a few minutes. Discussed on: freebsd-fs
* Avoid dynamic syscall overhead for statically compiled modules.mjg2014-10-261-1/+1
| | | | | | | | | | | | | The kernel tracks syscall users so that modules can safely unregister them. But if the module is not unloadable or was compiled into the kernel, there is no need to do this. Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC during kernel build and 0 otherwise. Reviewed by: kib (previous version) MFC after: 2 weeks
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-162-11/+11
| | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe
* Fix/improve fhe_stats sysctl output.mav2014-06-141-19/+21
| | | | MFC after: 2 weeks
* Introduce new per-thread lock to protect the list of requests.mav2014-06-081-7/+3
| | | | | | | 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. MFC after: 2 weeks
* - Remove rt_metrics_lite and simply put its members into rtentry.glebius2014-03-051-1/+1
| | | | | | | | | | | | | | | | - 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. The change is mostly targeted for stable/10 merge. For head, rt_pksent is expected to just disappear. Discussed with: melifaro Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Move most of NFS file handle affinity code out of the heavily congestedmav2013-12-302-76/+76
| | | | | | global RPC thread pool lock and protect it with own set of locks. On synthetic benchmarks this improves peak NFS request rate by 40%.
* Fix RPC server threads file handle affinity to work better with ZFS.mav2013-12-232-5/+2
| | | | | | | | | | | | 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. Sponsored by: iXsystems, Inc.
* Remove several linear list traversals per request from RPC server code.mav2013-12-201-16/+1
| | | | | | | | | | | 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.
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-261-0/+1
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* 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
OpenPOWER on IntegriCloud