MAKEDEV: Add MAKEDEV glue for the ti(4) device nodes. ti.4: Update the ti(4) man page to include information on the TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options, and also include information about the new character device interface and the associated ioctls. man9/Makefile: Add jumbo.9 and zero_copy.9 man pages and associated links. jumbo.9: New man page describing the jumbo buffer allocator interface and operation. zero_copy.9: New man page describing the general characteristics of the zero copy send and receive code, and what an application author should do to take advantage of the zero copy functionality. NOTES: Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS, TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT. conf/files: Add uipc_jumbo.c and uipc_cow.c. conf/options: Add the 5 options mentioned above. kern_subr.c: Receive side zero copy implementation. This takes "disposable" pages attached to an mbuf, gives them to a user process, and then recycles the user's page. This is only active when ZERO_COPY_SOCKETS is turned on and the kern.ipc.zero_copy.receive sysctl variable is set to 1. uipc_cow.c: Send side zero copy functions. Takes a page written by the user and maps it copy on write and assigns it kernel virtual address space. Removes copy on write mapping once the buffer has been freed by the network stack. uipc_jumbo.c: Jumbo disposable page allocator code. This allocates (optionally) disposable pages for network drivers that want to give the user the option of doing zero copy receive. uipc_socket.c: Add kern.ipc.zero_copy.{send,receive} sysctls that are enabled if ZERO_COPY_SOCKETS is turned on. Add zero copy send support to sosend() -- pages get mapped into the kernel instead of getting copied if they meet size and alignment restrictions. uipc_syscalls.c:Un-staticize some of the sf* functions so that they can be used elsewhere. (uipc_cow.c) if_media.c: In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid calling malloc() with M_WAITOK. Return an error if the M_NOWAIT malloc fails. The ti(4) driver and the wi(4) driver, at least, call this with a mutex held. This causes witness warnings for 'ifconfig -a' with a wi(4) or ti(4) board in the system. (I've only verified for ti(4)). ip_output.c: Fragment large datagrams so that each segment contains a multiple of PAGE_SIZE amount of data plus headers. This allows the receiver to potentially do page flipping on receives. if_ti.c: Add zero copy receive support to the ti(4) driver. If TI_PRIVATE_JUMBOS is not defined, it now uses the jumbo(9) buffer allocator for jumbo receive buffers. Add a new character device interface for the ti(4) driver for the new debugging interface. This allows (a patched version of) gdb to talk to the Tigon board and debug the firmware. There are also a few additional debugging ioctls available through this interface. Add header splitting support to the ti(4) driver. Tweak some of the default interrupt coalescing parameters to more useful defaults. Add hooks for supporting transmit flow control, but leave it turned off with a comment describing why it is turned off. if_tireg.h: Change the firmware rev to 12.4.11, since we're really at 12.4.11 plus fixes from 12.4.13. Add defines needed for debugging. Remove the ti_stats structure, it is now defined in sys/tiio.h. ti_fw.h: 12.4.11 firmware. ti_fw2.h: 12.4.11 firmware, plus selected fixes from 12.4.13, and my header splitting patches. Revision 12.4.13 doesn't handle 10/100 negotiation properly. (This firmware is the same as what was in the tree previously, with the addition of header splitting support.) sys/jumbo.h: Jumbo buffer allocator interface. sys/mbuf.h: Add a new external mbuf type, EXT_DISPOSABLE, to indicate that the payload buffer can be thrown away / flipped to a userland process. socketvar.h: Add prototype for socow_setup. tiio.h: ioctl interface to the character portion of the ti(4) driver, plus associated structure/type definitions. uio.h: Change prototype for uiomoveco() so that we'll know whether the source page is disposable. ufs_readwrite.c:Update for new prototype of uiomoveco(). vm_fault.c: In vm_fault(), check to see whether we need to do a page based copy on write fault. vm_object.c: Add a new function, vm_object_allocate_wait(). This does the same thing that vm_object allocate does, except that it gives the caller the opportunity to specify whether it should wait on the uma_zalloc() of the object structre. This allows vm objects to be allocated while holding a mutex. (Without generating WITNESS warnings.) vm_object_allocate() is implemented as a call to vm_object_allocate_wait() with the malloc flag set to M_WAITOK. vm_object.h: Add prototype for vm_object_allocate_wait(). vm_page.c: Add page-based copy on write setup, clear and fault routines. vm_page.h: Add page based COW function prototypes and variable in the vm_page structure. Many thanks to Drew Gallatin, who wrote the zero copy send and receive code, and to all the other folks who have tested and reviewed this code over the years.
$FreeBSD$ UFS Extended Attributes Copyright The UFS Extended Attributes implementation is copyright Robert Watson, and is made available under a Berkeley-style license. About UFS Extended Attributes Extended attributes allow the association of additional arbitrary meta-data with files and directories. Extended attributes are defined in the form name=value, where name is an nul-terminated string in the style of a filename, and value is a binary blob of zero or more bytes. The UFS extended attribute service layers support for extended attributes onto a backing file, in the style of the quota implementation, meaning that it requires no underlying format changes in the filesystem. This design choice exchanges simplicity, usability and easy deployment for performance. When defined, extended attribute names exist in a series of disjoint namespaces: currently, two namespaces are defined: EXTATTR_NAMESPACE_SYSTEM and EXTATTR_NAMESPACE_USER. The primary distinction lies in the protection model: USER EAs are protected using the normal inode protections, whereas SYSTEM EAs require privilege to access or modify. Using UFS Extended Attributes Support for UFS extended attributes may be enabled by adding: options UFS_EXTATTR to your kernel configuration file. This allows UFS-based filesystems to support extended attributes, but requires manual administration of EAs using the extattrctl tool, including the starting of EA support for each filesystem, and the enabling of individual attributes for the file system. The extattrctl utility may be used to initialize backing files before first use, to start and stop EA service on a filesystem, and to enable and disable named attributes. The command lines for extattrctl take the following forms: extattrctl start [path] extattrctl stop [path] extattrctl initattr [-f] [-p path] [attrsize] [attrfile] extattrctl enable [path] [attrnamespace] [attrname] [attrfile] extattrctl disable [path] [attrnamespace] [attrname] In each case, [path] is used to indicate the mounted filesystem on which to perform the operation. [attrnamespace] refers to the namespace in which the attribute is being manipulated, and may be "system" or "user". The [attrname] is the attribute name to use for the operation. The [attrfile] argument specifies the attribute backing file to use. When using the "initattr" function to initialize a backing file, the maximum size of attribute data must be defined in bytes using the [attrsize] field. Optionally, the [-p path] argument may be used to indicate to extattrctl that it should pre-allocate space for EA data, rather than creating a sparse backing file. This prevents attribute operations from failing in low disk-space conditions (which can be important when EAs are used for security purposes), but pre-allocation will consume space proportional to the product of the defined maximum attribute size and number of attributes on the specified filesystem. Manual configuration increases administrative overhead, but also introduces the possibility of race conditions during filesystem mount, if EAs are used to support other features, as starting the EAs manually is not atomic with the mount operation. To address this problem, an additional kernel option may be defined to auto-start EAs on a UFS file system based on special directories at mount-time: options UFS_EXTATTR_AUTOSTART If this option is defined, UFS will search for a ".attribute" sub-directory of the filesystem root during the mount operation. If it is found, EA support will be started for the filesystem. UFS will then search for "system" and "user" sub-directories of the ".attribute" directory for any potential backing files, and enable an EA for each valid backing file with the name of the backing file as the attribute name. For example, by creating the following tree, the two EAs, posix1e.acl_access and posix1e.acl_default will be enabled in the system namespace of the root filesystem, reserving space for attribute data: mkdir -p /.attribute/system cd /.attribute/system extattrctl initattr -p / 388 posix1e.acl_access extattrctl initattr -p / 388 posix1e.acl_default On the next mount of the root filesystem, the attributes will be automatically started.