diff options
Diffstat (limited to 'share')
181 files changed, 5733 insertions, 1888 deletions
diff --git a/share/examples/Makefile b/share/examples/Makefile index 560fdae6de5b..0a65b8c40d39 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -10,11 +10,11 @@ LDIRS= BSD_daemon \ FreeBSD_version \ bootforth \ csh \ - drivers \ etc \ find_interface \ flua \ indent \ + inotify \ ipfw \ jails \ kld \ @@ -73,12 +73,6 @@ SE_DIRS+= csh SE_CSHPACKAGE= csh SE_CSH= dot.cshrc -SE_DIRS+= drivers -SE_DRIVERS= \ - README \ - make_device_driver.sh \ - make_pseudo_driver.sh - SE_DIRS+= etc SE_ETC= \ README.examples \ @@ -97,6 +91,10 @@ SE_FLUA= libjail.lua SE_DIRS+= indent SE_INDENT= indent.pro +SE_DIRS+= inotify +SE_INOTIFY= inotify.c \ + Makefile + .if ${MK_IPFILTER} != "no" SUBDIR+= ipfilter .endif diff --git a/share/examples/drivers/README b/share/examples/drivers/README deleted file mode 100644 index 8628029a62f8..000000000000 --- a/share/examples/drivers/README +++ /dev/null @@ -1,42 +0,0 @@ - -Author: Julian Elischer - -The files in this directory are shell scripts. - -They will, when run, create an example skeleton driver -for you. You can use this driver as a starting point for -writing drivers for your own devices. They have all the hooks needed -for initialization, probing, attaching, as well as DEVFS -node creation. They also create sample ioctl commands and a sample -ioctl definition .h file in /sys/sys. In other words they are fully -functional in a 'skeleton' sort of a way. They support multiple devices -so that you may have several of your 'foobar' devices probed and attached -at once. - -I expect that these scripts will improve with time. - -At present these scripts also link the newly created driver into -the kernel sources in /sys. Possibly a better way would be -to make them interactive. (and ask what kernel tree to use as well as -a name for the driver.). - -There are presently two scripts. -One for making a real device driver for ISA devices, and -one for making a device driver for pseudo devices (e.g. /dev/null). -Hopefully they will be joined by similar scripts for creating -skeletons for PCI devices as well. - -Give them a single argument: the name of the driver. -They will use this given name in many places within the driver, -both in lower and upper case form. (conforming to normal usage). - -The skeleton driver should already link with the kernel -and in fact the shell script will compile a kernel with the new -drive linked in.. The new kernel should still be -runnable and the new driver should be -fully callable (once you get your device to probe). -You should simply edit the driver and continue to use -'make' (as done in the script) until your driver does what you want. - -The driver will end up in /sys/i386/isa for the device driver script, -and in /sys/dev for the pseudo driver script. diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh index 5b8f8efa6469..d6d3a8d7c6b9 100755 --- a/share/examples/drivers/make_device_driver.sh +++ b/share/examples/drivers/make_device_driver.sh @@ -342,7 +342,8 @@ ${1}_isa_identify (driver_t *driver, device_t parent) if ((ioport == 0) && (irq == 0)) return; /* We've added all our local hints. */ - child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "${1}", -1); + child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "${1}", + DEVICE_UNIT_ANY); bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, NUMPORTS); bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); bus_set_resource(child, SYS_RES_DRQ, 0, res[i].drq, 1); diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh deleted file mode 100644 index 5d6d09aa9648..000000000000 --- a/share/examples/drivers/make_pseudo_driver.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# This writes a skeleton driver and puts it into the kernel tree for you -# -# arg1 is lowercase "foo" -# arg2 path to the kernel sources, "/sys" if omitted -# -# Trust me, RUN THIS SCRIPT :) -# -# -#-------cut here------------------ - -if [ "${1}X" = "X" ] -then - echo "Hey , how about some help here.. give me a device name!" - exit 1 -fi -if [ "X${2}" = "X" ]; then - TOP=`cd /sys; pwd -P` - echo "Using ${TOP} as the path to the kernel sources!" -else - TOP=${2} -fi - -for i in "" "conf" "i386" "i386/conf" "dev" "sys" "modules" -do - if [ -d ${TOP}/${i} ] - then - continue - fi - echo "${TOP}/${i}: no such directory." - echo "Please, correct the error and try again." - exit 1 -done - -UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"` - -if [ -d ${TOP}/modules/${1} ]; then - echo "There appears to already be a module called ${1}" - echo -n "Should it be overwritten? [Y]" - read VAL - if [ "-z" "$VAL" ]; then - VAL=YES - fi - case ${VAL} in - [yY]*) - echo "Cleaning up from prior runs" - rm -rf ${TOP}/dev/${1} - rm -rf ${TOP}/modules/${1} - rm ${TOP}/conf/files.${UPPER} - rm ${TOP}/i386/conf/${UPPER} - rm ${TOP}/sys/${1}io.h - ;; - *) - exit 1 - ;; - esac -fi - -echo "The following files will be created:" -echo ${TOP}/modules/${1} -echo ${TOP}/conf/files.${UPPER} -echo ${TOP}/i386/conf/${UPPER} -echo ${TOP}/dev/${1} -echo ${TOP}/dev/${1}/${1}.c -echo ${TOP}/sys/${1}io.h -echo ${TOP}/modules/${1} -echo ${TOP}/modules/${1}/Makefile - -mkdir ${TOP}/modules/${1} - -cat >${TOP}/conf/files.${UPPER} <<DONE -dev/${1}/${1}.c optional ${1} -DONE - -cat >${TOP}/i386/conf/${UPPER} <<DONE -# Configuration file for kernel type: ${UPPER} - -files "${TOP}/conf/files.${UPPER}" - -include GENERIC - -ident ${UPPER} - -# trust me, you'll need this -options KDB -options DDB -device ${1} -DONE - -if [ ! -d ${TOP}/dev/${1} ]; then - mkdir -p ${TOP}/dev/${1} -fi - -cat >${TOP}/dev/${1}/${1}.c <<DONE -/* - * Copyright (c) [year] [your name] - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * ${1} driver - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> /* SYSINIT stuff */ -#include <sys/uio.h> /* SYSINIT stuff */ -#include <sys/conf.h> /* cdevsw stuff */ -#include <sys/malloc.h> /* malloc region definitions */ -#include <sys/proc.h> -#include <sys/${1}io.h> /* ${1} IOCTL definitions */ - -#include <machine/clock.h> /* DELAY() */ - -#define N${UPPER} 3 /* defines number of instances */ - -/* XXX These should be defined in terms of bus-space ops. */ -#define ${UPPER}_INB(port) inb(port) -#define ${UPPER}_OUTB(port, val) (port, (val)) - -/* Function prototypes (these should all be static) */ -static d_open_t ${1}open; -static d_close_t ${1}close; -static d_read_t ${1}read; -static d_write_t ${1}write; -static d_ioctl_t ${1}ioctl; -static d_mmap_t ${1}mmap; -static d_poll_t ${1}poll; - -#define CDEV_MAJOR 20 -static struct cdevsw ${1}_cdevsw = { - .d_version = D_VERSION, - .d_open = ${1}open, - .d_close = ${1}close, - .d_read = ${1}read, - .d_write = ${1}write, - .d_ioctl = ${1}ioctl, - .d_poll = ${1}poll, - .d_mmap = ${1}mmap, - .d_name = "${1}", -}; - -/* - * device specific Misc defines - */ -#define BUFFERSIZE 1024 -#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ - -/* - * One of these per allocated device - */ -struct ${1}_softc { - u_long iobase; - char buffer[BUFFERSIZE]; - struct cdev *dev; -}; - -typedef struct ${1}_softc *sc_p; - -static sc_p sca[N${UPPER}]; - -/* - * Macro to check that the unit number is valid - * Often this isn't needed as once the open() is performed, - * the unit number is pretty much safe.. The exception would be if we - * implemented devices that could "go away". in which case all these routines - * would be wise to check the number, DIAGNOSTIC or not. - */ -#define CHECKUNIT(RETVAL) \ -do { /* the do-while is a safe way to do this grouping */ \ - if (unit > N${UPPER}) { \ - printf("%s: bad unit %d\n", __func__, unit); \ - return (RETVAL); \ - } \ - if (scp == NULL) { \ - printf("%s: unit %d not attached\n", __func__, unit); \ - return (RETVAL); \ - } \ -} while (0) - -#ifdef DIAGNOSTIC -#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL) -#else /* DIAGNOSTIC */ -#define CHECKUNIT_DIAG(RETVAL) -#endif /* DIAGNOSTIC */ - -static int -${1}ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - switch (cmd) { - case DHIOCRESET: - /* whatever resets it */ - (void)scp; /* Delete this line after using scp. */ -#if 0 - ${UPPER}_OUTB(scp->iobase, 0xff); -#endif - break; - default: - return ENXIO; - } - return (0); -} - -/* - * You also need read, write, open, close routines. - * This should get you started - */ -static int -${1}open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}read(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int toread; - - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * read from buffer - */ - toread = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, toread, uio)); -} - -static int -${1}write(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int towrite; - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * write to buffer - */ - towrite = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, towrite, uio)); -} - -static int -${1}mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(-1); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ -#if 0 /* if we had a frame buffer or whatever.. do this */ - if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) { - return (-1); - } - return i386_btop((FRAMEBASE + offset)); -#else - return (-1); -#endif -} - -static int -${1}poll(struct cdev *dev, int which, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); /* this is the wrong value I'm sure */ -} - -/* - * Now for some driver initialisation. - * Occurs ONCE during boot (very early). - */ -static void -${1}_drvinit(void *unused) -{ - int unit; - sc_p scp; - - for (unit = 0; unit < N${UPPER}; unit++) { - /* - * Allocate storage for this instance . - */ - scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT | M_ZERO); - if( scp == NULL) { - printf("${1}%d failed to allocate strorage\n", unit); - return; - } - sca[unit] = scp; - scp->dev = make_dev(&${1}_cdevsw, unit, - UID_ROOT, GID_KMEM, 0640, "${1}%d", unit); - } -} - -SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR, - ${1}_drvinit, NULL); -DONE - -cat >${TOP}/sys/${1}io.h <<DONE -/* - * Definitions needed to access the ${1} device (ioctls etc) - * see mtio.h , ioctl.h as examples - */ -#ifndef SYS_DHIO_H -#define SYS_DHIO_H - -#ifndef KERNEL -#include <sys/types.h> -#endif -#include <sys/ioccom.h> - -/* - * define an ioctl here - */ -#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */ -#endif -DONE - -if [ ! -d ${TOP}/modules/${1} ]; then - mkdir -p ${TOP}/modules/${1} -fi - -cat >${TOP}/modules/${1}/Makefile <<DONE -# ${UPPER} Loadable Kernel Module - -.PATH: \${.CURDIR}/../../dev/${1} -KMOD = ${1} -SRCS = ${1}.c - -.include <bsd.kmod.mk> -DONE - -echo -n "Do you want to build the '${1}' module? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - (cd ${TOP}/modules/${1}; make depend; make ) - ;; -*) -# exit - ;; -esac - -echo "" -echo -n "Do you want to build the '${UPPER}' kernel? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - ( - cd ${TOP}/i386/conf; \ - config ${UPPER}; \ - cd ${TOP}/i386/compile/${UPPER}; \ - make depend; \ - make; \ - ) - ;; -*) -# exit - ;; -esac - -#--------------end of script--------------- -# -#edit to your taste.. -# -# diff --git a/share/examples/inotify/Makefile b/share/examples/inotify/Makefile new file mode 100644 index 000000000000..c54c629c58d7 --- /dev/null +++ b/share/examples/inotify/Makefile @@ -0,0 +1,6 @@ +PROG= inotify +MAN= + +LIBADD= xo + +.include <bsd.prog.mk> diff --git a/share/examples/inotify/inotify.c b/share/examples/inotify/inotify.c new file mode 100644 index 000000000000..ea63ccd1f337 --- /dev/null +++ b/share/examples/inotify/inotify.c @@ -0,0 +1,172 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Klara, Inc. + */ + +/* + * A simple program to demonstrate inotify. Given one or more paths, it watches + * all events on those paths and prints them to standard output. + */ + +#include <sys/types.h> +#include <sys/event.h> +#include <sys/inotify.h> + +#include <assert.h> +#include <err.h> +#include <limits.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include <libxo/xo.h> + +static void +usage(void) +{ + xo_errx(1, "usage: inotify <path1> [<path2> ...]"); +} + +static const char * +ev2str(uint32_t event) +{ + switch (event & IN_ALL_EVENTS) { + case IN_ACCESS: + return ("IN_ACCESS"); + case IN_ATTRIB: + return ("IN_ATTRIB"); + case IN_CLOSE_WRITE: + return ("IN_CLOSE_WRITE"); + case IN_CLOSE_NOWRITE: + return ("IN_CLOSE_NOWRITE"); + case IN_CREATE: + return ("IN_CREATE"); + case IN_DELETE: + return ("IN_DELETE"); + case IN_DELETE_SELF: + return ("IN_DELETE_SELF"); + case IN_MODIFY: + return ("IN_MODIFY"); + case IN_MOVE_SELF: + return ("IN_MOVE_SELF"); + case IN_MOVED_FROM: + return ("IN_MOVED_FROM"); + case IN_MOVED_TO: + return ("IN_MOVED_TO"); + case IN_OPEN: + return ("IN_OPEN"); + default: + switch (event) { + case IN_IGNORED: + return ("IN_IGNORED"); + case IN_Q_OVERFLOW: + return ("IN_Q_OVERFLOW"); + case IN_UNMOUNT: + return ("IN_UNMOUNT"); + } + warnx("unknown event %#x", event); + assert(0); + } +} + +static void +set_handler(int kq, int sig) +{ + struct kevent kev; + + (void)signal(sig, SIG_IGN); + EV_SET(&kev, sig, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) < 0) + xo_err(1, "kevent"); +} + +int +main(int argc, char **argv) +{ + struct inotify_event *iev, *iev1; + struct kevent kev; + size_t ievsz; + int ifd, kq; + + argc = xo_parse_args(argc, argv); + if (argc < 2) + usage(); + argc--; + argv++; + + ifd = inotify_init1(IN_NONBLOCK); + if (ifd < 0) + xo_err(1, "inotify"); + for (int i = 0; i < argc; i++) { + int wd; + + wd = inotify_add_watch(ifd, argv[i], IN_ALL_EVENTS); + if (wd < 0) + xo_err(1, "inotify_add_watch(%s)", argv[i]); + } + + xo_set_version("1"); + xo_open_list("events"); + + kq = kqueue(); + if (kq < 0) + xo_err(1, "kqueue"); + + /* + * Handle signals in the event loop so that we can close the xo list. + */ + set_handler(kq, SIGINT); + set_handler(kq, SIGTERM); + set_handler(kq, SIGHUP); + set_handler(kq, SIGQUIT); + + /* + * Monitor the inotify descriptor for events. + */ + EV_SET(&kev, ifd, EVFILT_READ, EV_ADD, 0, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) < 0) + xo_err(1, "kevent"); + + ievsz = sizeof(*iev) + NAME_MAX + 1; + iev = malloc(ievsz); + if (iev == NULL) + err(1, "malloc"); + + for (;;) { + ssize_t n; + const char *ev; + + if (kevent(kq, NULL, 0, &kev, 1, NULL) < 0) + xo_err(1, "kevent"); + if (kev.filter == EVFILT_SIGNAL) + break; + + n = read(ifd, iev, ievsz); + if (n < 0) + xo_err(1, "read"); + assert(n >= (ssize_t)sizeof(*iev)); + + for (iev1 = iev; n > 0;) { + assert(n >= (ssize_t)sizeof(*iev1)); + + ev = ev2str(iev1->mask); + xo_open_instance("event"); + xo_emit("{:wd/%3d} {:event/%16s} {:name/%s}\n", + iev1->wd, ev, iev1->len > 0 ? iev1->name : ""); + xo_close_instance("event"); + + n -= sizeof(*iev1) + iev1->len; + iev1 = (struct inotify_event *)(void *) + ((char *)iev1 + sizeof(*iev1) + iev1->len); + } + (void)xo_flush(); + } + + xo_close_list("events"); + + if (xo_finish() < 0) + xo_err(1, "stdout"); + exit(0); +} diff --git a/share/examples/oci/Containerfile.pkg b/share/examples/oci/Containerfile.pkg index 074c470affc9..f6699c79af71 100644 --- a/share/examples/oci/Containerfile.pkg +++ b/share/examples/oci/Containerfile.pkg @@ -6,7 +6,7 @@ ARG version=14.snap # Select freebsd-runtime as our starting point. -FROM localhost/freebsd-runtime:${version} +FROM ghcr.io/freebsd/freebsd-runtime:${version} # A list of package(s) to install ARG packages @@ -15,7 +15,10 @@ ARG packages # use for downloading pkg since the freebsd-runtime image has both FreeBSD and # FreeBSD-base pkg repo configs installed and FreeBSD-base does not contain the # pkg package. -RUN env ASSUME_ALWAYS_YES=yes pkg bootstrap -r FreeBSD && pkg update +# +# Set IGNORE_OSVERSION to allow building e.g. FreeBSD-14 images on +# FreeBSD-15 hosts. +RUN pkg bootstrap -y -r FreeBSD && pkg -o IGNORE_OSVERSION=yes update -f # Install some package(s). RUN pkg install -y ${packages} diff --git a/share/man/man1/Makefile b/share/man/man1/Makefile index e5ab6597ead2..d3975c8e8084 100644 --- a/share/man/man1/Makefile +++ b/share/man/man1/Makefile @@ -1,16 +1,17 @@ .include <src.opts.mk> -MAN= builtin.1 intro.1 +MANGROUPS= MAN -.if ${MK_TESTS} != "no" -ATF= ${SRCTOP}/contrib/atf -.PATH: ${ATF}/doc -MAN+= atf-test-program.1 -.endif +MANLINKS= intro.1 introduction.1 + +MANGROUPS+= RUNTIME +RUNTIME= builtin.1 intro.1 +RUNTIMEPACKAGE= runtime # Create MLINKS for Shell built in commands for which there are no userland # utilities of the same name: -MLINKS= builtin.1 alias.1 \ +RUNTIMELINKS=\ + builtin.1 alias.1 \ builtin.1 alloc.1 \ builtin.1 bg.1 \ builtin.1 bind.1 \ @@ -55,6 +56,7 @@ MLINKS= builtin.1 alias.1 \ builtin.1 if.1 \ builtin.1 jobid.1 \ builtin.1 jobs.1 \ + builtin.1 keybinds.1 \ builtin.1 limit.1 \ builtin.1 log.1 \ builtin.1 logout.1 \ @@ -95,6 +97,13 @@ MLINKS= builtin.1 alias.1 \ builtin.1 wait.1 \ builtin.1 where.1 \ builtin.1 while.1 -MLINKS+=intro.1 introduction.1 + +.if ${MK_TESTS} != "no" +MANGROUPS+= TESTS +ATF= ${SRCTOP}/contrib/atf +.PATH: ${ATF}/doc +TESTS= atf-test-program.1 +TESTSPACKAGE= tests +.endif .include <bsd.prog.mk> diff --git a/share/man/man1/builtin.1 b/share/man/man1/builtin.1 index d546548ab4e5..ee89006caea5 100644 --- a/share/man/man1/builtin.1 +++ b/share/man/man1/builtin.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 Sheldon Hearn .\" .\" All rights reserved. @@ -24,175 +26,33 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 21, 2010 +.Dd March 29, 2025 .Dt BUILTIN 1 .Os .Sh NAME .Nm builtin , -.Nm \&! , -.Nm % , -.Nm \&. , -.Nm \&: , -.Nm @ , -.Nm \&[ , -.Nm { , -.Nm } , -.Nm alias , -.Nm alloc , -.Nm bg , -.Nm bind , -.Nm bindkey , -.Nm break , -.Nm breaksw , -.Nm builtins , -.Nm case , -.Nm cd , -.Nm chdir , -.Nm command , -.Nm complete , -.Nm continue , -.Nm default , -.Nm dirs , -.Nm do , -.Nm done , -.Nm echo , -.Nm echotc , -.Nm elif , -.Nm else , -.Nm end , -.Nm endif , -.Nm endsw , -.Nm esac , -.Nm eval , -.Nm exec , -.Nm exit , -.Nm export , -.Nm false , -.Nm fc , -.Nm fg , -.Nm filetest , -.Nm fi , -.Nm for , -.Nm foreach , -.Nm getopts , -.Nm glob , -.Nm goto , -.Nm hash , -.Nm hashstat , -.Nm history , -.Nm hup , -.Nm if , -.Nm jobid , -.Nm jobs , -.Nm kill , -.Nm limit , -.Nm local , -.Nm log , -.Nm login , -.Nm logout , -.Nm ls-F , -.Nm nice , -.Nm nohup , -.Nm notify , -.Nm onintr , -.Nm popd , -.Nm printenv , -.Nm printf , -.Nm pushd , -.Nm pwd , -.Nm read , -.Nm readonly , -.Nm rehash , -.Nm repeat , -.Nm return , -.Nm sched , -.Nm set , -.Nm setenv , -.Nm settc , -.Nm setty , -.Nm setvar , -.Nm shift , -.Nm source , -.Nm stop , -.Nm suspend , -.Nm switch , -.Nm telltc , -.Nm test , -.Nm then , -.Nm time , -.Nm times , -.Nm trap , -.Nm true , -.Nm type , -.Nm ulimit , -.Nm umask , -.Nm unalias , -.Nm uncomplete , -.Nm unhash , -.Nm unlimit , -.Nm unset , -.Nm unsetenv , -.Nm until , -.Nm wait , -.Nm where , -.Nm which , -.Nm while -.Nd shell built-in commands +.Nm keybinds +.Nd index of FreeBSD shell built-in commands .Sh SYNOPSIS -See the built-in command description in the appropriate shell manual page. +See the manual for your shell for operation details. .Sh DESCRIPTION -Shell builtin commands are commands that can be executed within the -running shell's process. -Note that, in the case of -.Xr csh 1 -builtin commands, the command is executed in a subshell if it occurs as -any component of a pipeline except the last. -.Pp -If a command specified to the shell contains a slash -.Ql / , -the shell will not execute a builtin command, even if the last component -of the specified command matches the name of a builtin command. -Thus, while specifying -.Dq Li echo -causes a builtin command to be executed under shells that support the -.Nm echo -builtin command, -specifying -.Dq Li /bin/echo -or -.Dq Li ./echo -does not. -.Pp -While some builtin commands may exist in more than one shell, their -operation may be different under each shell which supports them. -Below is a table which lists shell builtin commands, the standard shells -that support them and whether they exist as standalone utilities. -.Pp -Only builtin commands for the +This page provides an index of +.Nm +commands, keywords, and keyboard bindings provided by .Xr csh 1 and -.Xr sh 1 -shells are listed here. -Consult a shell's manual page for -details on the operation its builtin commands. -Beware that the -.Xr sh 1 -manual page, at least, calls some of these commands -.Dq built-in commands -and some of them -.Dq reserved words . -Users of other shells may need to consult an -.Xr info 1 -page or other sources of documentation. -.Pp -Commands marked -.Dq Li No** -under -.Em External -do exist externally, -but are implemented as scripts using a builtin command of the same name. -.Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent -.It Em Command Ta Em External Ta Xr csh 1 Ta Xr sh 1 +.Xr sh 1 , +the command line interpreters which comprise the +.Bx +user environment. +.Ss Commands +Below is a table which lists +.Nm +commands and keywords, +whether they exist as standalone utilities, +and the standard shells that provide them. +.Bl -column "uncomplete" "Standalone" "csh(1)" "sh(1)" -offset indent +.It Em Command Ta Em Standalone Ta Xr csh 1 Ta Xr sh 1 .It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No .It Ic \&. Ta \&No Ta \&No Ta Yes @@ -201,9 +61,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes -.It Ic alias Ta No** Ta Yes Ta Yes +.It Ic alias Ta No* Ta Yes Ta Yes .It Ic alloc Ta \&No Ta Yes Ta \&No -.It Ic bg Ta No** Ta Yes Ta Yes +.It Ic bg Ta No* Ta Yes Ta Yes .It Ic bind Ta \&No Ta \&No Ta Yes .It Ic bindkey Ta \&No Ta Yes Ta \&No .It Ic break Ta \&No Ta Yes Ta Yes @@ -211,9 +71,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic builtin Ta \&No Ta \&No Ta Yes .It Ic builtins Ta \&No Ta Yes Ta \&No .It Ic case Ta \&No Ta Yes Ta Yes -.It Ic cd Ta No** Ta Yes Ta Yes +.It Ic cd Ta No* Ta Yes Ta Yes .It Ic chdir Ta \&No Ta Yes Ta Yes -.It Ic command Ta No** Ta \&No Ta Yes +.It Ic command Ta No* Ta \&No Ta Yes .It Ic complete Ta \&No Ta Yes Ta \&No .It Ic continue Ta \&No Ta Yes Ta Yes .It Ic default Ta \&No Ta Yes Ta \&No @@ -233,22 +93,22 @@ but are implemented as scripts using a builtin command of the same name. .It Ic exit Ta \&No Ta Yes Ta Yes .It Ic export Ta \&No Ta \&No Ta Yes .It Ic false Ta Yes Ta \&No Ta Yes -.It Ic fc Ta No** Ta \&No Ta Yes -.It Ic fg Ta No** Ta Yes Ta Yes +.It Ic fc Ta No* Ta \&No Ta Yes +.It Ic fg Ta No* Ta Yes Ta Yes .It Ic filetest Ta \&No Ta Yes Ta \&No .It Ic fi Ta \&No Ta \&No Ta Yes .It Ic for Ta \&No Ta \&No Ta Yes .It Ic foreach Ta \&No Ta Yes Ta \&No -.It Ic getopts Ta No** Ta \&No Ta Yes +.It Ic getopts Ta No* Ta \&No Ta Yes .It Ic glob Ta \&No Ta Yes Ta \&No .It Ic goto Ta \&No Ta Yes Ta \&No -.It Ic hash Ta No** Ta \&No Ta Yes +.It Ic hash Ta No* Ta \&No Ta Yes .It Ic hashstat Ta \&No Ta Yes Ta \&No .It Ic history Ta \&No Ta Yes Ta \&No .It Ic hup Ta \&No Ta Yes Ta \&No .It Ic if Ta \&No Ta Yes Ta Yes .It Ic jobid Ta \&No Ta \&No Ta Yes -.It Ic jobs Ta No** Ta Yes Ta Yes +.It Ic jobs Ta No* Ta Yes Ta Yes .It Ic kill Ta Yes Ta Yes Ta Yes .It Ic limit Ta \&No Ta Yes Ta \&No .It Ic local Ta \&No Ta \&No Ta Yes @@ -265,7 +125,7 @@ but are implemented as scripts using a builtin command of the same name. .It Ic printf Ta Yes Ta \&No Ta Yes .It Ic pushd Ta \&No Ta Yes Ta \&No .It Ic pwd Ta Yes Ta \&No Ta Yes -.It Ic read Ta No** Ta \&No Ta Yes +.It Ic read Ta No* Ta \&No Ta Yes .It Ic readonly Ta \&No Ta \&No Ta Yes .It Ic rehash Ta \&No Ta Yes Ta \&No .It Ic repeat Ta \&No Ta Yes Ta \&No @@ -288,26 +148,68 @@ but are implemented as scripts using a builtin command of the same name. .It Ic times Ta \&No Ta \&No Ta Yes .It Ic trap Ta \&No Ta \&No Ta Yes .It Ic true Ta Yes Ta \&No Ta Yes -.It Ic type Ta No** Ta \&No Ta Yes -.It Ic ulimit Ta No** Ta \&No Ta Yes -.It Ic umask Ta No** Ta Yes Ta Yes -.It Ic unalias Ta No** Ta Yes Ta Yes +.It Ic type Ta No* Ta \&No Ta Yes +.It Ic ulimit Ta No* Ta \&No Ta Yes +.It Ic umask Ta No* Ta Yes Ta Yes +.It Ic unalias Ta No* Ta Yes Ta Yes .It Ic uncomplete Ta \&No Ta Yes Ta \&No .It Ic unhash Ta \&No Ta Yes Ta \&No .It Ic unlimit Ta \&No Ta Yes Ta \&No .It Ic unset Ta \&No Ta Yes Ta Yes .It Ic unsetenv Ta \&No Ta Yes Ta \&No .It Ic until Ta \&No Ta \&No Ta Yes -.It Ic wait Ta No** Ta Yes Ta Yes +.It Ic wait Ta No* Ta Yes Ta Yes .It Ic where Ta \&No Ta Yes Ta \&No .It Ic which Ta Yes Ta Yes Ta \&No .It Ic while Ta \&No Ta Yes Ta Yes .El +.Pp +\&No*: Commands marked +.Ql No* +exist externally, but are implemented as scripts using a +.Nm +command of the same name. +.Ss Keybinds +The command line environment also provides the following +default keyboard bindings: +.Bl -column "Process Info (SIGINFO)" "^M | ^J" "^M | ^J" -offset indent +.It Em Signal Ta Xr csh 1 Ta Xr sh 1 +.It Ic Backspace Ta ^H Ta ^H +.It Ic Carriage Return Ta ^M | ^J Ta ^M | ^J +.It Ic Tab Ta ^I Ta ^I +.It Ic Beginning of Line Ta ^A Ta ^A +.It Ic End of Line Ta ^E Ta ^E +.It Ic Cursor Forward Ta ^F Ta ^F +.It Ic Cursor Backward Ta ^B Ta ^B +.It Ic Clear Screen Ta ^L Ta ^L +.It Ic Cut Line Ta ^U Ta ^U +.It Ic Cut Word Backwards Ta ^W Ta ^W +.It Ic Cut Rest of Line Ta ^K Ta ^K +.It Ic Paste Last Cut Ta ^Y Ta ^Y +.It Ic Typo Ta ^T Ta ^T +.It End of File Po Ic EOF Pc Ta ^D Ta ^D +.It Interupt Po Ic SIGINT Pc Ta ^C Ta ^C +.It Process info Po Ic SIGINFO Pc Ta ^T Ta ^T +.It Ic Search History Ta \&No Ta ^R +.It Ic Exit Search History Ta \&No Ta ^G +.It Ic Previous Command Ta ^P Ta ^P +.It Ic Next Command Ta ^N Ta ^N +.It Ic Print Next Character Ta ^V Ta ^V +.It Ic Pause Job Ta ^S Ta ^S +.It Ic Resume Job Ta ^Q Ta ^Q +.It Suspend Job Ic (SIGTSTP) Ta ^Z Ta ^Z +.It Ic Scrollback Mode Ta ScrLk* Ta ScrLk* +.El +.Pp +\&*: Bindings marked +.Ql * +are provided by +.Xr vt 4 , +the console driver. .Sh SEE ALSO .Xr csh 1 , .Xr echo 1 , .Xr false 1 , -.Xr info 1 , .Xr kill 1 , .Xr login 1 , .Xr nice 1 , @@ -326,5 +228,18 @@ The manual page first appeared in .Fx 3.4 . .Sh AUTHORS +.An -nosplit This manual page was written by +.An Alexander Ziaee Aq Mt ziaee@FreeBSD.org +from an earlier version by .An Sheldon Hearn Aq Mt sheldonh@FreeBSD.org . +.Sh CAVEATS +While +.Nm +commands may exist in more than one shell or standalone, +each may be implemented differently. +.Pp +Standalone utilities and their manuals must be called by their path +from a shell with a +.Nm +command of the same name. diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 6cdd443ec067..3511acb254e1 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -1,5 +1,7 @@ .include <src.opts.mk> +PACKAGE= clibs + MAN= alloca.3 \ arb.3 \ assert.3 \ diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread_condattr.3 index 96d30263d7f2..33ad904f9a3d 100644 --- a/share/man/man3/pthread_condattr.3 +++ b/share/man/man3/pthread_condattr.3 @@ -85,7 +85,8 @@ in .Xr pthread_cond_timedwait 3 and may be set to .Dv CLOCK_REALTIME -(default) +(default), +.Dv CLOCK_TAI , or .Dv CLOCK_MONOTONIC . .Pp diff --git a/share/man/man3/pthread_rwlockattr_destroy.3 b/share/man/man3/pthread_rwlockattr_destroy.3 index 2f9fe7099ef2..eabfbad7e0f2 100644 --- a/share/man/man3/pthread_rwlockattr_destroy.3 +++ b/share/man/man3/pthread_rwlockattr_destroy.3 @@ -27,7 +27,7 @@ .Os .Sh NAME .Nm pthread_rwlockattr_destroy -.Nd destroy a read/write lock +.Nd destroy a read/write lock attributes object .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS @@ -37,7 +37,7 @@ .Sh DESCRIPTION The .Fn pthread_rwlockattr_destroy -function is used to destroy a read/write lock attribute object +function is used to destroy a read/write lock attributes object previously created with .Fn pthread_rwlockattr_init . .Sh RETURN VALUES diff --git a/share/man/man3/pthread_rwlockattr_init.3 b/share/man/man3/pthread_rwlockattr_init.3 index 46100608f9b6..031d010ae81a 100644 --- a/share/man/man3/pthread_rwlockattr_init.3 +++ b/share/man/man3/pthread_rwlockattr_init.3 @@ -27,7 +27,7 @@ .Os .Sh NAME .Nm pthread_rwlockattr_init -.Nd initialize a read/write lock +.Nd initialize a read/write lock attributes object .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS @@ -50,7 +50,7 @@ The function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM -Insufficient memory exists to initialize the attribute object. +Insufficient memory exists to initialize the attributes object. .El .Sh SEE ALSO .Xr pthread_rwlock_init 3 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index ed39aafebbc3..519b113b0a2e 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1,5 +1,8 @@ .include <src.opts.mk> +MANGROUPS= MAN +MANPACKAGE= kernel + # If you add a new file here, please consider adding an entry to the # hardware notes template (website/archetypes/release/hardware.adoc in # the doc repository); otherwise the automatically generated hardware @@ -58,7 +61,6 @@ MAN= aac.4 \ atkbdc.4 \ ${_atopcase.4} \ atp.4 \ - ${_atf_test_case.4} \ ${_atrtc.4} \ ${_attimer.4} \ audit.4 \ @@ -213,6 +215,7 @@ MAN= aac.4 \ ${_hv_vmbus.4} \ ${_hv_vss.4} \ hwpmc.4 \ + ${_hwt.4} \ ${_hwpstate_intel.4} \ i2ctinyusb.4 \ iavf.4 \ @@ -290,6 +293,8 @@ MAN= aac.4 \ linprocfs.4 \ linsysfs.4 \ ${_linux.4} \ + linuxkpi.4 \ + linuxkpi_wlan.4 \ liquidio.4 \ lm75.4 \ lo.4 \ @@ -589,8 +594,10 @@ MAN= aac.4 \ tty.4 \ tun.4 \ tws.4 \ + u2f.4 \ udp.4 \ udplite.4 \ + ${_ufshci.4} \ unionfs.4 \ ure.4 \ vale.4 \ @@ -625,6 +632,7 @@ MAN= aac.4 \ wlan_acl.4 \ wlan_amrr.4 \ wlan_ccmp.4 \ + wlan_gcmp.4 \ wlan_tkip.4 \ wlan_wep.4 \ wlan_xauth.4 \ @@ -742,7 +750,6 @@ MLINKS+=lge.4 if_lge.4 MLINKS+=lo.4 loop.4 MLINKS+=lp.4 plip.4 MLINKS+=malo.4 if_malo.4 -MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 MLINKS+=mfi.4 mfi_linux.4 \ mfi.4 mfip.4 @@ -840,7 +847,7 @@ _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 _ftgpio.4= ftgpio.4 _ftwd.4= ftwd.4 -_hn.4= _hn.4 +_hn.4= hn.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 @@ -923,6 +930,21 @@ _vmm.4= vmm.4 .endif .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +_hwt.4= hwt.4 +.if ${MACHINE_CPUARCH} == "amd64" +MLINKS+=hwt.4 intel_pt.4 +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +MLINKS+=hwt.4 coresight.4 +MLINKS+=hwt.4 spe.4 +.endif +.endif + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +_ufshci.4= ufshci.4 +.endif + .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" _gve.4= gve.4 @@ -965,11 +987,14 @@ _ccd.4= ccd.4 .if ${MK_CDDL} != "no" _dtrace_provs= dtrace_audit.4 \ + dtrace_dtrace.4 \ + dtrace_fbt.4 \ dtrace_io.4 \ dtrace_ip.4 \ dtrace_kinst.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ + dtrace_profile.4 \ dtrace_sched.4 \ dtrace_sctp.4 \ dtrace_tcp.4 \ @@ -1001,9 +1026,11 @@ MAN+= mlx5io.4 .endif .if ${MK_TESTS} != "no" +MANGROUPS+= TESTS ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc -_atf_test_case.4= atf-test-case.4 +TESTS= atf-test-case.4 +TESTSPACKAGE= tests .endif .if ${MK_PF} != "no" diff --git a/share/man/man4/acpi_wmi.4 b/share/man/man4/acpi_wmi.4 index 9ad14ed7892a..e5c5517ba4ac 100644 --- a/share/man/man4/acpi_wmi.4 +++ b/share/man/man4/acpi_wmi.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2009 Michael Gmelin .\" All rights reserved. .\" @@ -22,47 +25,45 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2019 +.Dd June 12, 2025 .Dt ACPI_WMI 4 .Os .Sh NAME .Nm acpi_wmi -.Nd "ACPI to WMI mapping driver" +.Nd ACPI to WMI mapping driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: -.Bd -ragged -offset indent -.Cd "device acpi_wmi" -.Ed +.Pp +.Dl Cd "device acpi_wmi" .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset indent -acpi_wmi_load="YES" -.Ed +.Pp +.Dl acpi_wmi_load="YES" .Sh DESCRIPTION The .Nm driver provides an interface for vendor specific WMI implementations -(e.g. HP and Acer laptops). -It creates /dev/wmistat%d, which can be read to get -information about GUIDs found in the system. +.Pq e.g. HP and Acer laptops . +It creates +.Pa /dev/wmistat%d , +which can be read to get information about GUIDs found in the system. .Sh FILES .Bl -tag -width /dev/wmistat%d -compact .It Pa /dev/wmistat%d -WMI status device. +WMI status devices. .El .Sh SYSCTLS The following sysctl node is currently implemented: -.Bl -tag +.Bl -tag -width "dev.acpi_wmi.%d.bmof" .It Va dev.acpi_wmi.%d.bmof -Managed Object Format (MOF) blob. -You can obtain human readable output by bmf2mof in bmfdec tool. -(https://github.com/pali/bmfdec) +binary Managed Object Format (MOF) buffer .El .Sh EXAMPLES +Read GUIDs from the first WMI interface found in the system: .Bd -literal # cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID @@ -78,7 +79,14 @@ GUID INST EXPE METH STR EVENT OID {8232DE3D-663D-4327-A8F4-E293ADB9BF05} 0 NO NO NO NO BG {8F1F6436-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BH {8F1F6435-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BI -# sysctl -b dev.acpi_wmi.0.bmof |bmf2mof +.Ed +.Pp +Read first WMI interface description with +.Sy bmf2mof +from +.Pa ports/converters/bmfdec : +.Bd -literal +# sysctl -b dev.acpi_wmi.0.bmof | bmf2mof [abstract] class Lenovo_BIOSElement { }; @@ -91,10 +99,15 @@ class Lenovo_BiosSetting : Lenovo_BiosElement { [WmiDataId(1), Description("BIOS setting")] String CurrentSetting; }; ... - .Ed .Sh SEE ALSO .Xr acpi 4 +.Sh STANDARDS +.Rs +.%T Windows Instrumentation: WMI and ACPI +.%I Microsoft Corporation +.%U https://github.com/microsoft/Windows-driver-samples/tree/main/wmi/wmiacpi +.Re .Sh HISTORY The .Nm @@ -107,13 +120,13 @@ The driver was written by .An Michael Gmelin Aq Mt freebsd@grem.de . .Pp -Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho. -.Pp -See http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx for -the specification of ACPI-WMI. +Work inspired by the Linux +.Sy acpi-wmi +driver written by Carlos Corbacho. .Pp -MOF part has been inspired by the Linux wmi-bmof driver -written by Andy Lutomirski. +MOF handling inspired by the Linux +.Sy wmi-bmof +driver written by Andy Lutomirski. .Pp This manual page was written by .An Michael Gmelin Aq Mt freebsd@grem.de . diff --git a/share/man/man4/ata.4 b/share/man/man4/ata.4 index feea1dd3cc85..29b6bbef6838 100644 --- a/share/man/man4/ata.4 +++ b/share/man/man4/ata.4 @@ -155,7 +155,9 @@ The .Va hw.ata.ata_dma_check_80pin tunable can be set to 0 to disable this check. .Sh HARDWARE -The currently supported ATA/SATA controller chips are: +The +.Nm +driver supports the IDE interface on the following ATA/SATA controllers: .Pp .Bl -tag -width "Silicon Image:" -compact .It Acard: diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 7ce734ae87eb..7048df4593bf 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 28, 2025 +.Dd July 28, 2025 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -271,6 +271,54 @@ by setting the .Va net.link.bridge.log_stp node using .Xr sysctl 8 . +.Sh VLAN SUPPORT +The +.Nm +driver has full support for virtual LANs (VLANs). +The bridge implements independent VLAN learning, i.e. MAC addresses are +learned on a per-VLAN basis, and the same MAC address may be learned on +multiple interfaces on different VLANs. +Incoming frames with an 802.1Q tag will be assigned to the appropriate +VLAN. +.Pp +Traffic sent to or from the host is not assigned to a VLAN by default. +To allow the host to communicate on a VLAN, configure a +.Xr vlan 4 +interface on the bridge and (if necessary) assign IP addresses there. +.Pp +By default no access control is enabled, so any interface may +participate in any VLAN. +.Pp +VLAN filtering may be enabled on a bridge using the +.Xr ifconfig 8 +.Cm vlanfilter +option. +When VLAN filtering is enabled, an interface may only send and receive +frames based on its configured VLAN access list. +.Pp +The interface's untagged VLAN ID may be configured using the +.Xr ifconfig 8 +.Cm untagged +option. +If an untagged VLAN ID is configured, incoming frames will be assigned +to that VLAN, and the interface may receive outgoing untagged frames +in that VLAN. +.Pp +The tagged VLAN access list may be configured using the +.Cm tagged , +.Cm +tagged +and +.Cm -tagged +options to +.Xr ifconfig 8 . +An interface may send and receive tagged frames for any VLAN in its +access list. +.Pp +The bridge will automatically insert or remove 802.1q tags as needed, +based on the interface configuration, when forwarding frames between +interfaces. +This tag processing is only done for interfaces with VLAN filtering +enabled. .Sh PACKET FILTERING Packet filtering can be used with any firewall package that hooks in via the .Xr pfil 9 @@ -538,6 +586,7 @@ ifconfig bridge0 addm fxp0 addm gif0 up .Xr ipfw 4 , .Xr netmap 4 , .Xr pf 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY The diff --git a/share/man/man4/capsicum.4 b/share/man/man4/capsicum.4 index 6aefae9d6df2..1de8e4531f4f 100644 --- a/share/man/man4/capsicum.4 +++ b/share/man/man4/capsicum.4 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 5, 2025 +.Dd June 17, 2025 .Dt CAPSICUM 4 .Os .Sh NAME @@ -37,6 +37,12 @@ .Nm is a lightweight OS capability and sandbox framework implementing a hybrid capability system model. +.Nm +is designed to blend capabilities with UNIX. +This approach achieves many of the benefits of least-privilege operation, while +preserving existing UNIX APIs and performance, and presents application authors +with an adoption path for capability-oriented design. +.Pp Capabilities are unforgeable tokens of authority that can be delegated and must be presented to perform an action. .Nm @@ -59,6 +65,34 @@ namespaces) is restricted; only explicitly delegated rights, referenced by memory mappings or file descriptors, may be used. Once set, the flag is inherited by future children processes, and may not be cleared. +.Pp +Access to system calls in capability mode is restricted: some system calls +requiring global namespace access are unavailable, while others are +constrained. +For instance, +.Xr sysctl 2 +can be used to query process-local information such as address space layout, +but also to monitor a system’s network connections. +.Xr sysctl 2 +is constrained by explicitly marking \(~~60 of over 15000 parameters as permitted +in capability mode; all others are denied. +.Pp +The system calls which require constraints are +.Xr sysctl 2 , +.Xr shm_open 2 +.Pq which is permitted to create anonymous memory objects but not named ones +and the +.Xr openat 2 +family of system calls. +The +.Xr openat 2 +calls already accept a file descriptor argument as the directory to perform the +.Xr open 2 , +.Xr rename 2 , +etc. relative to; in capability mode the +.Xr openat 2 +family of system calls are constrained so that they can only operate on +objects “under” the provided file descriptor. .It capabilities Limit operations that can be called on file descriptors. For example, a file descriptor returned by @@ -152,3 +186,14 @@ and .An Kris Kennaway Aq Mt kris@FreeBSD.org at Google, Inc., and .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net . +Portions of this manual page are drawn from +.Rs +.%A Robert N. M. Watson +.%A Jonathan Anderson +.%A Ben Laurie +.%A Kris Kennaway +.%T Capsicum: practical capabilities for UNIX +.%J USENIX Security Symposium +.%D August 2010 +.%O DOI: 10.5555/1929820.1929824 +.Re diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 9a9af553b29d..3c4894c03d62 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -24,7 +24,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd May 28, 2025 +.Dd June 10, 2025 .Dt DDB 4 .Os .Sh NAME @@ -604,9 +604,12 @@ The modifier will print command line arguments for each process. .\" .Pp -.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm l +.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm b Ns Cm l Show the same output as "show tcpcb" does, but for all TCP control blocks within the system. +The +.Cm b +modifier will request BBLog entries to be printed. Using the .Cm l modifier will limit the output to TCP control blocks, which are locked. @@ -1103,7 +1106,7 @@ on i386.) Not present on some platforms. .\" .Pp -.It Ic show Cm tcpcb Ar addr +.It Ic show Cm tcpcb Ns Oo Li / Ns Cm b Oc Ar addr Print TCP control block .Vt struct tcpcb lying at address @@ -1111,6 +1114,9 @@ lying at address For exact interpretation of output, visit .Pa netinet/tcp.h header file. +The +.Cm b +modifier will request BBLog entries to be printed. .\" .Pp .It Ic show Cm thread Op Ar addr | tid diff --git a/share/man/man4/dtrace_dtrace.4 b/share/man/man4/dtrace_dtrace.4 new file mode 100644 index 000000000000..b8c31005b47e --- /dev/null +++ b/share/man/man4/dtrace_dtrace.4 @@ -0,0 +1,191 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 14, 2025 +.Dt DTRACE_DTRACE 4 +.Os +.Sh NAME +.Nm dtrace_dtrace +.Nd a DTrace provider for BEGIN, END, and ERROR probes +.Sh SYNOPSIS +.Nm dtrace Ns Cm :::BEGIN +.Nm dtrace Ns Cm :::END +.Nm dtrace Ns Cm :::ERROR +.Sh DESCRIPTION +The +.Nm dtrace +provider implements three special probes related to the life cycle of the +DTrace program itself. +.Ss dtrace:::BEGIN +The +.Nm dtrace Ns Cm :::BEGIN +probe fires at the beginning of a +.Xr dtrace 1 , +program before tracing has begun. +It provides a convenient place for initializing variables +and printing column headers. +.Pp +Variables such as +.Va stack +or +.Va execname +cannot be relied upon in the execution context of the +.Nm dtrace Ns Cm :::BEGIN +probe. +.Ss dtrace:::END +The +.Nm dtrace Ns Cm :::END +probe fires at the end of a +.Xr dtrace 1 +program, when all tracing has stopped. +.Ss dtrace:::ERROR +The +.Nm dtrace Ns Cm :::ERROR +probe fires when an unexpected runtime error occurs in another probe. +.Pp +The following table describes the arguments to +.Nm dtrace Ns Cm :::ERROR . +.Bl -column -offset indent "Argument" "Definition" +.It Sy Argument Ta Sy Definition +.It Fa arg1 Ta Enabled probe identifier (EPID) +of the probe where the runtime error occurred +.It Fa arg2 Ta Index of the action statement that caused the error +.It Fa arg3 Ta DIF offset into the action if available (otherwise -1) +.It Fa arg4 Ta Fault type +.It Fa arg5 Ta Accessed address (or 0 if not applicable) when +.Va arg4 +is of fault type +.Dv DTRACEFLT_BADADDR , DTRACEFLT_BADALIGN , DTRACEFLT_KPRIV , +or +.Dv DTRACEFLT_UPRIV +.El +.Pp +The fault types are: +.Bl -tag -offset indent -width "DTRACEFLT_NOSCRATCH" -compact +.It Dv DTRACEFLT_UNKNOWN +Unknown fault +.It Dv DTRACEFLT_BADADDR +Bad address +.It Dv DTRACEFLT_BADALIGN +Bad alignment +.It Dv DTRACEFLT_ILLOP +Illegal operation +.It Dv DTRACEFLT_DIVZERO +Divide-by-zero +.It Dv DTRACEFLT_NOSCRATCH +Out of scratch space +.It Dv DTRACEFLT_KPRIV +Illegal kernel access +.It Dv DTRACEFLT_UPRIV +Illegal user access +.It Dv DTRACEFLT_TUPOFLOW +Tuple stack overflow +.It Dv DTRACEFLT_BADSTACK +Bad stack +.El +.Sh FILES +.Bl -tag -width '<sys/dtrace.h>' +.It In sys/dtrace.h +The header file containing the definitions of DTrace fault types. +.El +.Sh EXAMPLES +.Ss Example 1 : Custom Column Headers +The following script uses the +.Nm dtrace Ns Cm :::BEGIN +probe to print column headers. +Note the pragma line setting the +.Ql quiet +option to disable the default column headers. +.Bd -literal -offset 2n +#pragma D option quiet + +dtrace:::BEGIN +{ + printf(" %12s %-20s %-20s %s\en", + "DELTA(us)", "OLD", "NEW", "TIMESTAMP"); +} +.Ed +.Ss Example 2 : Handling Runtime Errors with dtrace:::ERROR +The following script causes a runtime error by dereferencing a pointer +on address +.Ad 19930908 +in the +.Cm BEGIN +probe. +As a result, the +.Cm ERROR +probe fires and prints out +.Dq Oops +along with the probe arguments. +At that point, the program ends and fires the +.Cm END +probe. +.\" It might look weird to define ERROR first, but that is on purpose. +.\" This way the probe IDs and EPIDs are a bit more mixed up +.\" and are easier to understand. +.Bd -literal -offset 2n +ERROR +{ + printf("Oops\en"); + printf("EPID (arg1): %d\en", arg1); + printf("Action index (arg2): %d\en", arg2); + printf("DIF offset (arg3): %d\en", arg3); + printf("Fault type (arg4): %d\en", arg4); + printf("Accessed address (arg5): %X\en", arg5); + exit(1); +} +BEGIN +{ + *(int *)0x19931101; +} +END { + printf("Bye"); +} +.Ed +.Pp +This script will result in the following output: +.Bd -literal -offset 2n +CPU ID FUNCTION:NAME + 2 3 :ERROR Oops +EPID (arg1): 2 +Action index (arg2): 1 +DIF offset (arg3): 16 +Fault type: 1 +arg5: 19931101 + +dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address (0x19931101) in action #1 at DIF offset 16 + 2 2 :END Bye +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter dtrace Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-dtrace.html +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +The +.Nm dtrace Ns Cm :::ERROR +probe arguments cannot be accessed through the typed +.Va args[] +array. +.Pp +.Xr dtrace 1 +will not fire the +.Nm dtrace Ns Cm :::ERROR +probe recursively. +If an error occurs in one of the action statements of the +.Nm dtrace Ns Cm :::ERROR , +then +.Xr dtrace 1 +will abort further processing of +the +.Nm dtrace Ns Cm :::ERROR +probe's actions. diff --git a/share/man/man4/dtrace_fbt.4 b/share/man/man4/dtrace_fbt.4 new file mode 100644 index 000000000000..3e35bb8c5bbc --- /dev/null +++ b/share/man/man4/dtrace_fbt.4 @@ -0,0 +1,332 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 16, 2025 +.Dt DTRACE_FBT 4 +.Os +.Sh NAME +.Nm dtrace_fbt +.Nd a DTrace provider for dynamic kernel tracing based on function boundaries +.Sh SYNOPSIS +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The Function Boundary Tracing +.Pq Nm fbt +provider instruments the entry and return of almost every kernel function +corresponding to an +.Xr elf 5 +symbol in the kernel and loaded kernel modules. +.Pp +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +fires whenever the +.Ar function +is called. +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +fires when the +.Ar function +returns. +.Pp +The +.Ar module +in the probe description is either the name of the loaded kernel module +or +.Ql kernel +for functions compiled into the kernel. +.Ss Function Boundary Instrumentation +The +.Nm fbt +will always instrument a function's entry, but +its return will be intsrumented so long as it can find a +.Ql ret +instruction. +.Pp +In some cases, +.Nm fbt +cannot instrument a function's entry and/or return. +Refer to subsection +.Sx Frame Pointer +for more details. +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Fa args[0] Ta Function's first argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft size_t Fa size +.It Fa args[1] Ta Function's second argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft struct malloc_type Fa *type +.It Fa args[2] Ta Function's third argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft int Fa flags +.It Fa ... Ta ... +.El +.Pp +The arguments of the return probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are +.Fa args[0] +.Po +the offset of the firing return instruction within the function; +useful to tell apart two different return statements in a single function +.Pc +and +.Fa args[1] +.Pq the return value, if any . +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Fa args[0] Ta Offset of the traced return instruction +.It Fa args[1] Ta Function's return value +.Po e.g., a kernel virtual address if returning from a successful +.Xr malloc 9 +.Pc +.El +.Pp +Subsection +.Sx Example 2 : Getting Details About Probe's Arguments +shows how to get probe's argument count and types directly with +.Xr dtrace 1 +without having to resort to the reading function's source code +or documentation. +.Sh EXAMPLES +.Ss Example 1 : Listing Available FBT Probes +The following example shows how to list all the available +.Nm fbt +probes. +.Bd -literal -offset 2n +# dtrace -l -P fbt + ID PROVIDER MODULE FUNCTION NAME +[...] +31868 fbt kernel hammer_time entry +31869 fbt kernel hammer_time return +[...] +.Ed +.Pp +Since +.Fn hammer_time +is a part of the kernel and not a separate loaded module, the +.Ar module +column displays +.Ql kernel . +.Ss Example 2 : Getting Details About Probe's Arguments +The following example shows how to generate a program stability report of +.Xr malloc 9 Ap s +entry and return probes. +Those reports are useful to view +the probe's number of arguments and their types. +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:entry +[...] + Argument Types + args[0]: size_t + args[1]: struct malloc_type * + args[2]: int +.Ed +.Pp +The count and types of +.Nm fbt Ns Cm \&::malloc:entry +arguments +match the function signature of +.Xr malloc 9 : +.Va args[0] +is +.Ft size_t , +.Va args[1] +is +.Ft "struct malloc_type *" , +and +.Va "args[2]" +is +.Ft int . +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:return +[...] + Argument Types + args[0]: int + args[1]: void * +.Ed +.Pp +The +.Cm return +probe reports two arguments and their types: +the return instruction offset +.Pq the usual Ft int +and the function's return value, which in this case is +.Ft void * , +as +.Xr malloc 9 +returns a kernel virtual address. +.Ss Example 3 : Counting Kernel Slab Memory Allocation by Function +.Bd -literal -offset 2n +# dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }' +dtrace: description 'fbt::kmem*:entry ' matched 47 probes +^C + kmem_alloc_contig 1 + kmem_alloc_contig_domainset 1 + kmem_cache_reap_active 1 + kmem_alloc_contig_pages 2 + kmem_free 2 + kmem_std_destructor 19 + kmem_std_constructor 26 + kmem_cache_free 151 + kmem_cache_alloc 181 +.Ed +.Ss Example 4 : Counting Kernel Slab Memory Allocation by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::kmem*:entry { @[caller] = count(); } END { printa("%40a %@16d\en", @); }' +^C + kernel`contigmalloc+0x33 1 + kernel`free+0xd3 1 + kernel`kmem_alloc_contig+0x29 1 +kernel`kmem_alloc_contig_domainset+0x19a 1 + zfs.ko`arc_reap_cb_check+0x16 1 +.Ed +.Ss Example 5 : Counting Kernel malloc()'s by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[caller] = count(); } END { printa("%45a %@16d\en", @); }' +^C + kernel`devclass_get_devices+0xa8 1 + kernel`sys_ioctl+0xb7 1 + dtrace.ko`dtrace_ioctl+0x15c1 1 + dtrace.ko`dtrace_ioctl+0x972 2 + dtrace.ko`dtrace_dof_create+0x35 2 + kernel`kern_poll_kfds+0x2f0 4 + kernel`kern_poll_kfds+0x28a 19 +.Ed +.Ss Example 6 : Counting Kernel malloc()'s by Kernel Stack Trace +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[stack()] = count(); }' +^C + dtrace.ko`dtrace_dof_create+0x35 + dtrace.ko`dtrace_ioctl+0x827 + kernel`devfs_ioctl+0xd1 + kernel`VOP_IOCTL_APV+0x2a + kernel`vn_ioctl+0xb6 + kernel`devfs_ioctl_f+0x1e + kernel`kern_ioctl+0x286 + kernel`sys_ioctl+0x12f + kernel`amd64_syscall+0x169 + kernel`0xffffffff81092b0b + 2 +.Ed +.Ss Example 7 : Summarizing vmem_alloc()'s by Arena Name and Size Distribution +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::vmem_alloc:entry { @[args[0]->vm_name] = quantize(arg1); }' +^C + + kernel arena dom + value ------------- Distribution ------------- count + 2048 | 0 + 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4 + 8192 |@@@@@@@@@@@@@ 2 + 16384 | 0 +.Ed +.Ss Example 8 : Measuring Total Time Spent Executing a Function +This DTrace script measures the total time spent in +.Fn vm_page* +kernel functions. +The +.Fn quantize +aggregation organizes the measurements into power-of-two buckets, +providing a time distribution in nanoseconds for each function. +.Bd -literal -offset 2n +fbt::vm_page*:entry { + self->start = timestamp; +} + +fbt::vm_page*:return /self->start/ { + @[probefunc] = quantize(timestamp - self->start); + self->start = 0; +} +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace_kinst 4 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 898\(en903 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter fbt Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-fbt.html#chp-fbt +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +.Ss Stability and Portability +.Nm fbt +probes are by definition tightly coupled to kernel code; if the code underlying +a script changes, the script may fail to run or may produce incorrect results. +Scripts written for one version of +.Fx +might not work on others, +and almost certainly will not work on other operating systems. +.Pp +Individual +.Nm fbt +probes often do not correspond nicely to logical system events. +For example, consider a DTrace script which prints the destination +address of every IP packet as the kernel hands them over +to the network card driver (NIC). +An +.Nm fbt Ns -based +implementation of such a script is a discouragingly difficult task: +it involves instrumenting at least four different functions in different parts +of the IPv4 and IPv6 code. +At the same time, with the +.Xr dtrace_ip 4 +provider the script is a simple one-liner: +.Dl dtrace -n 'ip:::send {printf("%s", args[2]->ip_daddr);}' +.Pp +Make sure to review available +.Xr dtrace 1 +providers first +before implementing a custom script with the +.Nm fbt +provider. +If none of the DTrace providers offer the desired probes, +consider adding new statically-defined tracing probes +.Pq Xr SDT 9 . +.Ss Frame Pointer +Inline functions are not instrumentable by +.Nm fbt +as they lack a frame pointer. +A developer might explicitly disable inlining by adding the +.Ql __noinline +attribute to a function definition, +but of course this requires a recompilation of the kernel. +Building the kernel with +.Fl fno-omit-frame-pointer +is another way of preserving frame pointers. +Note, that sometimes compilers will omit the frame pointer in leaf functions, +even when configured with +.Fl fno-omit-frame-pointer . +.Pp +Function returns via a tail call are also not instrumentable by +.Nm fbt . +As a result, +a function might have an entry probe +and a mix of instrumented and uninstrumentable returns. +.Pp +Use +.Xr dtrace_kinst 4 +to trace arbitrary instructions inside kernel functions +and work around some of the +limitations +of +.Nm fbt . +.Ss Tracing DTrace +The +.Nm fbt +provider cannot attach to functions inside DTrace provider kernel modules. diff --git a/share/man/man4/dtrace_kinst.4 b/share/man/man4/dtrace_kinst.4 index 9debbc1bd106..c2187689749b 100644 --- a/share/man/man4/dtrace_kinst.4 +++ b/share/man/man4/dtrace_kinst.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2023 +.Dd July 16, 2025 .Dt DTRACE_KINST 4 .Os .Sh NAME @@ -43,10 +43,13 @@ creates probes on-demand, meaning it searches for and parses the function's instructions each time .Xr dtrace 1 is run, and not at module load time. -This is in contrast to FBT's load-time parsing, since +This is in contrast to +.Xr dtrace_fbt 4 Ap s +load-time parsing, since .Nm kinst can potentially create thousands of probes for just a single function, instead -of up to two (entry and return) in the case of FBT. +of up to two (entry and return) in the case of +.Xr dtrace_fbt 4 . A result of this is that .Cm dtrace -l -P kinst will not match any probes. @@ -79,7 +82,8 @@ Trace all instructions in # dtrace -n 'kinst::amd64_syscall:' .Ed .Sh SEE ALSO -.Xr dtrace 1 +.Xr dtrace 1 , +.Xr dtrace_fbt 4 .Sh HISTORY The .Nm kinst diff --git a/share/man/man4/dtrace_profile.4 b/share/man/man4/dtrace_profile.4 new file mode 100644 index 000000000000..07f86663d60a --- /dev/null +++ b/share/man/man4/dtrace_profile.4 @@ -0,0 +1,129 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 14, 2025 +.Dt DTRACE_PROFILE 4 +.Os +.Sh NAME +.Nm dtrace_profile +.Nd a DTrace provider for firing probes at a given time interval +.Sh SYNOPSIS +.Nm profile Ns Cm :::profile- Ns Ar rate Ns Op Ar unit +.Nm profile Ns Cm :::tick- Ns Ar rate Ns Op Ar unit +.Sh DESCRIPTION +The +.Nm profile +provider implements three special probes related to the life cycle of the +DTrace program itself. +.Ss Probes +The +.Nm profile Ns Cm :::profile +probes fire on all CPUs and are suitable for measuring the whole system +periodically. +.Pp +The +.Nm profile Ns Cm :::tick +probes fire on a single CPU, potentially a different one every time. +They are useful, e.g., for printing partial results periodically. +.Ss Rate and Time Units +The +.Nm profile +provider probes will fire at the specified +.Ar rate . +.Pp +The default unit is +.Cm hz . +The +.Nm profile +provider supports the following time units: +.Bl -column -offset indent "ns, nsec" "Definition" +.It Sy Time Unit Ta Sy Definition +.It Cm ns , nsec Ta nanoseconds +.It Cm us , usec Ta microseconds +.It Cm ms , msec Ta milliseconds +.It Cm s , sec Ta seconds +.It Cm m , min Ta minutes +.It Cm h , hour Ta hours +.It Cm d , day Ta days +.It Cm hz Ta Hertz (frequency per second) +.El +.Ss Probe Arguments +The arguments of the +.Nm profile +provider probes +are: +.Bl -tag -width arg0 +.It Va arg0 +The PC (program counter) in the kernel when the probe triggered, +or 0 if the process was not in the kernel at that time. +.It Va arg1 +The PC in the user process when the probe triggered, +or 0 if the process was in the kernel when the probe triggered. +.El +.Pp +Use arguments +.Va arg0 +and +.Va arg1 +to tell if the +.Nm profile +provider probe fired in the kernel or in the userspace context. +.Sh IMPLEMENTATION NOTES +The +.Xr sysctl 8 +variable +.Va kern.dtrace.profile.aframes +controls the number of skipped artificial frames for +the +.Nm profile +provider. +.Sh EXAMPLES +.Ss Example 1 : Profiling On-CPU Kernel Stack Traces +The following DTrace one-liner uses the +.Nm profile +provider to collect stack traces over 60 seconds. +.\" XXX: Keep on one line for easier copy-pasting. +.Bd -literal -offset indent +dtrace -x stackframes=100 -n 'profile-197 /arg0/ {@[stack()] = count();} tick-60s {exit(0);} +.Ed +.Pp +The system is profiled at the 197 Hz to avoid sampling in lockstep +with other periodic activities. +This unnatural frequency minimizes the chance of overlapping with other events. +.Pp +Option +.Fl x Cm stackframes=100 +increases the maximum number of kernel stack frames to unwind during +.Fn stack . +.Pp +Checking if +.Ar arg0 +is not zero makes sure that profiling happens +when the program is in the kernel context. +.Pp +Refer to +.Lk https://www.brendangregg.com/flamegraphs.html +to learn about generating flame graphs from the obtained stack traces. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter profile Provider +.%D 2008 +.%U https://www.illumos.org/books/dtrace/chp-profile.html +.Re +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 24\(en25 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . diff --git a/share/man/man4/epair.4 b/share/man/man4/epair.4 index 4bcb54c936cb..342b15b5612a 100644 --- a/share/man/man4/epair.4 +++ b/share/man/man4/epair.4 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 18, 2015 +.Dd August 12, 2025 .Dt EPAIR 4 .Os .Sh NAME @@ -79,12 +79,24 @@ and Like any other Ethernet interface, an .Nm needs to have a network address. -Each +If the tunable +.Va net.link.epair.ether_gen_addr Ns +=0, each .Nm -will be assigned a locally administered address by default, +will be assigned a random locally administered address, that is only guaranteed to be unique within one network stack. -To change the default addresses one may use the SIOCSIFADDR ioctl(2) or -ifconfig(8) utility. +The tunable +.Va net.link.epair.ether_gen_addr Ns +=1 will generate a stable MAC address with +.Fx +OUI using +.Xr ether_gen_addr 9 . +This tunable defaults to 1 in +.Fx 15.0 and might be removed in +.Fx 16.0 . +To change the default addresses one may use the SIOCSIFADDR +.Xr ioctl 2 or +.Xr ifconfig 8 utility. .Pp The basic intent is to provide connectivity between two virtual network stack instances. diff --git a/share/man/man4/gif.4 b/share/man/man4/gif.4 index 959510451011..ad33d5d21e81 100644 --- a/share/man/man4/gif.4 +++ b/share/man/man4/gif.4 @@ -1,6 +1,7 @@ .\" $KAME: gif.4,v 1.28 2001/05/18 13:15:56 itojun Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. +.\" Copyright (C) 2024 Hiroki Sato <hrs@FreeBSD.org> .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -27,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 21, 2018 +.Dd July 14, 2025 .Dt GIF 4 .Os .Sh NAME @@ -67,8 +68,8 @@ variable in .Pp To use .Nm , -the administrator needs to configure the protocol and addresses used for the outer -header. +the administrator needs to configure the protocol and addresses used for +the outer header. This can be done by using .Xr ifconfig 8 .Cm tunnel , @@ -79,8 +80,7 @@ The administrator also needs to configure the protocol and addresses for the inner header, with .Xr ifconfig 8 . Note that IPv6 link-local addresses -(those that start with -.Li fe80:: ) +.Pq those that start with Li fe80\&:\&: will be automatically configured whenever possible. You may need to remove IPv6 link-local addresses manually using .Xr ifconfig 8 , @@ -89,12 +89,139 @@ if you want to disable the use of IPv6 as the inner header Finally, you must modify the routing table to route the packets through the .Nm interface. +.Ss MTU Configuration and Path MTU Discovery +The +.Nm +interface uses the fixed length, +.Li 1280 , +to determine whether the outgoing IPv6 packets are split. +This means the MTU value configured on the interface will be ignored +when the outer protocol is IPv6. +When the +.Dv NOCLAMP +interface flag is set, +.Nm +uses the same configured value as IPv4 communications. +This behavior prevents potential issues when the path MTU is +smaller than the interface MTU. +This section describes the reason why the default behavior is different. +The +.Dv NOCLAMP +interface flag can be set using the following command: +.Pp +.Dl ifconfig Ar gif0 Cm noclamp +.Pp +and clear the flag using the following: +.Pp +.Dl ifconfig Ar gif0 Cm -noclamp +.Pp +where +.Ar gif0 +is the actual interface name. +.Pp +A tunnel interface always has an implicit smaller MTU for the inner protocol +than the outer protocol because of the additional header. +Note that the interface MTU on a +.Nm +interface, +the default value is +.Li 1280 , +is used as MTU for the outer protocol. +This means that the MTU for the inner protocol varies depending on the +outer protocol header length. +If an outgoing packet bigger than the inner protocol MTU arrives at a +.Nm +interface for encapsulation, +it will be split into fragments. +Specifically, +if IPv4 is used as the outer protocol, +the inner is 20 octets smaller than the interface MTU. +In the case of the default interface MTU, +.Li 1280 , +inner packets bigger than +.Li 1260 +will be fragmented. +In the case of IPv6, +the inner is 40 octets smaller than the outer. +.Pp +This fragmentation is not harmful though it can degrade the +performance. +Note that while an increased MTU on +.Nm +interface helps to mitigate this reduced performance issue, +it can also cause packet losses on the intermediate narrowest path +between the two communication endpoints in IPv6. +IPv6 allows fragmentation only on the sender, +not on the routers in the communication path. +A big outgoing packet will be dropped on a router with a smaller MTU. .Pp +In normal IPv6 communication, +an ICMPv6 Packet Too Big error will be sent back to the sender, +who can adjust the packet length and re-send it. +This process is performed in the upper protocols than L3, +such as TCP, +and makes the packet length shorter so that packets go through +the path without fragmentation. +This behavior is known as path MTU discovery. +.Pp +When using a +.Nm +interface, +the Packet Too Big message is generated for the outer protocol. +Since the +.Nm +interface does not translate this error to the inner protocol, +the inner protocol sees it just as a packet loss with no useful +information to adjust the length of the next packets. +In this situation, +path MTU discovery does not work, +and communications of the inner protocol +become stalled. +.Pp +In order to avoid this, +a +.Nm +interface silently splits a packet of over 1240 octets into fragments to make +the outer protocol packets equal or shorter than 1280 octets, +even when the interface MTU is configured as larger than 1280. +Note that this occurs only when the outer protocol is IPv6. +.Li 1280 +is the smallest MTU in IPv6 and guarantees no packet loss occurs +on intermediate routers. +.Pp +As mentioned earlier, +the performance is sub-optimal if the actual path MTU is larger than +.Li 1280 . +A typical confusing scenario is as follows. The .Nm -device can be configured to be ECN friendly. -This can be configured by -.Dv IFF_LINK1 . +interface can have Ethernet, +whose MTU is usually 1500, +as the inner protocol. +It is called an EtherIP tunnel, +and can be configured by adding the +.Nm +interface as a member of +.Xr if_bridge 4 +interface. +The +.Xr if_bridge 4 +interface forcibly changes the MTU of the +.Nm +interface with those for the other member interfaces, +which are likely 1500. +In this case, +a situation in which the MTU of the +.Nm +interface is 1500 but fragmentation in 1280 octets always occurs. +.Pp +The default behavior is most conservative to prevent confusing packet loss. +Depending on the network configuration, +enabling the +.Dv NOCLAMP +interface flag might be helpful for better performance. +It is crucial to ensure that the path MTU is equal to or larger than +the interface MTU when enabling this flag. .Ss ECN friendly behavior The .Nm @@ -169,6 +296,7 @@ variable to the desired level of nesting. .Sh SEE ALSO .Xr gre 4 , +.Xr if_bridge 4 , .Xr inet 4 , .Xr inet6 4 , .Xr ifconfig 8 @@ -199,7 +327,8 @@ There are many tunnelling protocol specifications, all defined differently from each other. The .Nm -device may not interoperate with peers which are based on different specifications, +device may not interoperate with peers which are based on different +specifications, and are picky about outer header fields. For example, you cannot usually use .Nm @@ -219,11 +348,14 @@ to 1240 or smaller, when the outer header is IPv6 and the inner header is IPv4. .Pp The .Nm -device does not translate ICMP messages for the outer header into the inner header. +device does not translate ICMP messages for the outer header into the inner +header. .Pp In the past, .Nm had a multi-destination behavior, configurable via -.Dv IFF_LINK0 +.Dv NOCLAMP flag. The behavior is obsolete and is no longer supported. +This flag is now used to determine whether performing fragmentation when +the outer protocol is IPv6. diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 924a01a06d08..c5627e929044 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -230,6 +230,14 @@ The default value is 0, which means hardware LRO is enabled by default. The software LRO stack in the kernel is always used. This sysctl variable needs to be set before loading the driver, using .Xr loader.conf 5 . +.It Va hw.gve.allow_4k_rx_buffers +Setting this boot-time tunable to 1 enables support for 4K RX Buffers. +The default value is 0, which means 2K RX Buffers will be used. +4K RX Buffers are only supported on DQO_RDA and DQO_QPL queue formats. +When enabled, 4K RX Buffers will be used either when HW LRO is enabled +or mtu is greated than 2048. +This sysctl variable needs to be set before loading the driver, using +.Xr loader.conf 5 . .It Va dev.gve.X.num_rx_queues and dev.gve.X.num_tx_queues Run-time tunables that represent the number of currently used RX/TX queues. The default value is the max number of RX/TX queues the device can support. diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 new file mode 100644 index 000000000000..299332c72542 --- /dev/null +++ b/share/man/man4/hwt.4 @@ -0,0 +1,144 @@ +.\" +.\" Copyright (c) 2025 Ruslan Bukin <br@bsdpad.com> +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd July 12, 2025 +.Dt HWT 4 +.Os +.Sh NAME +.Nm hwt +.Nd Hardware Trace Framework +.Sh SYNOPSIS +.Cd "options HWT_HOOKS" +.Cd "device hwt" +.Pp +At least one of: +.Cd "device intel_pt" +.Pq amd64 +.Cd "device coresight" +.Pq arm64 +.Cd "device spe" +.Pq arm64 +.Pp +In +.Xr rc.conf 5 : +.Cd kld_list="hwt" +.Sh DESCRIPTION +The +.Nm +framework provides infrastructure for hardware-assisted tracing. +It collects detailed information about software execution and stores it as +events in highly compressed format into DRAM. +The events cover information about control flow changes of a program, whether +branches taken or not, exceptions taken, timing information, cycles elapsed and +more. +The information collected allows to reconstruct entire program flow of a given +application without noticeable performance impact. +.Sh HARDWARE +The framework supports several tracing technologies found on +.Cd arm64 +and +.Cd amd64 +systems: +.Pp +.Bl -bullet -compact +.It +ARM Coresight +.It +ARM Statistical Profiling Extension (SPE) +.It +Intel Processor Trace (PT) +.El +.Pp +The +.Nm +framework supports two modes of operation: +.Bl -tag -width "Thread mode" +.It Em CPU mode +Capture CPU activity in kernel mode. +.It Em Thread mode +Capture activity of each of a process's threads in user mode. +.El +.Sh MANAGEMENT +When loaded into kernel, the +.Nm +framework provides +.Pa /dev/hwt +character device. +The only +.Xr ioctl 2 +request it accepts is +.Dv HWT_IOC_ALLOC . +This request allocates kernel tracing context (CTX) based on requested mode of +operation, set of CPUs and/or pid. +.Pp +Upon successful CTX allocation, the ioctl returns a CTX identification +number (ident). +.Pp +Each CTX is then managed using its own dedicated character device found at +.Pa "/dev/hwt_${ident}_${d}", +where ident is a unique identification number of tracing context, d is either +cpu_id (in HWT CPU mode) or process pid (in HWT Thread mode). +.Sh HOOKS +During tracing of a target process, HWT records runtime events such as threads +creation, exec and mmap system calls. +These events are logged as "records" within a particular CTX associated with +traced process. +.Pp +Additionally, HWT can suspend the target thread upon exec or mmap system calls +if requested by the user. +This pause allows user-space tools to retrieve the records and adjust tracing +settings before execution continues. +This feature is especially useful when address range filtering is enabled, +allowing tracing of specific functions within the target executable or a +dynamic library. +.Sh KERNEL OPTIONS +The following options in the kernel configuration file are mandatory and +related to +.Nm +operation: +.Pp +.Bl -tag -width ".Dv HWT_HOOKS" -compact +.It Dv HWT_HOOKS +Enable kernel hooks. +.El +.Sh IOCTL INTERFACE +Once a CTX is allocated, its management character device accepts several +.Xr ioctl 2 +requests: +.Bl -tag -width "HWT_IOC_RECORD_GET" +.It Dv HWT_IOC_START +Start tracing. +In HWT CPU mode the tracing does actually start with this +.Xr ioctl 2 +request. +In the Thread mode, the tracing "running" flag set, but tracing begins after +scheduler switches the target thread onto CPU and return to user mode. +.It Dv HWT_IOC_STOP +Stop tracing of the particular CTX. +.It Dv HWT_IOC_RECORD_GET +Copy all or part of records collected during hook invocation and associated +with this CTX to userspace. +.It Dv HWT_IOC_BUFPTR_GET +Get current pointer in buffer that is filled by tracing units in real-time. +.It Dv HWT_IOC_SET_CONFIG +Set architecture-specific config (optional). +.It Dv HWT_IOC_WAKEUP +Wake up a thread that has been put to sleep by HWT framework hooks. +.It Dv HWT_IOC_SVC_BUF +For SPE-only, the kernel is waiting for userspace to notify that it has copied +out a buffer to avoid data loss/overwriting buffers. +.El +.Sh SEE ALSO +.Xr tracing 7 , +.Xr hwt 8 +.Sh HISTORY +The +.Nm +framework first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An Ruslan Bukin Aq Mt br@FreeBSD.org +.An Bojan Novković Aq Mt bnovkov@freebsd.org +.An Zachary Leaf Aq Mt zachary.leaf@arm.com diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 index 63fdb244f3ed..3f7a9017756d 100644 --- a/share/man/man4/ice.4 +++ b/share/man/man4/ice.4 @@ -32,18 +32,18 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd May 20, 2024 +.Dd March 28, 2025 .Dt ICE 4 .Os .Sh NAME .Nm ice -.Nd "Intel Ethernet 800 Series Driver" +.Nd "Intel\(rg Ethernet 800 Series Driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indent -.Cd "device iflib" -.Cd "device ice" +.Bd -literal -offset indent +.Cd device iflib +.Cd device ice .Ed .Pp To load the driver as a module at boot time, place the following lines in @@ -57,7 +57,7 @@ The .Nm driver provides support for any PCI Express adapter or LOM (LAN On Motherboard) -in the Intel Ethernet 800 Series. +in the Intel\(rg Ethernet 800 Series. As of this writing, the series includes devices with these model numbers: .Pp .Bl -bullet -compact @@ -73,6 +73,16 @@ Intel\(rg Ethernet Connection E822\-L Intel\(rg Ethernet Connection E823\-C .It Intel\(rg Ethernet Connection E823\-L +.It +Intel\(rg Ethernet Connection E825\-C +.It +Intel\(rg Ethernet Connection E830\-C +.It +Intel\(rg Ethernet Connection E830\-CC +.It +Intel\(rg Ethernet Connection E830\-L +.It +Intel\(rg Ethernet Connection E830\-XXV .El .Pp For questions related to hardware requirements, refer to the documentation @@ -83,11 +93,17 @@ Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 utility configures the adapter to receive and transmit Jumbo Frames. The maximum MTU size for Jumbo Frames is 9706. -This value coincides with the maximum Jumbo Frame size of 9728. +For more information, see the +.Sx Jumbo Frames +section. .Pp This driver version supports VLANs. -For information on enabling VLANs, see the -.Pa README . +For information on enabling VLANs, see +.Xr vlan 4 . +For additional information on configuring VLANs, see +.Xr ifconfig 8 Ap s +.Dq VLAN Parameters +section. .Pp Offloads are also controlled via the interface, for instance, checksumming for both IPv4 and IPv6 can be set and unset, TSO4 and/or TSO6, and finally LRO can @@ -95,29 +111,739 @@ be set and unset. .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Pp +The associated Virtual Function (VF) driver for this driver is +.Xr iavf 4 . +.Pp +The associated RDMA driver for this driver is +.Xr irdma 4 . +.Ss Dynamic Device Personalization +The DDP package loads during device initialization. +The driver looks for the +.Sy ice_ddp +module and checks that it contains a valid DDP package file. +.Pp +If the driver is unable to load the DDP package, the device will enter Safe +Mode. +Safe Mode disables advanced and performance features and supports only +basic traffic and minimal functionality, such as updating the NVM or +downloading a new driver or DDP package. +Safe Mode only applies to the affected physical function and does not impact +any other PFs. +See the +.Dq Intel\(rg Ethernet Adapters and Devices User Guide +for more details on DDP and Safe Mode. +.Pp +If you encounter issues with the DDP package file, you may need to download +an updated driver or +.Sy ice_ddp +module. +See the log messages for more information. +.Pp +You cannot update the DDP package if any PF drivers are already loaded. +To overwrite a package, unload all PFs and then reload the driver with the +new package. +.Pp +You can only use one DDP package per driver, even if you have more than one +device installed that uses the driver. +.Pp +Only the first loaded PF per device can download a package for that device. +.Ss Jumbo Frames +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. +.Pp +Use +.Xr ifconfig 8 +to increase the MTU size. +.Pp +The maximum MTU setting for jumbo frames is 9706. +This corresponds to the maximum jumbo frame size of 9728 bytes. +.Pp +This driver will attempt to use multiple page sized buffers to receive +each jumbo packet. +This should help to avoid buffer starvation issues when allocating receive +packets. +.Pp +Packet loss may have a greater impact on throughput when you use jumbo +frames. +If you observe a drop in performance after enabling jumbo frames, enabling +flow control may mitigate the issue. +.Ss Remote Direct Memory Access +Remote Direct Memory Access, or RDMA, allows a network device to transfer data +directly to and from application memory on another system, increasing +throughput and lowering latency in certain networking environments. +.Pp +The ice driver supports both the iWARP (Internet Wide Area RDMA Protocol) and +RoCEv2 (RDMA over Converged Ethernet) protocols. +The major difference is that iWARP performs RDMA over TCP, while RoCEv2 uses +UDP. +.Pp +Devices based on the Intel\(rg Ethernet 800 Series do not support RDMA when +operating in multiport mode with more than 4 ports. +.Pp +For detailed installation and configuration information for RDMA, see +.Xr irdma 4 . +.Ss RDMA Monitoring +For debugging/testing purposes, you can use sysctl to set up a mirroring +interface on a port. +The interface can receive mirrored RDMA traffic for packet +analysis tools like +.Xr tcpdump 1 . +This mirroring may impact performance. +.Pp +To use RDMA monitoring, you may need to reserve more MSI\-X interrupts. +Before the +.Nm +driver loads, configure the following tunable provided by +.Xr iflib 4 : +.Bd -literal -offset indent +dev.ice.<interface #>.iflib.use_extra_msix_vectors=4 +.Ed +.Pp +You may need to adjust the number of extra MSI\-X interrupt vectors. +.Pp +To create/delete the interface: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.create_interface=1 +sysctl dev.ice.<interface #>.delete_interface=1 +.Ed +.Pp +The mirrored interface receives both LAN and RDMA traffic. +Additional filters can be configured in tcpdump. +.Pp +To differentiate the mirrored interface from the primary interface, the network +interface naming convention is: +.Bd -literal -offset indent +<driver name><port number><modifier><modifier unit number> +.Ed +.Pp +For example, +.Dq Li ice0m0 +is the first mirroring interface on +.Dq Li ice0 . +.Ss Data Center Bridging +Data Center Bridging (DCB) is a configuration Quality of Service +implementation in hardware. +It uses the VLAN priority tag (802.1p) to filter traffic. +That means that there are 8 different priorities that traffic can be filtered +into. +It also enables priority flow control (802.1Qbb) which can limit or eliminate +the number of dropped packets during network stress. +Bandwidth can be allocated to each of these priorities, which is enforced at +the hardware level (802.1Qaz). +.Pp +DCB is normally configured on the network using the DCBX protocol (802.1Qaz), a +specialization of LLDP (802.1AB). The +.Nm +driver supports the following mutually exclusive variants of DCBX support: +.Bl -bullet -compact +.It +Firmware\-based LLDP Agent +.It +Software\-based LLDP Agent +.El +.Pp +In firmware\-based mode, firmware intercepts all LLDP traffic and handles DCBX +negotiation transparently for the user. +In this mode, the adapter operates in +.Dq willing +DCBX mode, receiving DCB settings from the link partner (typically a +switch). +The local user can only query the negotiated DCB configuration. +For information on configuring DCBX parameters on a switch, please consult the +switch manufacturer'ss documentation. +.Pp +In software\-based mode, LLDP traffic is forwarded to the network stack and user +space, where a software agent can handle it. +In this mode, the adapter can operate in +.Dq nonwilling +DCBX mode and DCB configuration can be both queried and set locally. +This mode requires the FW\-based LLDP Agent to be disabled. +.Pp +Firmware\-based mode and software\-based mode are controlled by the +.Dq fw_lldp_agent +sysctl. +Refer to the Firmware Link Layer Discovery Protocol Agent section for more +information. +.Pp +Link\-level flow control and priority flow control are mutually exclusive. +The ice driver will disable link flow control when priority flow control +is enabled on any traffic class (TC). +It will disable priority flow control when link flow control is enabled. +.Pp +To enable/disable priority flow control in software\-based DCBX mode: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.pfc=1 (or 0 to disable) +.Ed +.Pp +Enhanced Transmission Selection (ETS) allows you to assign bandwidth to certain +TCs, to help ensure traffic reliability. +To view the assigned ETS configuration, use the following: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.ets_min_rate +.Ed +.Pp +To set the minimum ETS bandwidth per TC, separate the values by commas. +All values must add up to 100. +For example, to set all TCs to a minimum bandwidth of 10% and TC 7 to 30%, +use the following: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.ets_min_rate=10,10,10,10,10,10,10,30 +.Ed +.Pp +To set the User Priority (UP) to a TC mapping for a port, separate the values +by commas. +For example, to map UP 0 and 1 to TC 0, UP 2 and 3 to TC 1, UP 4 and +5 to TC 2, and UP 6 and 7 to TC 3, use the following: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.up2tc_map=0,0,1,1,2,2,3,3 +.Ed +.Ss L3 QoS mode +The +.Nm +driver supports setting DSCP\-based Layer 3 Quality of Service (L3 QoS) +in the PF driver. +The driver initializes in L2 QoS mode by default; L3 QoS is disabled by +default. +Use the following sysctl to enable or disable L3 QoS: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.pfc_mode=1 (or 0 to disable) +.Ed +.Pp +If you disable L3 QoS mode, it returns to L2 QoS mode. +.Pp +To map a DSCP value to a traffic class, separate the values by commas. +For example, to map DSCPs 0\-3 and DSCP 8 to DCB TCs 0\-3 and 4, respectively: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.dscp2tc_map.0\-7=0,1,2,3,0,0,0,0 +sysctl dev.ice.<interface #>.dscp2tc_map.8\-15=4,0,0,0,0,0,0,0 +.Ed +.Pp +To change the DSCP mapping back to the default traffic class, set all the +values back to 0. +.Pp +To view the currently configured mappings, use the following: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.dscp2tc_map +.Ed +.Pp +L3 QoS mode is not available when FW\-LLDP is enabled. +.Pp +You also cannot enable FW\-LLDP if L3 QoS mode is active. +.Pp +Disable FW\-LLDP before switching to L3 QoS mode. +.Pp +Refer to the +.Sx Firmware Link Layer Discovery Protocol Agent +section in this README for more information on disabling FW\-LLDP. +.Ss Firmware Link Layer Discovery Protocol Agent +Use sysctl to change FW\-LLDP settings. +The FW\-LLDP setting is per port and persists across boots. +.Pp +To enable the FW\-LLDP Agent: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.fw_lldp_agent=1 +.Ed +.Pp +To disable the FW\-LLDP Agebt: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.fw_lldp_agent=0 +.Ed +.Pp +To check the current LLDP setting: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.fw_lldp_agent +.Ed +.Pp +You must enable the UEFI HII LLDP Agent attribute for this setting +to take effect. +If the +.Dq LLDP AGENT +attribute is set to disabled, you cannot enable the FW\-LLDP Agent from the +driver. +.Ss Link\-Level Flow Control (LFC) +Ethernet Flow Control (IEEE 802.3x) can be configured with sysctl to enable +receiving and transmitting pause frames for +.Nm . +When transmit is enabled, pause frames are generated when the receive packet +buffer crosses a predefined threshold. +When receive is enabled, the transmit unit will halt for the time delay +specified in the firmware when a pause frame is received. +.Pp +Flow Control is disabled by default. +.Pp +Use sysctl to change the flow control settings for a single interface without +reloading the driver: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.fc +.Ed +.Pp +The available values for flow control are: +.Bd -literal -offset indent +0 = Disable flow control +1 = Enable Rx pause +2 = Enable Tx pause +3 = Enable Rx and Tx pause +.Ed +.Pp +Verify that link flow control was negotiated on the link by checking the +interface entry in +.Xr ifconfig 8 +and looking for the flags +.Dq txpause +and/or +.Dq rxpause +in the +.Dq media +status. +.Pp +The +.Nm +driver requires flow control on both the port and link partner. +If flow control is disabled on one of the sides, the port may appear to +hang on heavy traffic. +.Pp +For more information on priority flow control, refer to the +.Sx Data Center Bridging +section. +.Pp +The VF driver does not have access to flow control. +It must be managed from the host side. +.Ss Forward Error Correction +Forward Error Correction (FEC) improves link stability but increases latency. +Many high quality optics, direct attach cables, and backplane channels can +provide a stable link without FEC. +.Pp +For devices to benefit from this feature, link partners must have FEC enabled. +.Pp +If you enable the sysctl +.Em allow_no_fec_modules_in_auto +Auto FEC negotiation will include +.Dq No FEC +in case your link partner does not have FEC enabled or is not FEC capable: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.allow_no_fec_modules_in_auto=1 +.Ed +.Pp +NOTE: This flag is currently not supported on the Intel\(rg Ethernet 830 +Series. +.Pp +To show the current FEC settings that are negotiated on the link: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.negotiated_fec +.Ed +.Pp +To view or set the FEC setting that was requested on the link: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.requested_fec +.Ed +.Pp +To see the valid FEC modes for the link: +.Bd -literal -offset indent +sysctl \-d dev.ice.<interface #>.requested_fec +.Ed +.Ss Speed and Duplex Configuration +You cannot set duplex or autonegotiation settings. +.Pp +To have your device change the speeds it will use in auto-negotiation or +force link with: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.advertise_speed=<mask> +.Ed +.Pp +Supported speeds will vary by device. +Depending on the speeds your device supports, valid bits used in a speed mask +could include: +.Bd -literal -offset indent +0x0 \- Auto +0x2 \- 100 Mbps +0x4 \- 1 Gbps +0x8 \- 2.5 Gbps +0x10 \- 5 Gbps +0x20 \- 10 Gbps +0x80 \- 25 Gbps +0x100 \- 40 Gbps +0x200 \- 50 Gbps +0x400 \- 100 Gbps +0x800 \- 200 Gbps +.Ed +.Ss Disabling physical link when the interface is brought down +When the +.Va link_active_on_if_down +sysctl is set to +.Dq 0 , +the port's link will go down when the interface is brought down. +By default, link will stay up. +.Pp +To disable link when the interface is down: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.link_active_on_if_down=0 +.Ed +.Ss Firmware Logging +The +.Nm +driver allows for the generation of firmware logs for supported categories of +events, to help debug issues with Customer Support. +Refer to the +.Dq Intel\(rg Ethernet Adapters and Devices User Guide +for an overview of this feature and additional tips. +.Pp +At a high level, to capture a firmware log: +.Bl -enum -compact +.It +Set the configuration for the firmware log. +.It +Perform the necessary steps to generate the issue you are trying to debug. +.It +Capture the firmware log. +.It +Stop capturing the firmware log. +.It +Reset your firmware log settings as needed. +.It +Work with Customer Support to debug the issue. +.El +.Pp +NOTE: Firmware logs are generated in a binary format and must be decoded by +Customer Support. +Information collected is related only to firmware and hardware for debug +purposes. +.Pp +Once the driver is loaded, it will create the +.Va fw_log +sysctl node under the debug section of the driver's sysctl list. +The driver groups these events into categories, called +.Dq modules . +Supported modules include: +.Pp +.Bl -tag -offset indent -compact -width "task_dispatch" +.It Va general +General (Bit 0) +.It Va ctrl +Control (Bit 1) +.It Va link +Link Management (Bit 2) +.It Va link_topo +Link Topology Detection (Bit 3) +.It Va dnl +Link Control Technology (Bit 4) +.It Va i2c +I2C (Bit 5) +.It Va sdp +SDP (Bit 6) +.It Va mdio +MDIO (Bit 7) +.It Va adminq +Admin Queue (Bit 8) +.It Va hdma +Host DMA (Bit 9) +.It Va lldp +LLDP (Bit 10) +.It Va dcbx +DCBx (Bit 11) +.It Va dcb +DCB (Bit 12) +.It Va xlr +XLR (function\-level resets; Bit 13) +.It Va nvm +NVM (Bit 14) +.It Va auth +Authentication (Bit 15) +.It Va vpd +Vital Product Data (Bit 16) +.It Va iosf +Intel On\-Chip System Fabric (Bit 17) +.It Va parser +Parser (Bit 18) +.It Va sw +Switch (Bit 19) +.It Va scheduler +Scheduler (Bit 20) +.It Va txq +TX Queue Management (Bit 21) +.It Va acl +ACL (Access Control List; Bit 22) +.It Va post +Post (Bit 23) +.It Va watchdog +Watchdog (Bit 24) +.It Va task_dispatch +Task Dispatcher (Bit 25) +.It Va mng +Manageability (Bit 26) +.It Va synce +SyncE (Bit 27) +.It Va health +Health (Bit 28) +.It Va tsdrv +Time Sync (Bit 29) +.It Va pfreg +PF Registration (Bit 30) +.It Va mdlver +Module Version (Bit 31) +.El +.Pp +You can change the verbosity level of the firmware logs. +You can set only one log level per module, and each level includes the +verbosity levels lower than it. +For instance, setting the level to +.Dq normal +will also log warning and error messages. +Available verbosity levels are: +.Pp +.Bl -item -offset indent -compact +.It +0 = none +.It +1 = error +.It +2 = warning +.It +3 = normal +.It +4 = verbose +.El +.Pp +To set the desired verbosity level for a module, use the following sysctl +command and then register it: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.debug.fw_log.severity.<module>=<level> +.Ed +.Pp +For example: +.Bd -literal -offset indent +sysctl dev.ice.0.debug.fw_log.severity.link=1 +sysctl dev.ice.0.debug.fw_log.severity.link_topo=2 +sysctl dev.ice.0.debug.fw_log.register=1 +.Ed +.Pp +To log firmware messages after booting, but before the driver initializes, use +.Xr kenv 1 +to set the tunable. +The +.Va on_load +setting tells the device to register the variable as soon as possible during +driver load. +For example: +.Bd -literal -offset indent +kenv dev.ice.0.debug.fw_log.severity.link=1 +kenv dev.ice.0.debug.fw_log.severity.link_topo=2 +kenv dev.ice.0.debug.fw_log.on_load=1 +.Ed +.Pp +To view the firmware logs and redirect them to a file, use the following +command: +.Bd -literal -offset indent +dmesg > log_output +.Ed +.Pp +NOTE: Logging a large number of modules or too high of a verbosity level will +add extraneous messages to dmesg and could hinder debug efforts. +.Ss Debug Dump +Intel\(rg Ethernet 800 Series devices support debug dump, which allows you to +obtain runtime register values from the firmware for +.Dq clusters +of events and then write the results to a single dump file, for debugging +complicated issues in the field. +.Pp +This debug dump contains a snapshot of the device and its existing hardware +configuration, such as switch tables, transmit scheduler tables, and other +information. +Debug dump captures the current state of the specified cluster(s) and is a +stateless snapshot of the whole device. +.Pp +NOTE: Like with firmware logs, the contents of the debug dump are not +human\-readable. +You must work with Customer Support to decode the file. +.Pp +Debug dump is per device, not per PF. +.Pp +Debug dump writes all information to a single file. +.Pp +To generate a debug dump file in +.Fx +do the following: +.Pp +Specify the cluster(s) to include in the dump file, using a bitmask and the +following command: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.debug.dump.clusters=<bitmask> +.Ed +.Pp +To print the complete cluster bitmask and parameter list to the screen, +pass the +.Fl d +argument. +For example: +.Bd -literal -offset indent +sysctl \-d dev.ice.0.debug.dump.clusters +.Ed +.Pp +Possible bitmask values for +.Va clusters +are: +.Bl -bullet -compact +.It +0 \- Dump all clusters (only supported on Intel\(rg Ethernet E810 Series and +Intel\(rg Ethernet E830 Series) +.It +0x1 \- Switch +.It +0x2 \- ACL +.It +0x4 \- Tx Scheduler +.It +0x8 \- Profile Configuration +.It +0x20 \- Link +.It +0x80 \- DCB +.It +0x100 \- L2P +.It +0x400000 \- Manageability Transactions (only supported on Intel\(rg Ethernet +E810 Series) +.El +.Pp +For example, to dump the Switch, DCB, and L2P clusters, use the following: +.Bd -literal -offset indent +sysctl dev.ice.0.debug.dump.clusters=0x181 +.Ed +.Pp +To dump all clusters, use the following: +.Bd -literal -offset indent +sysctl dev.ice.0.debug.dump.clusters=0 +.Ed +.Pp +NOTE: Using 0 will skip Manageability Transactions data. +.Pp +If you don't specify a cluster, the driver will dump all clusters to a +single file. +Issue the debug dump command, using the following: +.Bd -literal -offset indent +sysctl \-b dev.ice.<interface #>.debug.dump.dump=1 > dump.bin +.Ed +.Pp +NOTE: The driver will not receive the command if you do not write +.Dq 1 +to the sysctl. +.Pp +Replace +.Dq dump.bin +above with the file name you want to use. +.Pp +To clear the +.Va clusters +mask before a subsequent debug dump and then do the dump: +.Bd -literal -offset indent +sysctl dev.ice.0.debug.dump.clusters=0 +sysctl dev.ice.0.debug.dump.dump=1 +.Ed +.Ss Debugging PHY Statistics +The ice driver supports the ability to obtain the values of the PHY registers +from Intel(R) Ethernet 810 Series devices in order to debug link and +connection issues during runtime. +.Pp +The driver allows you to obtain information about: +.Bl -bullet +.It +Rx and Tx Equalization parameters +.It +RS FEC correctable and uncorrectable block counts +.El +.Pp +Use the following sysctl to read the PHY registers: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.debug.phy_statistics +.Ed +.Pp +NOTE: The contents of the registers are not human\-readable. +Like with firmware logs and debug dump, you must work with Customer Support +to decode the file. +.Ss Transmit Balancing +Some Intel(R) Ethernet 800 Series devices allow you to enable a transmit +balancing feature to improve transmit performance under certain conditions. +When the feature is enabled, you should experience more consistent transmit +performance across queues and/or PFs and VFs. +.Pp +By default, transmit balancing is disabled in the NVM. +To enable this feature, use one of the following to persistently change the +setting for the device: +.Bl -bullet +.It +Use the Ethernet Port Configuration Tool (EPCT) to enable the +.Va tx_balancing +option. +Refer to the EPCT readme for more information. +.It +Enable the Transmit Balancing device setting in UEFI HII. +.El +.Pp +When the driver loads, it reads the transmit balancing setting from the NVM and +configures the device accordingly. +.Pp +NOTE: The user selection for transmit balancing in EPCT or HII is persistent +across reboots. +You must reboot the system for the selected setting to take effect. +.Pp +This setting is device wide. +.Pp +The driver, NVM, and DDP package must all support this functionality to +enable the feature. +.Ss Thermal Monitoring +Intel(R) Ethernet 810 Series and Intel(R) Ethernet 830 Series devices can +display temperature data (in degrees Celsius) via: +.Bd -literal -offset indent +sysctl dev.ice.<interface #>.temp +.Ed +.Ss Network Memory Buffer Allocation +.Fx +may have a low number of network memory buffers (mbufs) by default. +If the number of mbufs available is too low, it may cause the driver to fail +to initialize and/or cause the system to become unresponsive. +You can check to see if the system is mbuf\-starved by running +.Ic netstat Fl m . +Increase the number of mbufs by editing the lines below in +.Pa /etc/sysctl.conf : +.Bd -literal -offset indent +kern.ipc.nmbclusters +kern.ipc.nmbjumbop +kern.ipc.nmbjumbo9 +kern.ipc.nmbjumbo16 +kern.ipc.nmbufs +.Ed +.Pp +The amount of memory that you allocate is system specific, and may require some +trial and error. +Also, increasing the following in +.Pa /etc/sysctl.conf +could help increase network performance: +.Bd -literal -offset indent +kern.ipc.maxsockbuf +net.inet.tcp.sendspace +net.inet.tcp.recvspace +net.inet.udp.maxdgram +net.inet.udp.recvspace +.Ed .Ss Additional Utilities There are additional tools available from Intel to help configure and update the adapters covered by this driver. These tools can be downloaded directly from Intel at .Lk https://downloadcenter.intel.com , -by searching for their names, or by installing certain packages: +by searching for their names: .Bl -bullet .It -To change the behavior of the QSFP28 ports on E810-C adapters, use the -Intel EPCT (Ethernet Port configuration tool); installed by the -.Em sysutils/intel-epct -package. +To change the behavior of the QSFP28 ports on E810-C adapters, use the Intel +.Sy Ethernet Port Configuration Tool - FreeBSD . .It -To update the firmware on an adapter, use the Intel Non-Volatile Memory (NVM) -Update Utility for Intel Network Adapter 800 series; installed by the -.Em sysutils/intel-nvmupdate-100g -package. +To update the firmware on an adapter, use the Intel +.Sy Non-Volatile Memory (NVM) Update Utility for Intel Ethernet Network Adapters E810 series - FreeBSD .El .Sh HARDWARE The .Nm driver supports the Intel Ethernet 800 series. -Most adapters in this series with SFP28/QSFP28 cages +Some adapters in this series with SFP28/QSFP28 cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. @@ -173,6 +899,38 @@ SFF-8472 v10.4 specifications. .Pp This is not an exhaustive list; please consult product documentation for an up-to-date list of supported media. +.Ss Fiber optics and auto\-negotiation +Modules based on 100GBASE\-SR4, active optical cable (AOC), and active copper +cable (ACC) do not support auto\-negotiation per the IEEE specification. +To obtain link with these modules, auto\-negotiation must be turned off on the +link partner's switch ports. +.Ss PCI-Express Slot Bandwidth +Some PCIe x8 slots are actually configured as x4 slots. +These slots have insufficient bandwidth for full line rate with dual port and +quad port devices. +In addition, if you put a PCIe v4.0 or v3.0\-capable adapter into a PCIe v2.x +slot, you cannot get full bandwidth. +.Pp +The driver detects this situation and writes the following message in the +system log: +.Bd -literal -offset indent +PCI\-Express bandwidth available for this device may be insufficient for +optimal performance. +Please move the device to a different PCI\-e link with more lanes and/or +higher transfer rate. +.Ed +.Pp +If this error occurs, moving your adapter to a true PCIe x8 or x16 slot will +resolve the issue. +For best performance, install devices in the following PCI slots: +.Bl -bullet +.It +Any 100Gbps\-capable Intel(R) Ethernet 800 Series device: Install in a +PCIe v4.0 x8 or v3.0 x16 slot +.It +A 200Gbps\-capable Intel(R) Ethernet 830 Series device: Install in a +PCIe v5.0 x8 or v4.0 x16 slot +.El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -182,42 +940,62 @@ See the .Xr iflib 4 man page for more information on using iflib sysctl variables as tunables. .Bl -tag -width indent -.It Va hw.ice.#.enable_health_events -TBW -.It Va hw.ice.#.debug.enable_tx_fc_filter -TBW -.It Va hw.ice.#.debug.enable_tx_lldp_filter -TBW -.It Va hw.ice.#.debug.enable_health_events -TBW -.El -.Sh SYSCTL PROCEDURES +.It Va hw.ice.enable_health_events +Set to 1 to enable firmware health event reporting across all devices. +Enabled by default. +.Pp +If enabled, when the driver receives a firmware health event message, it will +print out a description of the event to the kernel message buffer and if +applicable, possible actions to take to remedy it. +.It Va hw.ice.irdma +Set to 1 to enable the RDMA client interface, required by the +.Xr irdma 4 +driver. +Enabled by default. +.It Va hw.ice.rdma_max_msix +Set the maximum number of per-device MSI-X vectors that are allocated for use +by the +.Xr irdma 4 +driver. +Set to 64 by default. +.It Va hw.ice.debug.enable_tx_fc_filter +Set to 1 to enable the TX Flow Control filter across all devices. +Enabled by default. +.Pp +If enabled, the hardware will drop any transmitted Ethertype 0x8808 control +frames that do not originate from the hardware. +.It Va hw.ice.debug.enable_tx_lldp_filter +Set to 1 to enable the TX LLDP filter across all devices. +Enabled by default. +.Pp +If enabled, the hardware will drop any transmitted Ethertype 0x88cc LLDP frames +that do not originate from the hardware. +This must be disabled in order to use LLDP daemon software such as +.Xr lldpd 8 . +.It Va hw.ice.debug.ice_tx_balance_en +Set to 1 to allow the driver to use the 5-layer Tx Scheduler tree topology if +configured by the DDP package. +.Pp +Enabled by default. +.El +.Sh SYSCTL VARIABLES .Bl -tag -width indent -.It Va dev.ice.#.fc -Allows one to set the flow control value. -A value of 0 disables flow control, 3 enables full, 1 is RX, and 2 is -TX pause. -.It Va dev.ice.#.advertise_speed -Allows one to set advertised link speeds, this will then cause a link -renegotiation. .It Va dev.ice.#.current_speed -This is a display of the current setting. +This is a display of the current link speed of the interface. +This is expected to match the speed of the media type in-use displayed by +.Xr ifconfig 8 . .It Va dev.ice.#.fw_version Displays the current firmware and NVM versions of the adapter. +This information should be submitted along with any support requests. .It Va dev.ice.#.ddp_version -TBW -.It Va dev.ice.#.requested_fec -TBW -.It Va dev.ice.#.negotiated_fec -TBW -.It Va dev.ice.#.fw_lldp_agent -TBW -.It Va dev.ice.#.ets_min_rate -TBW -.It Va dev.ice.#.up2tc_map -TBW -.It Va dev.ice.#.pfc -TBW +Displays the current DDP package version downloaded to the adapter. +This information should be submitted along with any support requests. +.It Va dev.ice.#.pba_number +Displays the Product Board Assembly Number. +May be used to help identify the type of adapter in use. +This sysctl may not exist depending on the adapter type. +.It Va dev.ice.#.hw.mac.* +This sysctl tree contains statistics collected by the hardware for the port. .El .Sh INTERRUPT STORMS It is important to note that 100G operation can generate high @@ -226,21 +1004,77 @@ a storm condition in the kernel. It is suggested that this be resolved by setting .Va hw.intr_storm_threshold to 0. +.Sh IOVCTL OPTIONS +The driver supports additional optional parameters for created VFs +(Virtual Functions) when using +.Xr iovctl 8 : +.Bl -tag -width indent +.It mac-addr Pq unicast-mac +Set the Ethernet MAC address that the VF will use. +If unspecified, the VF will use a randomly generated MAC address and +.Dq allow-set-mac +will be set to true. +.It mac-anti-spoof Pq bool +Prevent the VF from sending Ethernet frames with a source address +that does not match its own. +Enabled by default. +.It allow-set-mac Pq bool +Allow the VF to set its own Ethernet MAC address. +Disallowed by default. +.It allow-promisc Pq bool +Allow the VF to inspect all of the traffic sent to the port that it is created +on. +Disabled by default. +.It num-queues Pq uint16_t +Specify the number of queues the VF will have. +By default, this is set to the number of MSI\-X vectors supported by the VF +minus one. +.It mirror-src-vsi Pq uint16_t +Specify which VSI the VF will mirror traffic from by setting this to a value +other than \-1. +All traffic from that VSI will be mirrored to this VF. +Can be used as an alternative method to mirror RDMA traffic to another +interface than the method described in the +.Sx RDMA Monitoring +section. +Not affected by the +.Dq allow-promisc +parameter. +.It max-vlan-allowed Pq uint16_t +Specify maximum number of VLAN filters that the VF can use. +Receiving traffic on a VLAN requires a hardware filter which are a finite +resource; this is used to prevent a VF from starving other VFs or the PF of +filter resources. +By default, this is set to 16. +.It max-mac-filters Pq uint16_t +Specify maximum number of MAC address filters that the VF can use. +Each allowed MAC address requires a hardware filter which are a finite +resource; this is used to prevent a VF from starving other VFs or the PF of +filter resources. +The VF's default mac address does not count towards this limit. +By default, this is set to 64. +.El +.Pp +An up to date list of parameters and their defaults can be found by using +.Xr iovctl 8 +with the +.Fl S +option. +.Pp +For more information on standard and mandatory parameters, see +.Xr iovctl.conf 5 . .Sh SUPPORT -For general information and support, -go to the Intel support website at: +For general information and support, go to the Intel support website at: .Lk http://www.intel.com/support/ . .Pp If an issue is identified with this driver with a supported adapter, email all the specific information related to the issue to .Aq Mt freebsd@intel.com . .Sh SEE ALSO -.Xr arp 4 , .Xr iflib 4 , -.Xr netintro 4 , -.Xr ng_ether 4 , .Xr vlan 4 , -.Xr ifconfig 8 +.Xr ifconfig 8 , +.Xr sysctl 8 .Sh HISTORY The .Nm diff --git a/share/man/man4/iflib.4 b/share/man/man4/iflib.4 index 0114263e6ca2..2040698f0087 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -1,4 +1,4 @@ -.Dd September 27, 2018 +.Dd August 20, 2025 .Dt IFLIB 4 .Os .Sh NAME @@ -64,6 +64,18 @@ If this is zero or not set, an RX and TX queue pair will be assigned to each core. When set to a non-zero value, TX queues are assigned to cores following the last RX queue. +.It Va simple_tx +When set to one, iflib uses a simple transmit routine with no queuing at all. +By default, iflib uses a highly optimized, lockless, transmit queue called +mp_ring. +This performs well when there are more CPU cores than NIC +queues and prevents lock contention for transmit resources. +Unfortunately, mp_ring incurs unneeded overheads on workloads where +resource contention is not a problem (well behaved applications on +systems where there are as many NIC queues as CPU cores). +Note that when this is enabled, the tx_abdicate sysctl is no longer +applicable and is ignored. +Defaults to zero. .El .Pp These diff --git a/share/man/man4/ioat.4 b/share/man/man4/ioat.4 index deef466c0ae0..1c0e1dd49fd1 100644 --- a/share/man/man4/ioat.4 +++ b/share/man/man4/ioat.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd May 3, 2016 -.Dt IOAT 4 +.Dt IOAT 4 amd64 .Os .Sh NAME .Nm I/OAT diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4 index 3da4e68ad805..660f6a9bf57c 100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 12, 2025 +.Dd August 19, 2025 .Dt IWLWIFI 4 .Os .Sh NAME @@ -54,7 +54,7 @@ See section .Sx "FILES" below for how to install the firmware. .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The @@ -302,6 +302,17 @@ driver requires firmware from This firmware package will be installed automatically with .Xr fwget 8 if the appropriate hardware is detected at installation or runtime. +.Pp +As a last resort for bootstrapping, individual firmware files can be +manually downloaded, e.g., on a different computer and transferred using a +.Xr umass 4 +device. +The firmware files can be found at +.Lk git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git +with names as requested by the driver. +Copies should be placed into the +.Pa /boot/firmware +directory. .Sh SEE ALSO .Xr iwlwififw 4 , .Xr iwm 4 , @@ -320,7 +331,7 @@ driver first appeared in 802.11n and 802.11ac support for the 22000 and later chipsets first appeared in .Fx 14.3 . .Sh BUGS -Certainly. +.Lk https://bugs.freebsd.org/bugzilla/showdependencytree.cgi?id=iwlwifi "iwlwifi known bugs" .Pp While .Nm diff --git a/share/man/man4/iwx.4 b/share/man/man4/iwx.4 index 7cd54d61b920..295a5f318afa 100644 --- a/share/man/man4/iwx.4 +++ b/share/man/man4/iwx.4 @@ -18,7 +18,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd May 2, 2025 -.Dt IWX 4 +.Dt IWX 4 amd64 .Os .Sh NAME .Nm iwx diff --git a/share/man/man4/linuxkpi.4 b/share/man/man4/linuxkpi.4 new file mode 100644 index 000000000000..cd4135c28d6d --- /dev/null +++ b/share/man/man4/linuxkpi.4 @@ -0,0 +1,42 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI 4 +.Os +.Sh NAME +.Nm linuxkpi +.Nd Linux Kernel Programming Interface support +.Sh DESCRIPTION +The +.Nm +kernel module provides a limited KPI (kernel programming interface) to allow +Linux kernel drivers and other Linux kernel code to be compiled on +.Fx +and used along the +.Fx +kernel with little or no modification. +.Pp +While historically +.Em OpenFabrics Enterprise Distribution (Infiniband) , +and certain vendor drivers have used +.Nm . +.Em drm-kmod +for graphics driver support +and +.Xr linuxkpi_wlan 4 +for wireless drivers are prominent consumers. +.Pp +.Nm +is not to be confused with +.Xr linux 4 +which provides limited Linux ABI (application binary interface) compatibility +to allow running Linux application binaries unmodified on +.Fx . +.Sh SEE ALSO +.Xr linuxkpi_wlan 4 diff --git a/share/man/man4/linuxkpi_wlan.4 b/share/man/man4/linuxkpi_wlan.4 new file mode 100644 index 000000000000..136e04c32bb7 --- /dev/null +++ b/share/man/man4/linuxkpi_wlan.4 @@ -0,0 +1,134 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI_WLAN 4 +.Os +.Sh NAME +.Nm linuxkpi_wlan +.Nd LinuxKPI 802.11 support +.Sh DESCRIPTION +The +.Nm +kernel module provides an 802.11 compat layer to translate between Linux +802.11 drivers and the native net8011 wireless stack. +It currently supports +.Em mac80211 +based drivers. +Parts of the +.Em cfg80211 +exist but there is no code for net80211 to drive it. +.Pp +.Nm +currently supports the following +.Em wlanmode +operating modes: +.Bl -tag -width monitor -compact +.It Cm sta +client station in an infrastructure bss (IBSS). +.El +.Pp +Compat code for 802.11n (HT) and 802.11ac (VHT) is implemented but +support may vary for different drivers due to different KPI usage. +.Pp +Crypto support for hardware acceleration needs to be enabled using the +.Va compat.linuxkpi.80211.hw_crypto +tunable. +The following cipher suites are supported: +.Bl -tag -width CCMP -compact +.It Cm tkip +Support for +.Xr wlan_tkip 4 +has to be manually enabled using the +.Va compat.linuxkpi.80211.tkip +tunable. +.It Cm ccmp +Support for +.Xr wlan_ccmp 4 +is available. +.It Cm gcmp +Support for +.Xr wlan_gcmp 4 +is available. +.El +Further cipher suites will be implemented as soon as +.Xr net80211 4 +grows support. +While it would be possible to implement +.Xr wlan_wep 4 +support, it was decided not to do so given +.Em Wired Equivalent Privacy (WEP) +has been deprecated since 2004. +.Pp +The list of supported drivers includes +.Xr iwlwifi 4 , +.Xr rtw88 4 , +and +.Xr rtw89 4 . +.Sh SYSCTL VARIABLES AND LOADER TUNABLES +The +.Nm +module supports the following +.Xr loader 8 +tunable and read-only +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.hw_crypto" +.It Va compat.linuxkpi.80211.hw_crypto +Turn on hardware crypto offload support. +Default +.Ql 0 . +.It Va compat.linuxkpi.80211.tkip +Turn on support for +.Xr wlan_tkip 4 +offloading. +Default +.Ql 0 . +.El +.Pp +The +.Nm +module supports the following +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.IF.dump_stas" +.It Va compat.linuxkpi.80211.debug +If the kernel is compiled with +.Dv IEEE80211_DEBUG +or +.Dv LINUXKPI_DEBUG_80211 +is manually enabled, the sysctl is a bitmask to turn on individual +debug messages. +See +.Pa sys/compat/linuxkpi/common/src/linux_80211.h +for details. +.It Va compat.linuxkpi.80211.IF.dump_stas +Print statistics for a given, associated +.Xr wlan 4 +interface; typically IF would be +.Em wlan0 . +.El +.Sh SEE ALSO +.Xr iwlwifi 4 , +.Xr linuxkpi 4 , +.Xr rtw88 4 , +.Xr rtw89 4 , +.Xr wlan 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 13.1 . +Support for IEEE 802.11n and 802.11ac in +.Nm +first appeared in +.Fx 14.3 . +.Sh AUTHORS +LinuxKPI 802.11 support was developed by +.An Bjoern A. Zeeb +under sponsorship from the FreeBSD Foundation. diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index 4c067205225c..4dcb54c89673 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -8,7 +8,7 @@ .\" <olce@FreeBSD.org> at Kumacom SARL under sponsorship from the FreeBSD .\" Foundation. .\" -.Dd December 19, 2024 +.Dd June 11, 2025 .Dt MAC_DO 4 .Os .Sh NAME @@ -44,7 +44,7 @@ It supports per-jail configuration. .Pp Currently, the .Nm -policy module only produces effects to processes spwaned from the +policy module only produces effects to processes spawned from the .Pa /usr/bin/mdo executable, please see .Xr mdo 1 @@ -348,12 +348,12 @@ Here are several examples of single rules matching processes having a real user ID of 10001: .Bl -tag -width indent .It Li uid=10001>uid=10002 -Allows the process to switch any of its real, effective or saved user ID to +Allows the process to switch all of its real, effective or saved user ID to 10002, but keeping the groups it is already in, and with the same primary/supplementary groups split. .It Li uid=10001>uid=10002,uid=10003 Same as the first example, but also allows to switch to UID 10003 instead of -10002. +10002, or possibly having both in different user IDs. .It Li uid=10001>uid=10002,gid=10002 Same as the first example, but the new primary groups must be set to 10002 and no supplementary groups should be set. @@ -387,7 +387,7 @@ group, allowing its members to switch to root without password. .It Li gid=10001>gid=10002 Allows the process to enter GID 10002 as a primary group, but only if giving up all its supplementary groups. -.It Li security.mac.do.rules=gid=10001>gid=10002,+gid=.\& +.It Li gid=10001>gid=10002,+gid=.\& Same as the previous example, but allows to retain any current supplementary groups. .It Li gid=10001>gid=10002,!gid=.\& diff --git a/share/man/man4/man4.aarch64/armv8crypto.4 b/share/man/man4/man4.aarch64/armv8crypto.4 index 7b8704395daf..0f763adc5766 100644 --- a/share/man/man4/man4.aarch64/armv8crypto.4 +++ b/share/man/man4/man4.aarch64/armv8crypto.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd July 29, 2020 -.Dt ARMV8CRYPTO 4 +.Dt ARMV8CRYPTO 4 aarch64 .Os .Sh NAME .Nm armv8crypto diff --git a/share/man/man4/man4.aarch64/enetc.4 b/share/man/man4/man4.aarch64/enetc.4 index 33f796347f96..e7cfcb7ebe0e 100644 --- a/share/man/man4/man4.aarch64/enetc.4 +++ b/share/man/man4/man4.aarch64/enetc.4 @@ -25,7 +25,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd June 11, 2021 -.Dt ENETC 4 +.Dt ENETC 4 aarch64 .Os .Sh NAME .Nm enetc diff --git a/share/man/man4/man4.aarch64/felix.4 b/share/man/man4/man4.aarch64/felix.4 index 15caef6d274f..b97f3c2168e8 100644 --- a/share/man/man4/man4.aarch64/felix.4 +++ b/share/man/man4/man4.aarch64/felix.4 @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .Dd June 21, 2021 -.Dt FELIX 4 +.Dt FELIX 4 aarch64 .Os .Sh NAME .Nm felix diff --git a/share/man/man4/man4.aarch64/rk_gpio.4 b/share/man/man4/man4.aarch64/rk_gpio.4 index b5648662cf5e..b2767dd66dce 100644 --- a/share/man/man4/man4.aarch64/rk_gpio.4 +++ b/share/man/man4/man4.aarch64/rk_gpio.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd Apr 26, 2018 -.Dt RK_GPIO 4 +.Dt RK_GPIO 4 aarch64 .Os .Sh NAME .Nm rk_gpio diff --git a/share/man/man4/man4.aarch64/rk_grf.4 b/share/man/man4/man4.aarch64/rk_grf.4 index 64ed468c1983..b01a93091ecb 100644 --- a/share/man/man4/man4.aarch64/rk_grf.4 +++ b/share/man/man4/man4.aarch64/rk_grf.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd Apr 26, 2018 -.Dt RK_GRF 4 +.Dt RK_GRF 4 aarch64 .Os .Sh NAME .Nm rk_grf diff --git a/share/man/man4/man4.aarch64/rk_grf_gpio.4 b/share/man/man4/man4.aarch64/rk_grf_gpio.4 index 6a5ebbe19e3b..2bfbebce1b76 100644 --- a/share/man/man4/man4.aarch64/rk_grf_gpio.4 +++ b/share/man/man4/man4.aarch64/rk_grf_gpio.4 @@ -4,7 +4,7 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd March 18, 2025 -.Dt RK_GRF_GPIO 4 +.Dt RK_GRF_GPIO 4 aarch64 .Os .Sh NAME .Nm rk_grf_gpio diff --git a/share/man/man4/man4.aarch64/rk_i2c.4 b/share/man/man4/man4.aarch64/rk_i2c.4 index be1a0fab943e..363cdeac7f72 100644 --- a/share/man/man4/man4.aarch64/rk_i2c.4 +++ b/share/man/man4/man4.aarch64/rk_i2c.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd June 14, 2018 -.Dt RK_I2C 4 +.Dt RK_I2C 4 aarch64 .Os .Sh NAME .Nm rk_i2c diff --git a/share/man/man4/man4.aarch64/rk_pinctrl.4 b/share/man/man4/man4.aarch64/rk_pinctrl.4 index 519b3e793cd1..2be5f363498d 100644 --- a/share/man/man4/man4.aarch64/rk_pinctrl.4 +++ b/share/man/man4/man4.aarch64/rk_pinctrl.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd Apr 26, 2018 -.Dt RK_PINCTRL 4 +.Dt RK_PINCTRL 4 aarch64 .Os .Sh NAME .Nm rk_pinctrl diff --git a/share/man/man4/man4.arm/am335x_dmtpps.4 b/share/man/man4/man4.arm/am335x_dmtpps.4 index d565c65e2cf1..bec5ff7726a0 100644 --- a/share/man/man4/man4.arm/am335x_dmtpps.4 +++ b/share/man/man4/man4.arm/am335x_dmtpps.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd August 12, 2015 -.Dt AM335X_DMTPPS 4 +.Dt AM335X_DMTPPS 4 arm .Os .Sh NAME .Nm am335x_dmtpps diff --git a/share/man/man4/man4.arm/aw_gpio.4 b/share/man/man4/man4.arm/aw_gpio.4 index 5cbc7562d9bd..ef9fc1fe2733 100644 --- a/share/man/man4/man4.arm/aw_gpio.4 +++ b/share/man/man4/man4.arm/aw_gpio.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd October 8, 2024 -.Dt AW_GPIO 4 +.Dt AW_GPIO 4 arm .Os .Sh NAME .Nm aw_gpio diff --git a/share/man/man4/man4.arm/aw_mmc.4 b/share/man/man4/man4.arm/aw_mmc.4 index eb7fc9ce020a..e3f961fa5067 100644 --- a/share/man/man4/man4.arm/aw_mmc.4 +++ b/share/man/man4/man4.arm/aw_mmc.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd Dec 25, 2017 -.Dt AW_MMC 4 +.Dt AW_MMC 4 arm .Os .Sh NAME .Nm aw_mmc diff --git a/share/man/man4/man4.arm/aw_rtc.4 b/share/man/man4/man4.arm/aw_rtc.4 index 1296cd41da68..87212d85116c 100644 --- a/share/man/man4/man4.arm/aw_rtc.4 +++ b/share/man/man4/man4.arm/aw_rtc.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd December 10, 2024 -.Dt AW_RTC 4 +.Dt AW_RTC 4 arm .Os .Sh NAME .Nm aw_rtc diff --git a/share/man/man4/man4.arm/aw_sid.4 b/share/man/man4/man4.arm/aw_sid.4 index 5cd2f3d5e072..8b3691259f22 100644 --- a/share/man/man4/man4.arm/aw_sid.4 +++ b/share/man/man4/man4.arm/aw_sid.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd October 8, 2024 -.Dt AW_SID 4 +.Dt AW_SID 4 arm .Os .Sh NAME .Nm aw_sid diff --git a/share/man/man4/man4.arm/aw_spi.4 b/share/man/man4/man4.arm/aw_spi.4 index f8985e1c16bb..d0566a45b54b 100644 --- a/share/man/man4/man4.arm/aw_spi.4 +++ b/share/man/man4/man4.arm/aw_spi.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd May 17, 2018 -.Dt AW_SPI 4 +.Dt AW_SPI 4 arm .Os .Sh NAME .Nm aw_spi diff --git a/share/man/man4/man4.arm/aw_syscon.4 b/share/man/man4/man4.arm/aw_syscon.4 index e32f329e489a..97f01196a8a6 100644 --- a/share/man/man4/man4.arm/aw_syscon.4 +++ b/share/man/man4/man4.arm/aw_syscon.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd November 11, 2024 -.Dt AW_SYSCON 4 +.Dt AW_SYSCON 4 arm .Os .Sh NAME .Nm aw_syscon diff --git a/share/man/man4/man4.arm/bcm283x_pwm.4 b/share/man/man4/man4.arm/bcm283x_pwm.4 index 1fb5a830ace7..71d7f0cc3cca 100644 --- a/share/man/man4/man4.arm/bcm283x_pwm.4 +++ b/share/man/man4/man4.arm/bcm283x_pwm.4 @@ -25,7 +25,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd September 10, 2018 -.Dt BCM283X_PWM 4 +.Dt BCM283X_PWM 4 arm .Os .Sh NAME .Nm bcm283x_pwm diff --git a/share/man/man4/man4.arm/devcfg.4 b/share/man/man4/man4.arm/devcfg.4 index ddf368a85f24..cbc205814c69 100644 --- a/share/man/man4/man4.arm/devcfg.4 +++ b/share/man/man4/man4.arm/devcfg.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .Dd February 28, 2013 -.Dt DEVCFG 4 +.Dt DEVCFG 4 arm .Os .Sh NAME .Nm devcfg diff --git a/share/man/man4/man4.arm/imx6_ahci.4 b/share/man/man4/man4.arm/imx6_ahci.4 index 9979cef50d79..50689e323db8 100644 --- a/share/man/man4/man4.arm/imx6_ahci.4 +++ b/share/man/man4/man4.arm/imx6_ahci.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd July 7, 2018 -.Dt IMX6_AHCI 4 +.Dt IMX6_AHCI 4 arm .Os .Sh NAME .Nm imx6_ahci diff --git a/share/man/man4/man4.arm/imx6_snvs.4 b/share/man/man4/man4.arm/imx6_snvs.4 index b36c3ddd91c1..2c1db97b231c 100644 --- a/share/man/man4/man4.arm/imx6_snvs.4 +++ b/share/man/man4/man4.arm/imx6_snvs.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd July 8, 2018 -.Dt IMX6_SNVS 4 +.Dt IMX6_SNVS 4 arm .Os .Sh NAME .Nm imx6_snvs diff --git a/share/man/man4/man4.arm/imx_spi.4 b/share/man/man4/man4.arm/imx_spi.4 index e7555ed20d94..54a5339e3276 100644 --- a/share/man/man4/man4.arm/imx_spi.4 +++ b/share/man/man4/man4.arm/imx_spi.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd July 9, 2018 -.Dt IMX_SPI 4 +.Dt IMX_SPI 4 arm .Os .Sh NAME .Nm imx_spi diff --git a/share/man/man4/man4.arm/imx_wdog.4 b/share/man/man4/man4.arm/imx_wdog.4 index 4b993e1d066b..cb4d0e13865b 100644 --- a/share/man/man4/man4.arm/imx_wdog.4 +++ b/share/man/man4/man4.arm/imx_wdog.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd July 7, 2018 -.Dt IMX_WDOG 4 +.Dt IMX_WDOG 4 arm .Os .Sh NAME .Nm imx_wdog diff --git a/share/man/man4/man4.arm/mge.4 b/share/man/man4/man4.arm/mge.4 index e949b36f4307..cba9327eadcf 100644 --- a/share/man/man4/man4.arm/mge.4 +++ b/share/man/man4/man4.arm/mge.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd November 27, 2008 -.Dt MGE 4 +.Dt MGE 4 arm .Os .Sh NAME .Nm mge diff --git a/share/man/man4/man4.arm/ti_adc.4 b/share/man/man4/man4.arm/ti_adc.4 index d71547231e4c..fb59e1d3e57c 100644 --- a/share/man/man4/man4.arm/ti_adc.4 +++ b/share/man/man4/man4.arm/ti_adc.4 @@ -23,7 +23,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd June 1, 2014 -.Dt TI_ADC 4 +.Dt TI_ADC 4 arm .Os .Sh NAME .Nm ti_adc diff --git a/share/man/man4/man4.powerpc/abtn.4 b/share/man/man4/man4.powerpc/abtn.4 index 92d643d5cf32..7421d0a0b5a6 100644 --- a/share/man/man4/man4.powerpc/abtn.4 +++ b/share/man/man4/man4.powerpc/abtn.4 @@ -25,7 +25,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd October 16, 2011 -.Dt ABTN 4 +.Dt ABTN 4 powerpc .Os .Sh NAME .Nm abtn diff --git a/share/man/man4/man4.powerpc/adb.4 b/share/man/man4/man4.powerpc/adb.4 index a781787995ab..6041484b5e33 100644 --- a/share/man/man4/man4.powerpc/adb.4 +++ b/share/man/man4/man4.powerpc/adb.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 3, 2009 -.Dt ADB 4 +.Dt ADB 4 powerpc .Os .Sh NAME .Nm adb diff --git a/share/man/man4/man4.powerpc/akbd.4 b/share/man/man4/man4.powerpc/akbd.4 index 44af08961122..3406f5a1aa76 100644 --- a/share/man/man4/man4.powerpc/akbd.4 +++ b/share/man/man4/man4.powerpc/akbd.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 3, 2009 -.Dt AKBD 4 +.Dt AKBD 4 powerpc .Os .Sh NAME .Nm akbd diff --git a/share/man/man4/man4.powerpc/ams.4 b/share/man/man4/man4.powerpc/ams.4 index 21be3c098920..d7fa922e7307 100644 --- a/share/man/man4/man4.powerpc/ams.4 +++ b/share/man/man4/man4.powerpc/ams.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 3, 2009 -.Dt AMS 4 +.Dt AMS 4 powerpc .Os .Sh NAME .Nm ams diff --git a/share/man/man4/man4.powerpc/cuda.4 b/share/man/man4/man4.powerpc/cuda.4 index 7171ebb42373..a52b9a447c9d 100644 --- a/share/man/man4/man4.powerpc/cuda.4 +++ b/share/man/man4/man4.powerpc/cuda.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 3, 2009 -.Dt CUDA 4 +.Dt CUDA 4 powerpc .Os .Sh NAME .Nm cuda diff --git a/share/man/man4/man4.powerpc/dtsec.4 b/share/man/man4/man4.powerpc/dtsec.4 index 4a60dd0b8824..f18de90c4757 100644 --- a/share/man/man4/man4.powerpc/dtsec.4 +++ b/share/man/man4/man4.powerpc/dtsec.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd October 31, 2017 -.Dt DTSEC 4 +.Dt DTSEC 4 powerpc .Os .Sh NAME .Nm dtsec diff --git a/share/man/man4/man4.powerpc/llan.4 b/share/man/man4/man4.powerpc/llan.4 index c32ddbca6a00..b78109cac626 100644 --- a/share/man/man4/man4.powerpc/llan.4 +++ b/share/man/man4/man4.powerpc/llan.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd February 19, 2015 -.Dt LLAN 4 +.Dt LLAN 4 powerpc .Os .Sh NAME .Nm llan diff --git a/share/man/man4/man4.powerpc/pmu.4 b/share/man/man4/man4.powerpc/pmu.4 index 6eac20cfa6b7..4dfb31f175bd 100644 --- a/share/man/man4/man4.powerpc/pmu.4 +++ b/share/man/man4/man4.powerpc/pmu.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd December 6, 2008 -.Dt PMU 4 +.Dt PMU 4 powerpc .Os .Sh NAME .Nm pmu diff --git a/share/man/man4/man4.powerpc/smu.4 b/share/man/man4/man4.powerpc/smu.4 index ef2654746e62..852a08abaa9e 100644 --- a/share/man/man4/man4.powerpc/smu.4 +++ b/share/man/man4/man4.powerpc/smu.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd February 22, 2010 -.Dt SMU 4 +.Dt SMU 4 powerpc .Os .Sh NAME .Nm smu diff --git a/share/man/man4/man4.powerpc/snd_ai2s.4 b/share/man/man4/man4.powerpc/snd_ai2s.4 index 3880751e65c9..7a3cd9cb94af 100644 --- a/share/man/man4/man4.powerpc/snd_ai2s.4 +++ b/share/man/man4/man4.powerpc/snd_ai2s.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd January 20, 2009 -.Dt SND_AI2S 4 +.Dt SND_AI2S 4 powerpc .Os .Sh NAME .Nm snd_ai2s diff --git a/share/man/man4/man4.powerpc/snd_davbus.4 b/share/man/man4/man4.powerpc/snd_davbus.4 index 6958ebd4b4b5..028225accf52 100644 --- a/share/man/man4/man4.powerpc/snd_davbus.4 +++ b/share/man/man4/man4.powerpc/snd_davbus.4 @@ -24,7 +24,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd January 20, 2009 -.Dt SND_DAVBUS 4 +.Dt SND_DAVBUS 4 powerpc .Os .Sh NAME .Nm snd_davbus diff --git a/share/man/man4/man4.powerpc/tsec.4 b/share/man/man4/man4.powerpc/tsec.4 index b3ccae648ab8..09510e329ff0 100644 --- a/share/man/man4/man4.powerpc/tsec.4 +++ b/share/man/man4/man4.powerpc/tsec.4 @@ -24,7 +24,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd February 20, 2015 -.Dt TSEC 4 +.Dt TSEC 4 powerpc .Os .Sh NAME .Nm tsec diff --git a/share/man/man4/md.4 b/share/man/man4/md.4 index 0c99d61f8392..1da26ddda037 100644 --- a/share/man/man4/md.4 +++ b/share/man/man4/md.4 @@ -5,7 +5,7 @@ .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\" ---------------------------------------------------------------------------- .\" -.Dd January 8, 2020 +.Dd July 16, 2025 .Dt MD 4 .Os .Sh NAME @@ -158,7 +158,7 @@ installation process. The .Nm driver did a hostile takeover of the -.Xr vn 4 +.Sy vn driver in .Fx 5.0 . .Sh AUTHORS diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index a5443f308088..4b9ab7070d72 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm mlx -.Nd Mylex DAC-family Ultra-SCSI RAID driver +.Nd Mylex DAC-family Parallel SCSI RAID driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,29 +54,29 @@ including versions relabeled by Digital/Compaq. .Sh HARDWARE The .Nm -driver supports the following Ultra-SCSI RAID controllers: +driver supports the following Parallel SCSI RAID controllers: .Pp .Bl -bullet -compact .It -Mylex DAC960P +Mylex DAC960P (Wide Fast SCSI-2) .It -Mylex DAC960PD / DEC KZPSC (Fast Wide) +Mylex DAC960PD / DEC KZPSC (Wide Fast SCSI-2) .It -Mylex DAC960PDU +Mylex DAC960PDU (Ultra SCSI-3) .It -Mylex DAC960PL +Mylex DAC960PL (Wide Fast SCSI-2) .It -Mylex DAC960PJ +Mylex DAC960PJ (Wide Ultra SCSI-3) .It -Mylex DAC960PG +Mylex DAC960PG (Wide Ultra SCSI-3) .It -Mylex DAC960PU / DEC PZPAC (Ultra Wide) +Mylex DAC960PU / DEC PZPAC (Wide Ultra SCSI-3) .It -Mylex AcceleRAID 150 (DAC960PRL) +Mylex AcceleRAID 150 (DAC960PRL) (Wide Ultra2 SCSI) .It -Mylex AcceleRAID 250 (DAC960PTL1) +Mylex AcceleRAID 250 (DAC960PTL1) (Wide Ultra2 SCSI) .It -Mylex eXtremeRAID 1100 (DAC1164P) +Mylex eXtremeRAID 1100 (DAC1164P) (Wide Ultra2 SCSI) .It RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) diff --git a/share/man/man4/mtw.4 b/share/man/man4/mtw.4 index 17722be73203..6aa59d848d36 100644 --- a/share/man/man4/mtw.4 +++ b/share/man/man4/mtw.4 @@ -24,23 +24,41 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Feb 03, 2025 +.Dd May 3, 2025 .Dt MTW 4 .Os .Sh NAME -.Nm if_mtw -.Nd "Mediatek MT7601U" -.Ed +.Nm mtw +.Nd MediaTek MT7601U USB IEEE 802.11n wireless network driver +.Sh SYNOPSIS +.Cd device usb +.Cd device mtw +.Cd device wlan +.Pp +In +.Xr rc.conf 5 : +.Cd kld_list="if_mtw" .Sh DESCRIPTION -This module provides support for Mediatek MT7601U with the firmware from net/wifi-firmware-mtw-kmod - +This module provides support for +MediaTek MT7601U USB wireless network adapters. +If the appropriate hardware is detected, +the driver will be automatically loaded with +.Xr devmatch 8 . +If driver autoloading is explicitly disabled, enable the module in +.Xr rc.conf 5 . +The +.Nm +driver can be configured at runtime with +.Xr ifconfig 8 +or at boot with +.Xr rc.conf 5 . .Sh HARDWARE The .Nm -driver supports Mediatek MT7601U -based USB wireless network adapters including (but not all of them tested): +driver supports MediaTek MT7601U based USB wireless network adapters +including (but not all of them tested): .Pp -.Bl -column -compact +.Bl -bullet -compact .It ASUS USB-N10 v2 .It @@ -58,17 +76,43 @@ TP-LINK TL-WN727N v4 (tested working) .It Yealink WF40 .El +.Sh FILES +The +.Nm +driver requires firmware from +.Pa ports/net/wifi-firmware-mt7601u-kmod . +This firmware package will be installed automatically with +.Xr fwget 8 +if the appropriate hardware is detected at installation or runtime. .Sh SEE ALSO -.Xr usb 4 -.Sh BUGS +.Xr usb 4 , +.Xr wlan 4 , +.Xr networking 7 , +.Xr fwget 8 , +.Xr wpa_supplicant 8 +.Sh HISTORY The .Nm -only works in station mode and monitor mode. The firmware does not always reinitialize when reloading the module, or when rebooting, without first unplugging the device. -.Sh History -The mtw driver first appeared in OpenBSD 7.1. The mtw driver was ported to FreeBSD in FreeBSD 15.0. +driver first appeared in +.Ox 7.1 +and +.Fx 15.0 . .Sh AUTHORS .An -nosplit -The mtw driver was written by +The +.Nm +driver was written by .An James Hastings Aq Mt hastings@openbsd.org -ported to FreeBSD by -.An Jesper Schmitz Mouridsen Aq Mt jsm@FreeBSD.org +and ported to +.Fx +by +.An Jesper Schmitz Mouridsen Aq Mt jsm@FreeBSD.org . +.Sh BUGS +.Nm +only works in +.Cm station +mode and +.Cm monitor +mode. +The firmware does not always reinitialize when reloading the module, +or when rebooting, without first unplugging the device. diff --git a/share/man/man4/ng_patch.4 b/share/man/man4/ng_patch.4 index 7a8543fd7dd8..9c0d7a8ee512 100644 --- a/share/man/man4/ng_patch.4 +++ b/share/man/man4/ng_patch.4 @@ -80,7 +80,7 @@ Sets the data link type on the .Va in hook (to help calculate relative offset). Currently, supported types are .Cm DLT_RAW -(raw IP datagrams , no offset applied, the default) and +(raw IP datagrams, no offset applied, the default) and .Cm DLT_EN10MB (Ethernet). DLT_ definitions can be found in .In net/bpf.h . @@ -135,6 +135,17 @@ corresponding checksum before transmitting packet on output interface. The .Nm node does not do any checksum correction by itself. +.Pp +The +.Va offset +value for the +.Vt ng_patch_op +structure is calculated from zero by default (the first byte of +packet headers). +If +.Va relative_offset +is enabled (set to 1) during configuration, the operation will have an +additional amount added to the offset based on the data link type. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig This control message returns the current set of modify operations, in the form of a diff --git a/share/man/man4/nvdimm.4 b/share/man/man4/nvdimm.4 index 5b7dbe435c46..2bec51b42d72 100644 --- a/share/man/man4/nvdimm.4 +++ b/share/man/man4/nvdimm.4 @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .Dd September 5, 2019 -.Dt NVDIMM 4 +.Dt NVDIMM 4 amd64 .Os .Sh NAME .Nm nvdimm diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 9ab46558a2d6..03a4ba2bbe7f 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 6, 2024 +.Dd July 2, 2025 .Dt PF 4 .Os .Sh NAME @@ -35,6 +35,23 @@ .Sh SYNOPSIS .Cd "device pf" .Cd "options PF_DEFAULT_TO_DROP" +.Pp +In +.Xr rc.conf 5 : +.Cd pf_enable="YES" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pf.states_hashsize +.Cd net.pf.source_nodes_hashsize +.Cd net.pf.rule_tag_hashsize +.Cd net.pf.udpendpoint_hashsize +.Cd net.pf.default_to_drop +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pf.request_maxcount +.Cd net.pf.filter_local .Sh DESCRIPTION Packet filtering takes place in the kernel. A pseudo-device, @@ -74,10 +91,28 @@ separated by characters, similar to how file system hierarchies are laid out. The final component of the anchor path is the anchor under which operations will be performed. -.Sh SYSCTL VARIABLES AND LOADER TUNABLES -The following +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va net.pf.filter_local +This tells +.Nm +to also filter on the loopback output hook. +This is typically used to allow redirect rules to adjust the source address. +.It Va net.pf.request_maxcount +The maximum number of items in a single ioctl call. +.El +.Sh LOADER TUNABLES +The following tunables can be entered at the .Xr loader 8 -tunables are available. +prompt, or set in +.Xr loader.conf 5 : .Bl -tag -width indent .It Va net.pf.states_hashsize Size of hash table that stores states. @@ -104,11 +139,6 @@ to also filter on the loopback output hook. This is typically used to allow redirect rules to adjust the source address. .It Va net.pf.request_maxcount The maximum number of items in a single ioctl call. -.It Va net.pf.rdr_srcport_rewrite_tries -The maximum number of times to try and find a free source port when handling -redirects. -Such rules are typically applied to external traffic, so an exhaustive search -may be too expensive. .El .Pp Read only @@ -1084,7 +1114,7 @@ will be set to the length of the buffer actually used. .It Dv DIOCCLRSRCNODES Clear the tree of source tracking nodes. .It Dv DIOCIGETIFACES Fa "struct pfioc_iface *io" -Get the list of interfaces and interface drivers known to +Get the list of interfaces and interface groups known to .Nm . All the ioctls that manipulate interfaces use the same structure described below: @@ -1101,7 +1131,7 @@ struct pfioc_iface { .Pp If not empty, .Va pfiio_name -can be used to restrict the search to a specific interface or driver. +can be used to restrict the search to a specific interface or group. .Va pfiio_buffer[pfiio_size] is the user-supplied buffer for returning the data. On entry, diff --git a/share/man/man4/pfsync.4 b/share/man/man4/pfsync.4 index 472a1c05ec5a..cc9c350ea875 100644 --- a/share/man/man4/pfsync.4 +++ b/share/man/man4/pfsync.4 @@ -32,6 +32,14 @@ .Nd packet filter state table synchronisation interface .Sh SYNOPSIS .Cd "device pfsync" +.Pp +In +.Xr loader.conf 5 : +.Cd net.pfsync.pfsync_buckets +.Pp +In +.Xr sysctl.conf 5 : +.Cd net.pfsync.carp_demotion_factor .Sh DESCRIPTION The .Nm @@ -155,12 +163,14 @@ Compatibility with FreeBSD 13.1 has been verified. .It Cm 1400 FreeBSD release 14.0. .El -.Pp -.Nm -has the following -.Xr sysctl 8 -tunables: -.Bl -tag -width ".Va net.pfsync" +.Sh SYSCTL VARIABLES +The following variables can be entered at the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width indent .It Va net.pfsync.carp_demotion_factor Value added to .Va net.inet.carp.demotion @@ -171,6 +181,14 @@ See .Xr carp 4 for more information. Default value is 240. +.El +.Sh LOADER TUNABLES +The following tunable may be set in +.Xr loader.conf 5 +or at the +.Xr loader 8 +prompt: +.Bl -tag -width indent .It Va net.pfsync.pfsync_buckets The number of .Nm diff --git a/share/man/man4/puc.4 b/share/man/man4/puc.4 index 6fde07548e18..a29376d3f2d5 100644 --- a/share/man/man4/puc.4 +++ b/share/man/man4/puc.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2002 John Hay. .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2025 +.Dd June 11, 2025 .Dt PUC 4 .Os .Sh NAME @@ -44,159 +47,112 @@ PCI multi-port serial and parallel adapters to the and .Xr ppc 4 driver. -.Pp -The list of supported devices is in -.Pa sys/dev/puc/pucdata.c . -Support for new cards should be added there. .Sh HARDWARE The .Nm driver supports the following -PCI multi-port serial and parallel adapters: +PCI/PCIe multi-port serial and parallel adapters: .Pp .Bl -bullet -compact .It -Sunix SUN1889 -.It -HP Diva Serial [GSP] Multiport UART: -.Bl -dash -compact +Advantech 2-port PCI PCI-1602/1603 Rev A/B1 .It -Tosca Console -.It -Tosca Secondary -.It -Maestro SP2 +Applied Micro Circuits PCI 8 Port UART .It -Superdome Console +Avlab Technology PCI IO 2S .It -Keystone SP2 +Avlab Low Profile PCI 4 Serial .It -Everest SP2 -.El +Boca Research PCI Turbo Serial 658/654 .It -VScom: +Brainboxes: .Bl -dash -compact .It -PCI-200, PCI-400, and PCI-800 -.El +Instashield PCIe IX-400, IX-200, IX-100 .It -Boca Research Turbo Serial: -.Bl -dash -compact +Instashield PCI IS-400, IS-200 .It -654 and 658 -.El +PX Series PCIe RS232/RS422/RS485/LPT .It -Dolphin Peripherals: -.Bl -dash -compact +UC Series Universal PCI RS232/RS422/RS485/LPT .It -4014 and 4035 +UP Series PCI Dual RS232 .El .It -Applied Micro Circuits 8 Port UART -.It -Digi Neo: -.Bl -dash -compact +Comtrol RocketPort 550 PCI 16/8/4 port .It -PCI 4 and 8 Port +Decision Computer PCCOM PCI 8/4/2 port .It -PCIe 4 and 8 Port (with and without RJ45) -.El +Digi Neo PCIe 4 and 8 Port (with and without RJ45) .It -Comtrol RocketPort: -.Bl -dash -compact -550/4 Normal and RJ45 +Digi Neo PCI 4 and 8 Port .It -550/8 Normal, RJ11 and Octa +Dolphin Peripherals PCI 4035/4014 .It -550/16 -.El -.It -IBM SurePOS 300 Series (481033H) serial ports -.It -SIIG Cyber Series of UART and parallel port boars: +Exar: .Bl -dash -compact .It -Cyber 2S and 2SP1 PCI 16550 -.It -Cyber 4 PCI 16550 -.It -Cyber 4S PCI 16C650 (20x family) -.It -Cyber I/O PCI (10x family and 20x family): +XR17C/D152 .It -Cyber Parallel Dual PCI (10x family and 20x family): +XR17C154 .It -Cyber Serial Dual PCI (10x family and 20x family): +XR17C158 .It -Cyber 2S1P PCI (10x family and 20x family): +XR17V258IV .It -Cyber 4S PCI (10x family and 20x family): +XR17V352 .It -PS8000 8S PCI 16C650 (20x family) +XR17V354 .It -Quartet Serial 850 +XR17V358 .El .It -Brainboxes: -.Bl -dash -compact +Feasso PCI FPP-02 2S1P .It -PX-101 +HP Diva Serial [GSP] Multiport UART: +.Bl -dash -compact .It -PX-246, PX-257, PX-260, PX-279 +Tosca Console .It -PX-310, PX-313, PX-320, PX-346, PX-368 +Tosca Secondary .It -PX-420, PX-431, PX-475 +Maestro SP2 .It -PX-803, PX-820, PX-831, PX-846, PX-857 +Superdome Console .It -UC-101 +Keystone SP2 .It -UC-203, UC-253, UC-257, UC-260, UC-268, UC-279 +Everest SP2 +.El .It -UC-302, UC-310, UC-313, UC-346, UC-357, UC-368 +I-O DATA RSA-PCI2/R .It -UC-414, UC-420, UC-431, UC-475 +IBM SurePOS 300 Series (481033H) serial ports .It -UC-607 +IC Book Labs: +.Bl -dash -compact .It -UC-836 +Dreadnought x16 Pro/Lite .It -UP-189 +Ironclad x8 Pro .It -UP-200 +Gunboat x4 Pro/Lite/Low Profile .It -UP-869, UP-880 +Gunboat x2 Low Profile .El .It -Intashield: -.Bl -dash -compact -.It -IS-200, IS-400 -.It -IX-100, IX-200, IX-400 -.El +Kuroutoshikou SERIAL4P-LPPCI2 .It -Quatech: +Lava Computers: .Bl -dash -compact .It -DSC-100 -.It -DSC-200/300 -.It -DSCLP-100 -.It -DSCLP-200/300 -.It -ESC-100D +Dual Serial PCI .It -ESC-100M +Quattro-PCIe .It -QSC-100 -.It -QSC-200/300 +Quattro-PCI .It -QSCLP-100 +Octopus-550 PCI .El .It Moxa Technologies: @@ -216,7 +172,7 @@ Smartio CP-104EL/PCIe .It Smartio CP-104EL-A/PCIe .It -CP-112UL +CP-112UL PCI .It Industio CP-114 .It @@ -233,47 +189,13 @@ CP-168EL/PCIe Smartio CP-168EL-A/PCIe .El .It -Exar: -.Bl -dash -compact -.It -XR17C/D152 -.It -XR17C154 -.It -XR17C158 -.It -XR17V258IV -.It -XR17V352 -.It -XR17V354 -.It -XR17V358 -.El -.It -Advantech -.Bl -dash -compact -.It -PCI-1602 Rev A -.It -2-port PCI (PCI-1602 Rev B1/PCI-1603) -.El -.It -Lava Computers: -.Bl -dash -compact -.It -Dual Serial -.It -Quattro -.It -Quattro-PCI +NetMos NM9815 Dual 1284 Printer port PCI .It -Octopus-550 -.El +NetMos NM9835 2/1 port UART + 1284 Printer PCI .It -I-O DATA RSA-PCI2/R +NetMos NM9845 4/6 port UART + 1284 Printer PCI .It -Kuroutoshikou SERIAL4P-LPPCI2 +NetMos NM9865 4/3/2 port UART + 1/2 port 1284 Printer PCI .It Oxford Semiconductor based boards: .Bl -dash -compact @@ -287,137 +209,74 @@ OX9160/OX16PCI954 UARTs OX16PCI958 UART .El .It -Perle: -.Bl -dash -compact -.It -Ultraport4 Express -.It -Speed2 LE +Perle Ultraport4 Express PCIe Serial .It -Speed4 LE +Perle Speed8/Speed4/Speed2 LE PCI Serial .It -Speed8 LE -.El -.It -VScom: +Quatech: .Bl -dash -compact .It -PCI-100L +DSC-300/200/100 PCI .It -PCI-200L +DSCLP-300/200/100 PCI .It -200Li -.El +ESC-100/100D/100M PCI .It -Titan: -.Bl -dash -compact -.It -PCI-800H -.It -PCI-800H +QSC-300/200/100 PCI .It -PCI-200H +QSCLP-100 PCI .El .It -Titan VScom: +SIIG Cyber Series of UART and parallel port boards: .Bl -dash -compact .It -PCI-800L -.It -PCI-200HV2 -.It -PCIex-800H -.It -PCIex-800H -.El +Cyber 2S and 2SP1 PCI 16550 .It -Avlab Technology PCI IO 2S +Cyber 4 and 4S PCI 16C650 (10x family and 20x family) .It -Avlab Low Profile PCI 4 Serial +Cyber I/O PCI (10x family and 20x family) .It -Syba Tech Ltd PCI-4S2P-550-ECP +Cyber Parallel Dual PCI (10x family and 20x family) .It -Sunix SUN1888 +Cyber Serial Dual PCI (10x family and 20x family) .It -Sunix SER5xxxx -.Bl -dash -compact +Cyber 2S1P PCI (10x family and 20x family) .It -2, 4 and 8 port serial -.El -.It -Sunix MIO5xxxx (1284 Printer port): -.Bl -dash -compact +PS8000 8S PCI 16C650 (20x family) .It -1, 2 and 4 port serial +Quartet Serial 850 PCI .El .It -Feasso PCI FPP-02 2S1P -.It Sun 1040 PCI Quad Serial .It -Decision Computer Inc PCCOM: -.Bl -dash -compact -.It -4-port serial -.It -8-port serial -.El -.It -PCCOM dual port RS232/422/485 +Sunix MIO5xxxx 4/2/1 port UART and 1284 Printer .It -NetMos NM9815 Dual 1284 Printer port +Sunix SUN1889/1888 PCI dual port serial .It -NetMos NM9835: -.Bl -dash -compact -.It -based 1 and 2 port serial +Sunix SER5xxxx 8/4/2 port serial .It -Dual UART and 1284 Printer port -.El -.It -NetMos NM9845: -.Bl -dash -compact -.It -6 Port UART +Syba Tech Ltd PCI-4S2P-550-ECP .It -Quad UART and 1284 Printer port -.El +Titan PCI-800H/PCI-200H .It -NetMos NM9865: +VScom: .Bl -dash -compact .It -Dual UART -.It -Triple UART +PCIex-800H .It -Quad UART +PCI-200HV2 .It -Single UART and 1284 Printer port +200Li uPCI .It -Dual UART and 1284 Printer port +PCI-800L, PCI-200L, and PCI-100L .It -Dual 1284 Printer port +PCI-800, PCI-400, and PCI-200 .El -.It -IC Book Labs: -.Bl -dash -compact -.It -Gunboat x4 Lite -.It -Gunboat x4 Pro -.It -Ironclad x8 Lite -.It -Ironclad x8 Pro -.It -Dreadnought x16 Pro -.It -Dreadnought x16 Lite -.It -Gunboat x2 Low Profile -.It -Gunboat x4 Low Profile .El +.Sh FILES +.Bl -tag -width "sys/dev/puc/pucdata.c" +.It Pa sys/dev/puc/pucdata.c +list of supported devices .El .Sh SEE ALSO .Xr ppc 4 , diff --git a/share/man/man4/qlnxe.4 b/share/man/man4/qlnxe.4 index f545235ec1ff..70bad789add1 100644 --- a/share/man/man4/qlnxe.4 +++ b/share/man/man4/qlnxe.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .Dd May 9, 2017 -.Dt QLNXE 4 +.Dt QLNXE 4 amd64 .Os .Sh NAME .Nm qlnxe diff --git a/share/man/man4/qlxgb.4 b/share/man/man4/qlxgb.4 index 4bf8000d15da..cc97cd060a3f 100644 --- a/share/man/man4/qlxgb.4 +++ b/share/man/man4/qlxgb.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .Dd November 3, 2011 -.Dt QLXGB 4 +.Dt QLXGB 4 amd64 .Os .Sh NAME .Nm qlxgb diff --git a/share/man/man4/qlxgbe.4 b/share/man/man4/qlxgbe.4 index 486a5ec0f682..465e4fc018ad 100644 --- a/share/man/man4/qlxgbe.4 +++ b/share/man/man4/qlxgbe.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .Dd April 1, 2013 -.Dt QLXGBE 4 +.Dt QLXGBE 4 amd64 .Os .Sh NAME .Nm qlxgbe diff --git a/share/man/man4/qlxge.4 b/share/man/man4/qlxge.4 index 4723c56ff68b..14a1e1284fab 100644 --- a/share/man/man4/qlxge.4 +++ b/share/man/man4/qlxge.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .Dd June 21, 2013 -.Dt QLXGE 4 +.Dt QLXGE 4 amd64 .Os .Sh NAME .Nm qlxge diff --git a/share/man/man4/rights.4 b/share/man/man4/rights.4 index 0c24f6b45f88..8f5f6ad9c2d2 100644 --- a/share/man/man4/rights.4 +++ b/share/man/man4/rights.4 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 1, 2024 +.Dd May 22, 2025 .Dt RIGHTS 4 .Os .Sh NAME @@ -319,6 +319,14 @@ Permit .It Dv CAP_GETSOCKOPT Permit .Xr getsockopt 2 . +.It Dv CAP_INOTIFY_ADD +Permit +.Xr inotify_add_watch 2 +and +.Xr inotify_add_watch_at 2 . +.It Dv CAP_INOTIFY_RM +Permit +.Xr inotify_rm_watch 2 . .It Dv CAP_IOCTL Permit .Xr ioctl 2 . diff --git a/share/man/man4/rtw88.4 b/share/man/man4/rtw88.4 index 1165c5763de8..4c2cba8311ae 100644 --- a/share/man/man4/rtw88.4 +++ b/share/man/man4/rtw88.4 @@ -1,30 +1,9 @@ .\"- -.\" SPDX-License-Identifer: BSD-2-Clause +.\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2022-2024 Bjoern A. Zeeb +.\" Copyright (c) 2022-2025 Bjoern A. Zeeb .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW88 4 .Os .Sh NAME @@ -44,7 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw88" .Ed .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/rtw89.4 b/share/man/man4/rtw89.4 index 5834a804630c..8c7132673db5 100644 --- a/share/man/man4/rtw89.4 +++ b/share/man/man4/rtw89.4 @@ -1,30 +1,9 @@ .\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2023-2024 Bjoern A. Zeeb +.\" Copyright (c) 2023-2025 Bjoern A. Zeeb .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW89 4 .Os .Sh NAME @@ -44,7 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw89" .Ed .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/sa.4 b/share/man/man4/sa.4 index 96b11ebe5360..6c948a0f21ab 100644 --- a/share/man/man4/sa.4 +++ b/share/man/man4/sa.4 @@ -82,21 +82,19 @@ the case where a control mode device is opened. In the latter case, exclusive access is only sought when needed (e.g., to set parameters). .Sh SUB-MODES -Bits 0 and 1 of the minor number are interpreted as -.Sq sub-modes . The sub-modes differ in the action taken when the device is closed: .Bl -tag -width XXXX -.It 00 +.It Pa /dev/sa* A close will rewind the device; if the tape has been written, then a file mark will be written before the rewind is requested. The device is unmounted. -.It 01 +.It Pa /dev/nsa* A close will leave the tape mounted. If the tape was written to, a file mark will be written. No other head positioning takes place. Any further reads or writes will occur directly after the last read, or the written file mark. -.It 10 +.It Pa /dev/esa* A close will rewind the device. If the tape has been written, then a file mark will be written before the rewind is requested. @@ -457,7 +455,8 @@ One EOM notification will be sent, BPEW status will be set for one position query, and then the driver state will be reset to normal. .Sh SEE ALSO .Xr mt 1 , -.Xr cam 4 +.Xr cam 4 , +.Xr mtio 4 .Sh AUTHORS .An -nosplit The diff --git a/share/man/man4/sfxge.4 b/share/man/man4/sfxge.4 index a9724074581e..ea35cf3e573c 100644 --- a/share/man/man4/sfxge.4 +++ b/share/man/man4/sfxge.4 @@ -27,7 +27,7 @@ .\" policies, either expressed or implied, of the FreeBSD Project. .\" .Dd February 22, 2015 -.Dt SFXGE 4 +.Dt SFXGE 4 amd64 .Os .Sh NAME .Nm sfxge diff --git a/share/man/man4/smartpqi.4 b/share/man/man4/smartpqi.4 index 5b7ea923e13e..f5fab85d13bd 100644 --- a/share/man/man4/smartpqi.4 +++ b/share/man/man4/smartpqi.4 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .Dd August 24, 2023 -.Dt SMARTPQI 4 +.Dt SMARTPQI 4 amd64 .Os .Sh NAME .Nm smartpqi diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4 index 45ad2ee132ca..93bac0e5b3b9 100644 --- a/share/man/man4/snd_hda.4 +++ b/share/man/man4/snd_hda.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006-2008 Joel Dahl <joel@FreeBSD.org> .\" Copyright (c) 2008 Alexander Motin <mav@FreeBSD.org> .\" All rights reserved. @@ -23,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 16, 2019 +.Dd January 20, 2025 .Dt SND_HDA 4 .Os .Sh NAME @@ -384,6 +387,15 @@ Run-time equivalent of the .Va hint.pcm.%d.rec.autosrc tunable. .El +.Sh HARDWARE +The +.Nm +driver supports PCI class 04h +.Pq multimedia , +subclass 03h +.Pq HDA +audio controllers and codecs compatible with the +Intel High Definition Audio 1.0 specification. .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. This system has two audio connectors on a front side, three audio connectors @@ -583,17 +595,6 @@ other random inputs Controls have different precision. Some could be just an on/off triggers. Most of controls use logarithmic scale. -.Sh HARDWARE -The -.Nm -driver supports controllers having PCI class 4 (multimedia) and -subclass 3 (HDA), compatible with Intel HDA specification. -.Pp -The -.Nm -driver supports more than two hundred different controllers and CODECs. -There is no sense to list all of them here, as in most cases specific CODEC -configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr snd_ich 4 , .Xr sound 4 , diff --git a/share/man/man4/snd_uaudio.4 b/share/man/man4/snd_uaudio.4 index 00329a6d8e40..7193c85fa4f0 100644 --- a/share/man/man4/snd_uaudio.4 +++ b/share/man/man4/snd_uaudio.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uaudio.4,v 1.15 2002/02/12 19:53:57 jdolecek Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -27,32 +30,30 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 15, 2025 +.Dd July 17, 2025 .Dt SND_UAUDIO 4 .Os .Sh NAME .Nm snd_uaudio .Nd USB audio and MIDI device driver .Sh SYNOPSIS -To compile this driver into the kernel, place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device sound" .Cd "device usb" .Cd "device snd_uaudio" -.Ed .Pp -Alternatively, to load the driver as a module at boot time, place the -following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -snd_uaudio_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for USB audio class devices and USB MIDI class devices. +In +.Xr rc.conf 5 : +.Cd kld_list="snd_uaudio" .Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uaudio.buffer_ms +.Cd hw.usb.uaudio.default_bits +.Cd hw.usb.uaudio.default_channels +.Cd hw.usb.uaudio.default_rate +.Cd hw.usb.uaudio.handle_hid +.Cd hw.usb.uaudio.debug +.Sh DESCRIPTION A USB audio device consists of a number of components: input terminals (e.g.\& USB digital input), output terminals (e.g.\& speakers), and a number of units in between (e.g.\& volume control). @@ -68,6 +69,11 @@ sample rate and sample size. Refer to the .Ql USB Audio Class Specification for more information. +.Sh HARDWARE +The +.Nm +driver provides support for USB audio class devices and +USB MIDI class devices. .Sh SYSCTL VARIABLES The following settings can be entered at the .Xr loader 8 diff --git a/share/man/man4/sume.4 b/share/man/man4/sume.4 index 219328a4f4c4..b36f924875e6 100644 --- a/share/man/man4/sume.4 +++ b/share/man/man4/sume.4 @@ -25,7 +25,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd August 30, 2020 -.Dt SUME 4 +.Dt SUME 4 amd64 .Os .Sh NAME .Nm sume diff --git a/share/man/man4/tap.4 b/share/man/man4/tap.4 index 95a681a923d2..a4fe98cdfecf 100644 --- a/share/man/man4/tap.4 +++ b/share/man/man4/tap.4 @@ -203,6 +203,21 @@ The argument should be a pointer to a The interface name will be returned in the .Va ifr_name field. +.It Dv TAPSTRANSIENT +The argument should be a pointer to an +.Va int ; +this sets the transient flag on +the +.Nm +device. +A transient +.Nm +will be destroyed upon last close. +.It Dv TAPGTRANSIENT +The argument should be a pointer to an +.Va int ; +this stores the current state (enabled or disabled) of the transient flag into +it. .It Dv FIONBIO Turn non-blocking I/O for reads off or on, according as the argument .Va int Ns 's diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index d53d8086e8c0..fcfda42908d8 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 10, 2025 +.Dd June 27, 2025 .Dt TCP 4 .Os .Sh NAME @@ -780,21 +780,34 @@ Minimum TCP Maximum Segment Size; used to prevent a denial of service attack from an unreasonably low MSS. .It Va msl The Maximum Segment Lifetime, in milliseconds, for a packet. +.It Va msl_local +The Maximum Segment Lifetime, in milliseconds, for a packet when both endpoints +are local. +.Va msl_local +is only used if +.Va nolocaltimewait , +which is deprecated, is zero. .It Va mssdflt The default value used for the TCP Maximum Segment Size .Pq Dq MSS for IPv4 when no advice to the contrary is received from MSS negotiation. -.It Va newcwd +.It Va newcwv Enable the New Congestion Window Validation mechanism as described in RFC 7661. This gently reduces the congestion window during periods, where TCP is application limited and the network bandwidth is not utilized completely. That prevents self-inflicted packet losses once the application starts to transmit data at a higher speed. .It Va nolocaltimewait -Suppress creation of TCP +Suppress the creation of TCP .Dv TIME_WAIT states for connections in which both endpoints are local. +The default is 0. +.Va nolocaltimewait +is deprecated and will be removed in +.Fx 16 . +.Va msl_local +can be used instead. .It Va path_mtu_discovery Enable Path MTU Discovery. .It Va pcbcount @@ -871,10 +884,13 @@ segment is lost (default and maximum is 12). .It Va rexmit_drop_options Drop TCP options from third and later retransmitted SYN segments of a connection. -.It Va rexmit_initial , rexmit_min , rexmit_slop +.It Va rexmit_initial , rexmit_min , rexmit_slop , rexmit_max Adjust the retransmit timer calculation for .Tn TCP . -The slop is +A new connection starts with timer set to +.Va rexmit_initial . +The +.Va rexmit_slop typically added to the raw calculation to take into account occasional variances that the .Tn SRTT @@ -894,6 +910,11 @@ For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . The initial value is used before an RTT measurement has been performed. +The +.Va rexmit_min +and +.Va rexmit_max +set minimum and maximum timer values that a connection may have. .It Va rfc1323 Implement the window scaling and timestamp options of RFC 1323/RFC 7323 (default is 1). diff --git a/share/man/man4/tun.4 b/share/man/man4/tun.4 index 58f67cb20acb..1c5bd35f0ab8 100644 --- a/share/man/man4/tun.4 +++ b/share/man/man4/tun.4 @@ -282,6 +282,21 @@ The argument should be a pointer to an the ioctl sets the value to one if the device is in .Dq multi-af mode, and zero otherwise. +.It Dv TUNSTRANSIENT +The argument should be a pointer to an +.Va int ; +this sets the transient flag on +the +.Nm +device. +A transient +.Nm +will be destroyed upon last close. +.It Dv TUNGTRANSIENT +The argument should be a pointer to an +.Va int ; +this stores the current state (enabled or disabled) of the transient flag into +it. .It Dv FIONBIO Turn non-blocking I/O for reads off or on, according as the argument .Vt int Ns 's diff --git a/share/man/man4/u2f.4 b/share/man/man4/u2f.4 new file mode 100644 index 000000000000..4c51e140242e --- /dev/null +++ b/share/man/man4/u2f.4 @@ -0,0 +1,96 @@ +.\" +.\" SPDX-License-Identifier: ISC +.\" +.\" $OpenBSD: fido.4,v 1.4 2020/08/21 19:02:46 mglocker Exp $ +.\" +.\" Copyright (c) 2019 Reyk Floeter <reyk@openbsd.org> +.\" Copyright (c) 2023 Vladimir Kondratyev <wulf@FreeBSD.org> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd August 21, 2023 +.Dt U2F 4 +.Os +.Sh NAME +.Nm u2f +.Nd FIDO/U2F USB security keys +.Sh SYNOPSIS +.Cd "device u2f" +.Pp +In +.Xr loader.conf 5 : +.Cd u2f_load="YES" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.hid.u2f.debug +.Sh DESCRIPTION +The +.Nm +driver provides support for FIDO/U2F-compatible USB security keys. +They are Human Interface Devices (HID) which can be accessed via the +.Pa /dev/u2f/N +interface. +.Pp +The driver is compatible with the +.Xr read 2 , +.Xr write 2 , +and +.Xr ioctl 2 +operations of the generic +.Xr uhid 4 +device but only accepts the optional HID +.Xr ioctl 2 +calls from u2f group users. +.Sh HARDWARE +The +.Nm +driver supports FIDO/U2F-compatible USB security keys. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va hw.hid.u2f.debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. +.El +.Sh FILES +.Bl -tag -width /dev/u2f/* -compact +.It Pa /dev/u2f/* +.El +.Sh SEE ALSO +.Xr uhid 4 , +.Xr usbhid 4 , +.Xr usb 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Vladimir Kondratyev Aq Mt wulf@FreeBSD.org . +.Pp +This manual page was written by +.An Vladimir Kondratyev Aq Mt wulf@FreeBSD.org +based on the +.Ox +.Xr fido 4 +manual page. diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 index d5efe83286ba..6cee3d82c2ce 100644 --- a/share/man/man4/uchcom.4 +++ b/share/man/man4/uchcom.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uchcom.4,v 1.2 2008/04/30 13:10:54 martin Exp $ .\" .\" Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -27,46 +30,74 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd June 25, 2025 .Dt UCHCOM 4 .Os .Sh NAME .Nm uchcom -.Nd WinChipHead CH341/CH340 serial adapter driver +.Nd WinChipHead CH9102/CH343/CH341/CH340 USB to serial UART driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device uchcom" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -uchcom_load="YES" -.Ed +In +.Xr rc.conf 5 : +.Cd kld_list="uchcom" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uchcom.debug=1 .Sh DESCRIPTION The .Nm -driver provides support for the WinChipHead CH341/CH340 USB-to-RS-232 -Bridge chip. -.Pp +driver provides support for the WinChipHead USB to serial UART adapters. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, add it to the +.Ic kld_list +in +.Xr rc.conf 5 , +or use +.Xr kldload 8 +at runtime. The device is accessed through the .Xr ucom 4 -driver which makes it behave like a +driver, which makes it behave like a .Xr tty 4 . +.Pp +Call out through this interface with applications like +.Xr cu 1 +or +.Xr tip 1 . .Sh HARDWARE The .Nm -driver supports the following adapters: +driver supports the following USB to serial UART controllers: .Pp .Bl -bullet -compact .It -HL USB-RS232 +WinChipHead CH9102 (max 6Mbps) +.It +WinChipHead CH343 (max 6Mbps) +.It +WinChipHead CH341 (max 2Mbps) +.It +WinChipHead CH340 (max 2Mbps) +.El +.Sh SYSCTL VARIABLES +These settings can be entered in the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width "hw.usb.uchcom.debug" +.It Va hw.usb.uchcom.debug +Enable debugging messages, default +.Ql 0 .El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact @@ -83,18 +114,14 @@ for callout ports corresponding callout initial-state and lock-state devices .El .Sh SEE ALSO +.Xr cu 1 , .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 .Sh HISTORY The .Nm -driver first appeared in -.Nx . -The first -.Fx -release to include it was -.Fx 8.0 . -.Sh BUGS -Actually, this chip seems unable to drive other than 8 data bits and -1 stop bit line. +driver appeared in +.Fx 8.0 +from +.Nx 5.0 . diff --git a/share/man/man4/ufshci.4 b/share/man/man4/ufshci.4 new file mode 100644 index 000000000000..d722c9902b98 --- /dev/null +++ b/share/man/man4/ufshci.4 @@ -0,0 +1,181 @@ +.\" +.\" Copyright (c) 2025, Samsung Electronics Co., Ltd. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" ufshci driver man page. +.\" +.\" Author: Jaeyoon Choi <j_yoon.choi@samsung.com> +.\" +.Dd July 17, 2025 +.Dt UFSHCI 4 +.Os +.Sh NAME +.Nm ufshci +.Nd Universal Flash Storage Host Controller Interface driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ufshci" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ufshci_load="YES" +.Ed +.Sh DESCRIPTION +Universal Flash Storage (UFS) is a low-power, high-performance storage +standard composed of a host controller and a single target device. +.Pp +The driver currently provides: +.Bl -bullet +.It +Initialization of the host controller and the target device +.It +Handling of UFS Interconnect (UIC) commands +.It +Support for UTP Transfer Requests (UTR) and UTP Task Management Requests (UTMR) +.It +Support for the SCSI command set +.It +Operation in the legacy single-doorbell queue mode +.It +Support for the PCI Express bus +.El +.Pp +After initialization, the controller is registered with the +.Xr cam 4 +subsystem and its logical unit appears as the device node +.Pa /dev/daX . +.Pp +The driver is under active development; upcoming work includes full +UFS 4.1 feature coverage, additional power-management modes, and +ACPI/FDT-based attach support. +.Sh HARDWARE +The +.Nm +driver supports both host controllers and devices implementing the +Universal Flash Storage Host Controller Interface 4.1 and earlier. +.Sh CONFIGURATION +The +.Nm +driver currently operates with a single doorbell (one I/O-queue), so any +tunables that change the queue count are ignored. +When Multi-Circular Queue (MCQ) support is added and multiple queues +become available, the following queue count tunable values will take effect: +.Pp +To force a single I/O queue pair shared by all CPUs, set the following +tunable value in loader.conf(5): +.Bd -literal -offset indent +hw.ufshci.per_cpu_io_queues=0 +.Ed +.Pp +To assign more than one CPU per I/O queue pair, thereby reducing the +number of MSI-X vectors consumed by the device, set the following tunable +value in loader.conf(5): +.Bd -literal -offset indent +hw.ufshci.min_cpus_per_ioq=X +.Ed +.Pp +To change the I/O command timeout value (in seconds), set the following tunable +value in loader.conf(5): +.Bd -literal -offset indent +hw.ufshci.timeout_period=X +.Ed +.Pp +To change the I/O command retry count, set the following tunable value in +loader.conf(5): +.Bd -literal -offset indent +hw.ufshci.retry_count=X +.Ed +.Pp +To force the driver to use legacy INTx interrupts, set the following tunable +value in loader.conf(5): +.br +(Note: until MCQ support is available the driver always uses legacy INTx, so +this value effectively remains 1) +.Bd -literal -offset indent +hw.ufshci.force_intx=1 +.Ed +.Sh SYSCTL VARIABLES +The following controller-level +.Xr sysctl 8 +nodes are currently implemented: +.Bl -tag -width indent +.It Va dev.ufshci.0.num_failures +(R) Number of command failures for the entire controller. +.It Va dev.ufshci.0.num_retries +(R) Number of command retries for the entire controller. +.It Va dev.ufshci.0.num_intr_handler_calls +(R) Number of times the interrupt handler has been called. +.It Va dev.ufshci.0.num_cmds +(R) Total number of commands issued by the controller. +.It Va dev.ufshci.0.timeout_period +(RW) Configured timeout period (in seconds). +.It Va dev.ufshci.0.cap +(R) Host controller capabilities register value. +.It Va dev.ufshci.0.num_io_queues +(R) Number of I/O-queue pairs. +.It Va dev.ufshci.0.io_queue_mode +(R) Indicates single doorbell mode or multi circular queue mode. +.It Va dev.ufshci.0.minor_version +(R) Host controller minor version. +.It Va dev.ufshci.0.major_version +(R) Host controller major version. +.It Va dev.ufshci.0.utmrq.num_failures +(R) Number of failed UTP task-management requests. +.It Va dev.ufshci.0.utmrq.ioq.num_retries +(R) Number of retried UTP task-management requests. +.It Va dev.ufshci.0.utmrq.num_intr_handler_calls +(R) Number of interrupt handler calls caused by UTP task-management requests. +.It Va dev.ufshci.0.utmrq.num_cmds +(R) Number of UTP task-management requests issued. +.It Va dev.ufshci.0.utmrq.cq_head +(R) Current location of the UTP task-management completion queue head. +.It Va dev.ufshci.0.utmrq.sq_tail +(R) Current location of the UTP task-management submission queue tail. +.It Va dev.ufshci.0.utmrq.sq_head +(R) Current location of the UTP task-management submission queue head. +.It Va dev.ufshci.0.utmrq.num_trackers +(R) Number of trackers in the UTP task-management queue. +.It Va dev.ufshci.0.utmrq.num_entries +(R) Number of entries in the UTP task-management queue. +.It Va dev.ufshci.0.ioq.0.num_failures +(R) Number of failed UTP transfer requests. +.It Va dev.ufshci.0.ioq.0.num_retries +(R) Number of retried UTP transfer requests. +.It Va dev.ufshci.0.ioq.0.num_intr_handler_calls +(R) Number of interrupt-handler calls caused by UTP transfer requests. +.It Va dev.ufshci.0.ioq.0.num_cmds +(R) Number of UTP transfer requests issued. +.It Va dev.ufshci.0.ioq.0.cq_head +(R) Current location of the UTP transfer completion queue head. +.It Va dev.ufshci.0.ioq.0.sq_tail +(R) Current location of the UTP transfer submission queue tail. +.It Va dev.ufshci.0.ioq.0.sq_head +(R) Current location of the UTP transfer submission queue head. +.It Va dev.ufshci.0.ioq.0.num_trackers +(R) Number of trackers in the UTP transfer queue. +.It Va dev.ufshci.0.ioq.0.num_entries +(R) Number of entries in the UTP transfer queue. +.El +.Sh SEE ALSO +.Xr cam 4 , +.Xr pci 4 , +.Xr disk 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Samsung Electronics and originally written by +.An Jaeyoon Choi Aq Mt j_yoon.choi@samsung.com . +.Pp +This manual page was written by +.An Jaeyoon Choi Aq Mt j_yoon.choi@samsung.com . diff --git a/share/man/man4/uftdi.4 b/share/man/man4/uftdi.4 index 9bd3d4a4a293..b526143eaa25 100644 --- a/share/man/man4/uftdi.4 +++ b/share/man/man4/uftdi.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" $NetBSD: uftdi.4,v 1.5 2002/02/07 03:15:08 ross Exp $ .\" .\" Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -27,61 +30,90 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2017 +.Dd June 25, 2025 .Dt UFTDI 4 .Os .Sh NAME .Nm uftdi -.Nd USB support for serial adapters based on the FTDI family of USB -serial adapter chips. +.Nd Future Technology Devices International USB to serial UART driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device usb" .Cd "device ucom" .Cd "device uftdi" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -uftdi_load="YES" -.Ed +In +.Xr rc.conf 5 : +.Cd kld_list="uftdi" +.Pp +In +.Xr sysctl.conf 5 : +.Cd hw.usb.uftdi.debug=1 +.Cd hw.usb.uftdi.skip_jtag_interfaces=0 .Sh DESCRIPTION The .Nm -driver provides support for various serial adapters based on the -following FTDI chips: +driver supports FTDI USB to serial UART devices. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, add it to the +.Ic kld_list +in +.Xr rc.conf 5 , +or use +.Xr kldload 8 +at runtime. +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Pp +Call out through this interface with applications like +.Xr cu 1 +or +.Xr tip 1 . +.Sh HARDWARE +The +.Nm +driver supports the following USB to serial UART controllers: .Pp .Bl -bullet -compact .It -FT8U100AX +FTDI FT4232H .It -FT8U232AM +FTDI FT232R .It -FT8U232BM +FTDI FT230X .It -FT232R +FTDI FT2232H .It -FT2232C +FTDI FT2232D .It -FT2232D +FTDI FT2232C .It -FT2232H +FTDI FT8U232BM .It -FT4232H +FTDI FT8U232AM .It -FT230X +FTDI FT8U100AX .El -.Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Pp +.Sh SYSCTL VARIABLES +These settings can be entered in the +.Xr loader 8 +prompt, set in +.Xr loader.conf 5 , +.Xr sysctl.conf 5 , +or changed at runtime with +.Xr sysctl 8 : +.Bl -tag -width "hw.usb.uftdi.skip_jtag_interfaces" +.It Va hw.usb.uftdi.debug +Enable debugging messages, default +.Ql 0 +.It Va hw.usb.uftdi.skip_jtag_interfaces +Ignore JTAG interfaces, default +.Ql 1 +.El +.Sh IOCTLS Many of the supported chips provide additional functionality such as bitbang mode and the MPSSE engine for serial bus emulation. The @@ -219,27 +251,6 @@ ioctl, you must pass the special value .Dv UFTDI_CONFIRM_ERASE as the argument to this ioctl. .El -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -B&B Electronics USB->RS422/485 adapter -.It -Elexol USB MOD1 and USB MOD3 -.It -HP USB-Serial adapter shipped with some HP laptops -.It -Inland UAS111 -.It -QVS USC-1000 -.It -Buffalo PC-OP-RS / Kurouto-shikou KURO-RS universal remote -.It -Prologix GPIB-USB Controller -.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* @@ -255,14 +266,14 @@ for callout ports corresponding callout initial-state and lock-state devices .El .Sh SEE ALSO +.Xr cu 1 , .Xr tty 4 , .Xr ucom 4 , .Xr usb 4 .Sh HISTORY The .Nm -driver -appeared in +driver appeared in .Fx 4.8 from .Nx 1.5 . diff --git a/share/man/man4/umb.4 b/share/man/man4/umb.4 index 7ecc9a39c1ca..311a50faf8e7 100644 --- a/share/man/man4/umb.4 +++ b/share/man/man4/umb.4 @@ -17,34 +17,34 @@ .\" .\" $NetBSD: umb.4,v 1.4 2019/08/30 09:22:17 wiz Exp $ .\" -.Dd May 11, 2025 +.Dd August 4, 2025 .Dt UMB 4 .Os .Sh NAME .Nm umb .Nd USB Mobile Broadband Interface Model (MBIM) cellular modem driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent +.Cd "device netmap" .Cd "device usb" .Cd "device umb" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +In .Xr loader.conf 5 : -.Bd -literal -offset indent -umb_load="YES" -.Ed -.Pp -If neither of the above is done, the driver will automatically be loaded -by devd(8) when the device is connected. +.Cd umb_load="YES" .Sh DESCRIPTION The .Nm driver provides support for USB MBIM devices. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, +.Cm load +it in +.Xr loader.conf 5 +or at the +.Xr loader 8 +prompt. .Pp MBIM devices establish connections via cellular networks such as GPRS, UMTS, and LTE. diff --git a/share/man/man4/usbhid.4 b/share/man/man4/usbhid.4 index 5109bbe72de6..e5ba370cd025 100644 --- a/share/man/man4/usbhid.4 +++ b/share/man/man4/usbhid.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 12, 2021 +.Dd July 30, 2025 .Dt USBHID 4 .Os .Sh NAME @@ -60,7 +60,7 @@ and make its priority greater than other USB HID drivers, such as .Xr ums 4 , and .Xr uhid 4 . -Default is 0. +Default is 1. .El .Bl -tag -width indent .It Va hw.usb.usbhid.debug diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index ad050bdd0d59..21d69bf9d495 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -1,4 +1,4 @@ -.\"- +.\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2014 Warren Block @@ -26,32 +26,32 @@ .\" SUCH DAMAGE. .\" .Dd July 7, 2024 -.Dt "VT" 4 +.Dt VT 4 .Os .Sh NAME .Nm vt .Nd virtual terminal system video console driver .Sh SYNOPSIS -.Cd "options TERMINAL_KERN_ATTR=_attribute_" -.Cd "options TERMINAL_NORM_ATTR=_attribute_" -.Cd "options VT_MAXWINDOWS=N" +.Cd "options TERMINAL_KERN_ATTR=<attribute>" +.Cd "options TERMINAL_NORM_ATTR=<attribute>" +.Cd "options VT_MAXWINDOWS=<N>" .Cd "options VT_ALT_TO_ESC_HACK=1" .Cd "options VT_TWOBUTTON_MOUSE" -.Cd "options VT_FB_MAX_WIDTH=X" -.Cd "options VT_FB_MAX_HEIGHT=Y" +.Cd "options VT_FB_MAX_WIDTH=<X>" +.Cd "options VT_FB_MAX_HEIGHT=<Y>" .Cd "options SC_NO_CUTPASTE" .Cd "device vt" .Pp In .Xr loader.conf 5 : -.Cd hw.vga.textmode=1 -.Cd hw.vga.acpi_ignore_no_vga=1 -.Cd kern.vty=vt -.Cd kern.vt.color.<colornum>.rgb="<colorspec>" -.Cd kern.vt.fb.default_mode="<X>x<Y>" -.Cd kern.vt.fb.modes.<connector>="<X>x<Y>" -.Cd kern.vt.slow_down=<delay>" -.Cd screen.font="<X>x<Y>" +.Cd "hw.vga.textmode=1" +.Cd "hw.vga.acpi_ignore_no_vga=1" +.Cd "kern.vty=vt" +.Cd "kern.vt.color.<colornum>.rgb=<colorspec>" +.Cd "kern.vt.fb.default_mode=<X>x<Y>" +.Cd "kern.vt.fb.modes.<connector>=<X>x<Y>" +.Cd "kern.vt.slow_down=<delay>" +.Cd "screen.font=<X>x<Y>" .Pp In .Xr loader.conf 5 or @@ -130,8 +130,8 @@ These kernel options control the .Nm driver. .Bl -tag -width MAXCONS -.It Dv TERMINAL_NORM_ATTR= Ns Pa attribute -.It Dv TERMINAL_KERN_ATTR= Ns Pa attribute +.It Dv TERMINAL_NORM_ATTR=<attribute> +.It Dv TERMINAL_KERN_ATTR=<attribute> These options change the default colors used for normal and kernel text. Available colors are defined in @@ -139,7 +139,7 @@ Available colors are defined in See .Sx EXAMPLES below. -.It Dv VT_MAXWINDOWS=N +.It Dv VT_MAXWINDOWS=<N> Set the number of virtual terminals to be created to .Fa N . The value defaults to 12. @@ -152,10 +152,10 @@ In effect, this makes the right-hand mouse button perform a paste. These options are checked in the order shown. .It Dv SC_NO_CUTPASTE Disable mouse support. -.It VT_FB_MAX_WIDTH=X +.It VT_FB_MAX_WIDTH=<X> Set the maximum width to .Fa X . -.It VT_FB_MAX_HEIGHT=Y +.It VT_FB_MAX_HEIGHT=<Y> Set the maximum height to .Fa Y . .El @@ -166,7 +166,7 @@ console device, These options will be removed in a future .Fx version. -.Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE" +.Bl -column -offset indent "TERMINAL_KERN_ATTR" "SC_KERNEL_CONS_ATTR" .It Sy vt Option Name Ta Sy sc Option Name .It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR .It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR @@ -230,7 +230,7 @@ Note that is not compatible with .Xr UEFI 8 boot. -.It Va kern.vt.color. Ns Ar colornum Ns Va .rgb +.It Va kern.vt.color. Ns Ar colornum Ns . Ns Va rgb Set this value to override default palette entry for color .Pa colornum which should be in a range from 0 to 15 inclusive. @@ -245,15 +245,15 @@ Note: The .Nm VGA hardware driver does not support palette configuration. .It Va kern.vt.fb.default_mode -Set this value to a graphic mode to override the default mode picked by the +Set this value to a graphic mode to override the default picked by the .Nm backend. The mode is applied to all output connectors. This is currently only supported by the .Cm vt_fb backend when it is paired with a KMS video driver. -.It Va kern.vt.fb.modes. Ns Pa connector_name -Set this value to a graphic mode to override the default mode picked by the +.It Va kern.vt.fb.modes.<connector_name> +Set this value to a graphic mode to override the default picked by the .Nm backend. This mode is applied to the output connector diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 270366488a98..b6f10ddd87cb 100644 --- a/share/man/man4/vtnet.4 +++ b/share/man/man4/vtnet.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 22, 2012 +.Dd August 21, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -68,15 +68,29 @@ prompt before booting the kernel or stored in .Bl -tag -width "xxxxxx" .It Va hw.vtnet.csum_disable .It Va hw.vtnet. Ns Ar X Ns Va .csum_disable -This tunable disables receive and send checksum offload. +This tunable disables receive and transmit checksum offloading for TCP and +UDP. +This also implies that TCP segmentation offloading and large receive offload +are disabled. +The default value is 0. +.It Va hw.vtnet.fixup_needs_csum +.It Va hw.vtnet. Ns Ar X Ns Va .fixup_needs_csum +This tunable enforces the calculation of a valid TCP or UDP checksum for +packets received with +.Dv VIRTIO_NET_HDR_F_NEEDS_CSUM +being set in the +.Va flags +field of the structure +.Vt struct virtio_net_hdr . +It also marks the checksum as being correct in the mbuf packet header. The default value is 0. .It Va hw.vtnet.tso_disable .It Va hw.vtnet. Ns Ar X Ns Va .tso_disable -This tunable disables TSO. +This tunable disables TCP segmentation offloading. The default value is 0. .It Va hw.vtnet.lro_disable .It Va hw.vtnet. Ns Ar X Ns Va .lro_disable -This tunable disables LRO. +This tunable disables large receive offload. The default value is 0. .It Va hw.vtnet.mq_disable .It Va hw.vtnet. Ns Ar X Ns Va .mq_disable @@ -91,11 +105,148 @@ The number of queue pairs used is the lesser of the maximum supported by the driver and the hypervisor, the number of CPUs present in the guest, and this tunable if not zero. The default value is 0. +.It Va hw.vtnet.tso_maxlen +.It Va hw.vtnet. Ns Ar X Ns Va .tso_maxlen +This tunable sets the TSO burst limit. +The default value is 65535. +.It Va hw.vtnet.rx_process_limit +.It Va hw.vtnet. Ns Ar X Ns Va .rx_process_limit +This tunable sets the number of RX segments processed in one pass. +The default value is 1024. +.It Va hw.vtnet.lro_entry_count +.It Va hw.vtnet. Ns Ar X Ns Va .lro_entry_count +This tunable sets the software LRO entry count. +The default value is 128, the minimum value is 8. +.It Va hw.vtnet.lro_mbufq_depth +.It Va hw.vtnet. Ns Ar X Ns Va .lro_mbufq_depth +This tunable sets the depth of the software LRO mbuf queue. +The default value is 0. .It Va hw.vtnet.altq_disable This tunable disables ALTQ support, allowing the use of multiqueue instead. This option applies to all interfaces. The default value is 0. .El +.Sh TRANSMIT QUEUE STATISTICS +.Bl -tag -width "xxxxxx" +For each transmit queue of each interface the following read-only statistics +are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .rescheduled +The number of times the transmit interrupt handler was rescheduled. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .tso +The number of times TCP segment offloading was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .csum +The number of times transmit checksum offloading for UDP or TCP was +performed. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .omcasts +The number of multicast packets that were transmitted. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .obytes +The number of bytes that were transmitted (based on Ethernet frames). +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .opackets +The number of packets that were transmitted (Ethernet frames). +.El +.Sh RECEIVE QUEUE STATISTICS +For each receive queue of each interface the following read-only statistics +are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .rescheduled +The number of times the receive interrupt handler was rescheduled. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .host_lro +The number of times TCP large receive offload was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum_failed +Currently not used. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum +The number of times receive checksum offloading for UDP or TCP was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ierrors +The number of times an error occurred during input processing. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .iqdrops +The number of times a packet was dropped during input processing. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ibytes +The number of bytes that were received (based on Ethernet frames). +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ipackets +The number of packets that were received (Ethernet frames). +.El +.Sh INTERFACE TRANSMIT STATISTICS +For each interface the following read-only transmit statistics are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .tx_task_rescheduled +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .rescheduled +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .tso +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .csum +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_defrag_failed +The number of times an attempt to defragment an mbuf chain failed during a +transmit operation. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_defragged +The number of times an mbuf chain was defragmented during a transmit operation. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_without_csum +The number of times TCP segment offloading was attempted without transmit +checksum offloading. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_not_tcp +The number of times TCP segment offloading was attempted for a non-TCP packet. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_proto_mismatch +The number of times the IP protocol version of the transmit checksum +offloading request did not match the IP protocol version of the packet. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_unknown_ethtype +The number of times a transmit offload operation was requested for an +ethernet frame for which the EtherType was neither IPv4 nor IPv6 +(considering simple VLAN tagging). +.El +.Sh INTERFACE RECEIVE STATISTICS +For each interface the following read-only receive statistics are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .rx_task_rescheduled +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .rescheduled +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_failed +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum_failed +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_proto +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_offset +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_ipproto +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_ethtype +The number of times fixing the checksum required by +.Va hw.vtnet.fixup_needs_csum +or +.Va hw.vtnet. Ns Ar X Ns Va .fixup_needs_csum +was attempted for a packet with an EtherType other than IPv4 or IPv6. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_mergeable_failed +The number of times receiving a mergable buffer failed. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_enq_replacement_failed +The number of times the enqueuing the replacement receive mbuf chain failed. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_frame_too_large +The number of times the frame was loger than the mbuf chain during large +receive offload without mergeable buffers. +.It Va dev.vtnet. Ns Ar X Ns Va .mbuf_alloc_failed +The number of times an mbuf cluster allocation for the receive buffer failed. +.El +.Sh INTERFACE CONFIGURATION PARAMETER +For each interface the following read-only configuration parameters are +provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .act_vq_pairs +The number of active virtqueue pairs. +.It Va dev.vtnet. Ns Ar X Ns Va .req_vq_pairs +The number of requested virtqueue pairs. +.It Va dev.vtnet. Ns Ar X Ns Va .max_vq_pairs +The maximum number of supported virtqueue pairs. +.El .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 4cd1bfbdc9d5..ff983c66c1cb 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2023 +.Dd June 13, 2025 .Dt WLAN 4 .Os .Sh NAME @@ -44,7 +44,7 @@ module is required by all native 802.11 drivers. .Nm supports multi-mode devices capable of operating in both 2.4GHz and 5GHz bands and supports numerous -802.11 standards: 802.11a, 802.11b, 802.11g, 802.11n, and 802.11s (Draft 3.0). +802.11 standards: 802.11a, 802.11b, 802.11g, 802.11n, 802.11ac, and 802.11s (Draft 3.0). The WPA, 802.11i, and 802.1x security protocols are supported through a combination of in-kernel code and user-mode applications. The WME/WMM multi-media protocols are supported entirely within @@ -174,6 +174,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr iwlwifi 4 , .Xr iwm 4 , .Xr iwn 4 , +.Xr iwx 4 , .Xr malo 4 , .Xr mwl 4 , .Xr netintro 4 , @@ -181,6 +182,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr ral 4 , .Xr rsu 4 , .Xr rtw88 4 , +.Xr rtw89 4 , .Xr rtwn 4 , .Xr rum 4 , .Xr run 4 , @@ -190,6 +192,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr urtw 4 , .Xr wlan_acl 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , .Xr wlan_xauth 4 , diff --git a/share/man/man4/wlan_ccmp.4 b/share/man/man4/wlan_ccmp.4 index f0efa86d2fdb..ffd4da8694e9 100644 --- a/share/man/man4/wlan_ccmp.4 +++ b/share/man/man4/wlan_ccmp.4 @@ -53,6 +53,7 @@ calculations in hardware, the module will do the work. .Sh SEE ALSO .Xr wlan 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 .Sh STANDARDS diff --git a/share/man/man9/vm_map_simplify_entry.9 b/share/man/man4/wlan_gcmp.4 index 0e99596d067e..a7657a9ad91b 100644 --- a/share/man/man9/vm_map_simplify_entry.9 +++ b/share/man/man4/wlan_gcmp.4 @@ -1,6 +1,10 @@ .\" -.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org> +.\" Copyright (c) 2004 Sam Leffler .\" All rights reserved. +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Bj\xc3\xb6rn Zeeb +.\" under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,37 +27,46 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 19, 2003 -.Dt VM_MAP_SIMPLIFY_ENTRY 9 +.\" Based on wlan_ccmp.4. +.\" +.Dd June 13, 2025 +.Dt WLAN_GCMP 4 .Os .Sh NAME -.Nm vm_map_simplify_entry -.Nd simplify a -.Vt vm_map_entry +.Nm wlan_gcmp +.Nd AES-GCMP crypto support for 802.11 devices .Sh SYNOPSIS -.In sys/param.h -.In vm/vm.h -.In vm/vm_map.h -.Ft void -.Fn vm_map_simplify_entry "vm_map_t map" "vm_map_entry_t entry" +.Cd "device wlan_gcmp" .Sh DESCRIPTION The -.Fn vm_map_simplify_entry -function simplifies the given -.Fa entry -by merging with either neighbour. +.Nm +module handles the +.Em Galois/Counter Mode Protocol +cryptographic requirements of the IEEE 802.11ad and WPA2/WPA3 protocols. +It does encapsulation and decapsulation of GCMP-encoded 802.11 frames +and optionally calculates the AES-GCMP cipher. The -.Fa map -must be locked upon entry. -.Pp -This function also has the ability to merge with both neighbours. -.Pp -This function guarantees that the passed entry remains valid, although -possibly extended. +.Nm +module is an 802.11 cryptographic plugin module for use by the +.Xr wlan 4 +module. +This module is automatically loaded if an AES-GCMP key is configured; +typically by a WPA supplicant program such as wpa_supplicant, +or a WPA authenticator program such as +.Nm hostapd . +Should the underlying network device not be capable of doing the AES-GCMP +calculations in hardware, the +.Nm +module will do the work. .Sh SEE ALSO -.Xr vm_map 9 , -.Xr vm_map_insert 9 , -.Xr vm_map_remove 9 -.Sh AUTHORS -This manual page was written by -.An Bruce M Simpson Aq Mt bms@spc.org . +.Xr wlan 4 , +.Xr wlan_ccmp 4 , +.Xr wlan_tkip 4 , +.Xr wlan_wep 4 +.Sh STANDARDS +More information can be found in the IEEE 802.11, and WPA Standards. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 15.0 . diff --git a/share/man/man4/wlan_tkip.4 b/share/man/man4/wlan_tkip.4 index 2e812ceffe9a..e74c24d45614 100644 --- a/share/man/man4/wlan_tkip.4 +++ b/share/man/man4/wlan_tkip.4 @@ -54,6 +54,7 @@ module will do the work. .Sh SEE ALSO .Xr wlan 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_wep 4 .Sh STANDARDS More information can be found in the IEEE 802.11, WPA, and 802.11i Standards. diff --git a/share/man/man4/wlan_wep.4 b/share/man/man4/wlan_wep.4 index 4e5887bbc35e..d83ef23e7a4e 100644 --- a/share/man/man4/wlan_wep.4 +++ b/share/man/man4/wlan_wep.4 @@ -51,6 +51,7 @@ module will do the work. .Sh SEE ALSO .Xr wlan 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 .Sh STANDARDS More information can be found in the IEEE 802.11 Standard. diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index b08449f9e71f..50ada937e104 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -55,51 +55,58 @@ A single-finger press generates a left button click. A two-finger press maps to the right button; whereas a three-finger press gets treated as a middle button click. .Pp -The trackpad functions with presses and taps. A press is a full-forced -press which causes a physical lowering of the trackpad. A tap is a +The trackpad functions with presses and taps. +A press is a full-forced +press which causes a physical lowering of the trackpad. +A tap is a touch of the trackpad which does not depress the physical trackpad. .Pp The .Nm -driver supports receiving evdev input device data if enabled. This data +driver supports receiving evdev input device data if enabled. +This data is used for extended usage of the touchpad like multi-finger support, -pressure detection, tap support, and gestures. At least the second bit -of the +pressure detection, tap support, and gestures. +At least the second bit of the .Xr sysctl 8 tunable .Va kern.evdev.rcpt_mask -must be set. This can be enabled with +must be set. +This can be enabled with .Va kern.evdev.rcpt_mask=3 . .Pp Vertical scrolling (z-axis) is enabled by default with a two-finger tap and the movement of a finger up and down. Horizontal scrolling (t-axis) is not natively supported by the sysmouse -protocol, therefore must be enabled with evdev data. This can be enabled -with the +protocol, therefore must be enabled with evdev data. +This can be enabled with the .Xr sysctl 8 tunable -.Va kern.evdev.sysmouse_t_axis=3. +.Va kern.evdev.sysmouse_t_axis=3 . Horizontal scrolling can be used with a two-finger tap and the movement -of a finger from side to side. The +of a finger from side to side. +The .Xr sysctl 8 tunable .Va hw.usb.wsp.t_factor must be greater than 0 for horizontal scrolling to be enabled, too. .Pp Horizontal swiping with a three-finger tap is registered as mouse buttons -8 and 9, depending on the direction. These buttons default to backwards -and forwards keyboard events. +8 and 9, depending on the direction. +These buttons default to backwards and forwards keyboard events. .Sh SYSCTL VARIABLES The following variables are available as .Xr sysctl 8 tunables: .Bl -tag -width indent .It Va hw.usb.wsp.scale_factor -Controls the pointer sensitivity. Default is 12. +Controls the pointer sensitivity. +Default is 12. .El .Bl -tag -width indent .It Va hw.usb.wsp.enable_single_tap_clicks -Enables single-tap to register as a left-click. Default is 1 (enabled). +Enables single-tap to register as a left-click. +Default is 1 (enabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.enable_single_tap_movement @@ -114,45 +121,55 @@ finger (a lower value is used for palm detection). Default is 1900. .Bl -tag -width indent .It Va max_scroll_finger_distance Specifies the maximum distance between two fingers where z-axis -and t-axis movements are registered. Z-axis and T-axis movements +and t-axis movements are registered. +Z-axis and T-axis movements are vertical and horizontal movements with more than one finger -tapped (not clicked), respectively. Default is 8192. +tapped (not clicked), respectively. +Default is 8192. .El .Bl -tag -width indent .It Va hw.usb.wsp.max_double_tap_distance Specifies the maximum distance between two fingers that a two-finger -click will be registered as a right-click. Default is 2500. +click will be registered as a right-click. +Default is 2500. .El .Bl -tag -width indent .It Va hw.usb.wsp.scr_threshold Specifies the minimum horizontal or vertical distance required to -register as a scrolling gesture. Default is 20. +register as a scrolling gesture. +Default is 20. .El .Bl -tag -width indent .It Va hw.usb.wsp.z_factor -Z-axis sensitivity. Default is 5. +Z-axis sensitivity. +Default is 5. .El .Bl -tag -width indent .It Va hw.usb.wsp.z_invert -Z-axis inversion. Default is 0 (disabled). +Z-axis inversion. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.t_factor -T-axis sensitivity. Default is 0 (disabled). +T-axis sensitivity. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.t_invert -T-axis inversion. Default is 0 (disabled). +T-axis inversion. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.scroll_finger_count Specifies the number of tapped fingers which registers as a scrolling -movement. Default is 2. +movement. +Default is 2. .El .Bl -tag -width indent .It Va hw.usb.wsp.horizontal_swipe_finger_count Speifies the number of tapped fingers which registers as a swipe -gesture. Default is 3. +gesture. +Default is 3. .El .Bl -tag -width indent .It Va hw.usb.wsp.pressure_touch_threshold @@ -173,7 +190,9 @@ Default is 120. .It Va hw.usb.wsp.debug Specifies the .Nm -driver debugging level (0-3). Default is 1. +driver debugging level (0-3). +Default is 1. +.El .Sh FILES .Nm creates a blocking pseudo-device file, @@ -184,8 +203,7 @@ or .Em mousesystems type device--see .Xr moused 8 -for an explanation of these mouse -types. +for an explanation of these mouse types. .Sh SEE ALSO .Xr sysmouse 4 , .Xr usb 4 , diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index e2abf1d60905..0f6559b236c6 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -1,14 +1,11 @@ .include <src.opts.mk> +MANGROUPS= MAN + #MISSING: dump.5 plot.5 -MAN= acct.5 \ - ar.5 \ - a.out.5 \ +MAN= a.out.5 \ ${_boot.config.5} \ core.5 \ - devfs.conf.5 \ - devfs.rules.5 \ - device.hints.5 \ dir.5 \ disktab.5 \ elf.5 \ @@ -16,32 +13,24 @@ MAN= acct.5 \ eui64.5 \ fbtab.5 \ forward.5 \ - fs.5 \ - fstab.5 \ group.5 \ hosts.5 \ hosts.equiv.5 \ - hosts.lpd.5 \ intro.5 \ libmap.conf.5 \ link.5 \ mailer.conf.5 \ make.conf.5 \ - moduli.5 \ motd.5 \ mount.conf.5 \ networks.5 \ - nsmb.conf.5 \ nsswitch.conf.5 \ os-release.5 \ - passwd.5 \ pbm.5 \ - periodic.conf.5 \ phones.5 \ portindex.5 \ protocols.5 \ quota.user.5 \ - rc.conf.5 \ rctl.conf.5 \ regdomain.5 \ remote.5 \ @@ -54,18 +43,6 @@ MAN= acct.5 \ style.mdoc.5 \ sysctl.conf.5 \ -MLINKS= dir.5 dirent.5 -MLINKS+=fs.5 inode.5 -MLINKS+=hosts.equiv.5 rhosts.5 -MLINKS+=passwd.5 master.passwd.5 -MLINKS+=passwd.5 pwd.db.5 -MLINKS+=passwd.5 spwd.db.5 -MLINKS+=portindex.5 INDEX.5 -MLINKS+=quota.user.5 quota.group.5 -MLINKS+=rc.conf.5 rc.conf.local.5 -MLINKS+=resolver.5 resolv.conf.5 -MLINKS+=src.conf.5 src-env.conf.5 - .if ${MK_BLUETOOTH} != "no" MAN+= bluetooth.device.conf.5 \ bluetooth.hosts.5 \ @@ -80,11 +57,68 @@ MAN+= freebsd-update.conf.5 MAN+= hesiod.conf.5 .endif +MLINKS= dir.5 dirent.5 +MLINKS+=fs.5 inode.5 +MLINKS+=hosts.equiv.5 rhosts.5 +MLINKS+=portindex.5 INDEX.5 +MLINKS+=quota.user.5 quota.group.5 +MLINKS+=resolver.5 resolv.conf.5 +MLINKS+=src.conf.5 src-env.conf.5 + +MANGROUPS+= ACCT +ACCT= acct.5 +ACCTPACKAGE= acct + +MANGROUPS+= BOOTLOADER +BOOTLOADER= device.hints.5 +BOOTLOADERPACKAGE=bootloader + +MANGROUPS+= CLANG +CLANG= ar.5 +CLANGPACKAGE= clang + +MANGROUPS+= LP +LP= hosts.lpd.5 +LPPACKAGE= lp + +MANGROUPS+= PERIODIC +PERIODIC= periodic.conf.5 +PERIODICPACKAGE=periodic + .if ${MK_PF} != "no" -MAN+= pf.conf.5 \ - pf.os.5 +MANGROUPS+= PF +PF= pf.conf.5 \ + pf.os.5 +PFPACKAGE= pf .endif +MANGROUPS+= RC +RC= rc.conf.5 +RCLINKS= rc.conf.5 rc.conf.local.5 +RCPACKAGE= rc + +MANGROUPS+= RUNTIME +RUNTIME= devfs.conf.5 \ + devfs.rules.5 \ + fstab.5 \ + passwd.5 +RUNTIMELINKS= passwd.5 master.passwd.5 +RUNTIMELINKS+= passwd.5 pwd.db.5 +RUNTIMELINKS+= passwd.5 spwd.db.5 +RUNTIMEPACKAGE= runtime + +MANGROUPS+= SMB +SMB= nsmb.conf.5 +SMBPACKAGE= smbutils + +MANGROUPS+= SSH +SSH= moduli.5 +SSHPACKAGE= ssh + +MANGROUPS+= UFS +UFS= fs.5 +UFSPACKAGE= ufs + # This makes more sense for amd64 and i386 but # we decide to install all manpages in all architectures _boot.config.5= boot.config.5 diff --git a/share/man/man5/core.5 b/share/man/man5/core.5 index 8efc8c970014..628fdb7920bb 100644 --- a/share/man/man5/core.5 +++ b/share/man/man5/core.5 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 12, 2023 +.Dd July 17, 2025 .Dt CORE 5 .Os .Sh NAME @@ -48,26 +48,6 @@ a system crash. (In this event, the decision to save the core file is arbitrary, see .Xr savecore 8 . ) .Pp -The maximum size of a core file is limited by the -.Dv RLIMIT_CORE -.Xr setrlimit 2 -limit. -Files which would be larger than the limit are not created. -.Pp -With a large limit, a process that had mapped a very large, -and perhaps sparsely populated, virtual memory region, could take -a very long time to create core dumps. -The system ignores all signals sent to a process writing a core file, except -.Dv SIGKILL -which terminates the writing and causes immediate exit of the process. -The behavior of -.Dv SIGKILL -can be disabled by setting tunable -.Xr sysctl 8 -variable -.Va kern.core_dump_can_intr -to zero. -.Pp The name of the file is controlled via the .Xr sysctl 8 variable @@ -107,6 +87,26 @@ yielding the traditional .Fx behaviour. .Pp +The maximum size of a core file is limited by the +.Dv RLIMIT_CORE +.Xr setrlimit 2 +limit. +Files which would be larger than the limit are not created. +.Pp +With a large limit, a process that had mapped a very large, +and perhaps sparsely populated, virtual memory region, could take +a very long time to create core dumps. +The system ignores all signals sent to a process writing a core file, except +.Dv SIGKILL +which terminates the writing and causes immediate exit of the process. +The behavior of +.Dv SIGKILL +can be disabled by setting tunable +.Xr sysctl 8 +variable +.Va kern.core_dump_can_intr +to zero. +.Pp By default, a process that changes user or group credentials whether real or effective will not create a corefile. This behaviour can be @@ -116,11 +116,13 @@ variable .Va kern.sugid_coredump to 1. .Pp -Corefiles can be compressed by the kernel if the following item -is included in the kernel configuration file: +Corefiles can be compressed by the kernel if one of the following items +are included in the kernel configuration file: .Bl -tag -width "1234567890" -compact -offset "12345" .It options GZIO +.It options +ZSTDIO .El .Pp The following sysctl control core file compression: diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index a9fd9e8b29e1..a9ae823257a4 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 29, 2025 +.Dd July 30, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -100,6 +100,8 @@ Macro names may not be reserved words (for example .Ar in , .Ar out ) . Macros are not expanded inside quotes. +Ranges of network addresses used in macros that will be expanded in lists +later on must be quoted with additional simple quotes. .Pp For example, .Bd -literal -offset indent @@ -107,6 +109,11 @@ ext_if = \&"kue0\&" all_ifs = \&"{\&" $ext_if lo0 \&"}\&" pass out on $ext_if from any to any pass in on $ext_if proto tcp from any to any port 25 + +usr_lan_range = "'192.0.2.0/24'" +srv_lan_range = "'198.51.100.0 - 198.51.100.255'" +nat_ranges = \&"{\&" $usr_lan_range $srv_lan_range \&"}\&" +nat on $ext_if from $nat_ranges to any -> ($ext_if) .Ed .Sh TABLES Tables are named structures which can hold a collection of addresses and @@ -354,11 +361,11 @@ For example: .Bd -literal -offset indent set timeout tcp.first 120 set timeout tcp.established 86400 -set timeout { adaptive.start 6000, adaptive.end 12000 } -set limit states 10000 +set timeout { adaptive.start 60000, adaptive.end 120000 } +set limit states 100000 .Ed .Pp -With 9000 state table entries, the timeout values are scaled to 50% +With 90000 state table entries, the timeout values are scaled to 50% (tcp.first 60, tcp.established 43200). .It Ar set loginterface Enable collection of packet and byte count statistics for the given @@ -385,50 +392,37 @@ See .Xr zone 9 for an explanation of memory pools. .Pp -For example, -.Bd -literal -offset indent -set limit states 20000 -.Ed -.Pp -sets the maximum number of entries in the memory pool used by state table -entries (generated by +Limits can be set on the following: +.Bl -tag -width pktdelay_pkts +.It Cm states +Set the maximum number of entries in the memory pool used by state table +entries (those generated by .Ar pass rules which do not specify -.Ar no state ) -to 20000. -Using -.Bd -literal -offset indent -set limit frags 20000 -.Ed -.Pp -sets the maximum number of entries in the memory pool used for fragment -reassembly (generated by the -.Ar set reassemble -option or -.Ar scrub -rules) to 20000. -Using -.Bd -literal -offset indent -set limit src-nodes 2000 -.Ed -.Pp -sets the maximum number of entries in the memory pool used for tracking +.Cm no state ) . +The default is 100000. +.It Cm src-nodes +Set the maximum number of entries in the memory pool used for tracking source IP addresses (generated by the .Ar sticky-address and .Ar src.track -options) to 2000. -Using -.Bd -literal -offset indent -set limit table-entries 100000 -.Ed -.Pp -sets the limit on the overall number of addresses that can be stored -in tables to 100000. +options). +The default is 10000. +.It Cm table-entries +Set the number of addresses that can be stored in tables. +The default is 200000. +.It Cm anchors +Set the number of anchors that can exist. +The default is 512. +.It Cm eth-anchors +Set the number of anchors that can exist. +The default is 512. +.El .Pp -Various limits can be combined on a single line: +Multiple limits can be combined on a single line: .Bd -literal -offset indent -set limit { states 20000, frags 20000, src-nodes 2000 } +set limit { states 20000, frags 2000, src-nodes 2000 } .Ed .It Ar set ruleset-optimization .Bl -tag -width xxxxxxxx -compact @@ -535,6 +529,9 @@ an ICMP UNREACHABLE is returned for blocked UDP packets, and all other packets are silently dropped. .El .Pp +The default value is +.Cm drop . +.Pp For example: .Bd -literal -offset indent set block-policy return @@ -659,6 +656,8 @@ but can be overridden via this option. Setting this option may leave a small period of time where the fingerprints referenced by the currently active ruleset are inconsistent until the new ruleset finishes loading. +The default location for fingerprints is +.Pa /etc/pf.os . .Pp For example: .Pp @@ -719,7 +718,7 @@ Unlike for layer 3 traffic the packet is always silently dropped. The packet is passed; no state is created for layer 2 traffic. .El -.Sh PARAMETERS +.Ss Parameters applicable to layer 2 rules The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. @@ -843,7 +842,15 @@ modifier to ensure unique IP identifiers. .It Ar min-ttl Aq Ar number Enforces a minimum TTL for matching IP packets. .It Ar max-mss Aq Ar number -Enforces a maximum MSS for matching TCP packets. +Reduces the maximum segment size (MSS) +on TCP SYN packets to be no greater than +.Ar number . +This is sometimes required in scenarios where the two endpoints +of a TCP connection are not able to carry similar sized packets +and the resulting mismatch can lead to packet fragmentation or loss. +Note that setting the MSS this way can have undesirable effects, +such as interfering with the OS detection features of +.Xr pf 4 . .It Xo Ar set-tos Aq Ar string .No \*(Ba Aq Ar number .Xc @@ -1375,7 +1382,7 @@ part of the new destination address according to the specified subnet. It is possible to embed a complete IPv4 address into an IPv6 address using a network prefix of /96 or smaller. .Pp -When a destination address is not specified it is assumed that the host +When a destination address is not specified, it is assumed that the host part is 32-bit long. For IPv6 to IPv4 translation this would mean using only the lower 32 bits of the original IPv6 destination address. @@ -1472,11 +1479,7 @@ A .Ar rdr-to opion may cause the source port to be modified if doing so avoids a conflict with an existing connection. -A random source port in the range 50001-65535 is chosen in this case; to -avoid excessive CPU consumption, the number of searches for a free port is -limited by the -.Va net.pf.rdqr_srcport_rewrite_tries -sysctl. +A random source port in the range 50001-65535 is chosen in this case. Port numbers are never translated with a .Ar binat-to option. @@ -1743,7 +1746,7 @@ handles state tracking. See .Sx STATEFUL TRACKING OPTIONS below for further details. -.Sh PARAMETERS +.Ss Parameters The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. @@ -2039,6 +2042,21 @@ connections: block out proto { tcp, udp } all pass out proto { tcp, udp } all user { < 1000, dhartmei } .Ed +.Pp +The example below permits users with uid between 1000 and 1500 +to open connections: +.Bd -literal -offset indent +block out proto tcp all +pass out proto tcp from self user { 999 >< 1501 } +.Ed +.Pp +The +.Sq \&: +operator, which works for port number matching, does not work for +.Cm user +and +.Cm group +match. .It Xo Ar flags Aq Ar a .Pf / Ns Aq Ar b .No \*(Ba / Ns Aq Ar b @@ -2099,10 +2117,10 @@ options, or scrubbed with will also not be recoverable from intermediate packets. Such connections will stall and time out. .It Xo Ar icmp-type Aq Ar type -.Ar code Aq Ar code +.Ar Op code Aq Ar code .Xc .It Xo Ar icmp6-type Aq Ar type -.Ar code Aq Ar code +.Ar Op code Aq Ar code .Xc This rule only applies to ICMP or ICMPv6 packets with the specified type and code. @@ -2209,6 +2227,24 @@ directive occurs only at configuration file parse time, not during runtime. .It Ar ridentifier Aq Ar number Add an identifier (number) to the rule, which can be used to correlate the rule to pflog entries, even after ruleset updates. +.It Cm max-pkt-rate Ar number Ns / Ns Ar seconds +Measure the rate of packets matching the rule and states created by it. +When the specified rate is exceeded, the rule stops matching. +Only packets in the direction in which the state was created are considered, +so that typically requests are counted and replies are not. +For example, +to pass up to 100 ICMP packets per 10 seconds: +.Bd -literal -offset indent +block in proto icmp +pass in proto icmp max-pkt-rate 100/10 +.Ed +.Pp +When the rate is exceeded, all ICMP is blocked until the rate falls below +100 per 10 seconds again. +.Pp +.It Ar max-pkt-size Aq Ar number +Limit each packet to be no more than the specified number of bytes. +This includes the IP header, but not any layer 2 header. .It Xo Ar queue Aq Ar queue .No \*(Ba ( Aq Ar queue , .Aq Ar queue ) @@ -2533,6 +2569,7 @@ will not work if .Xr pf 4 operates on a .Xr bridge 4 . +Also they act on incoming SYN packets only. .Pp Example: .Bd -literal -offset indent @@ -2742,8 +2779,8 @@ This means that it will not work on other protocols and will not match a currently established connection. .Pp Caveat: operating system fingerprints are occasionally wrong. -There are three problems: an attacker can trivially craft his packets to -appear as any operating system he chooses; +There are three problems: an attacker can trivially craft packets to +appear as any operating system; an operating system patch could change the stack behavior and no fingerprints will match it until the database is updated; and multiple operating systems may have the same fingerprint. @@ -3070,7 +3107,7 @@ rule can also contain a filter ruleset in a brace-delimited block. In that case, no separate loading of rules into the anchor is required. Brace delimited blocks may contain rules or other brace-delimited blocks. -When an anchor is populated this way the anchor name becomes optional. +When an anchor is populated this way, the anchor name becomes optional. .Bd -literal -offset indent anchor "external" on $ext_if { block @@ -3381,7 +3418,9 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "max-mss" number | "random-id" | "reassemble tcp" | fragmentation | "allow-opts" | "label" string | "tag" string | [ "!" ] "tagged" string | + "max-pkt-rate" number "/" seconds | "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | + "max-pkt-size" number | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | "rtable" number | "probability" number"%" | "prio" number | "dnpipe" ( number | "(" number "," number ")" ) | diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 2fd63e4f743d..de2181d638d1 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2025 +.Dd July 15, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -1164,8 +1164,8 @@ and is not found. Multiple rules can be set as follows: .Bd -literal -pf_fallback_rules="\\ - block drop log all\\ +pf_fallback_rules=" + block drop log all pass in quick on em0" .Pp .Ed diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index d52f0a170203..2895c0cf4746 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd May 26, 2025 +.Dd August 20, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -299,11 +299,18 @@ Use for the build. No configuration is required except to install the .Sy devel/ccache +or +.Sy devel/sccache package. When using with .Xr distcc 1 , set .Sy CCACHE_PREFIX=/usr/local/bin/distcc . +When using with sccache +set +.Sy CCACHE_NAME=sccache +in +.Xr src.conf 5 . The default cache directory of .Pa $HOME/.ccache will be used, which can be overridden by setting @@ -406,6 +413,9 @@ Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .It Va WITH_CLEAN Clean before building world and/or kernel. +Note that recording a new epoch in +.Pa .clean_build_epoch +in the root of the source tree will also force a clean world build. .It Va WITHOUT_CPP Do not build .Xr cpp 1 . @@ -442,14 +452,14 @@ When set, it enforces these options: .It .Va WITHOUT_KERBEROS .It -.Va WITHOUT_KERBEROS_SUPPORT -.It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_LOADER_ZFS .It +.Va WITHOUT_MITKRB5 +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL @@ -468,9 +478,9 @@ When set, it enforces these options: When set, these options are also in effect: .Pp .Bl -inset -compact -.It Va WITHOUT_GSSAPI +.It Va WITHOUT_KERBEROS_SUPPORT (unless -.Va WITH_GSSAPI +.Va WITH_KERBEROS_SUPPORT is set explicitly) .El .It Va WITH_CTF @@ -484,7 +494,7 @@ Do not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. +arm/armv7 and riscv/riscv64. .It Va WITH_CXGBETOOL Build .Xr cxgbetool 8 @@ -646,7 +656,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_EFI Build .Xr efivar 3 @@ -678,7 +688,7 @@ Build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp This is a default setting on -arm/armv7, arm64/aarch64, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, arm64/aarch64, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITHOUT_FILE Do not build .Xr file 1 @@ -727,8 +737,6 @@ and dependent tests. Do not build .Xr gpioctl 8 as part of the base system. -.It Va WITHOUT_GSSAPI -Do not build libgssapi. .It Va WITHOUT_HAST Do not build .Xr hastd 8 @@ -741,7 +749,7 @@ Do not build HTML docs. Do not build or install HyperV utilities. .Pp This is a default setting on -arm/armv7, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_HYPERV Build or install HyperV utilities. .Pp @@ -828,14 +836,10 @@ Do not build and .Xr truss 1 . .It Va WITHOUT_KERBEROS -Set this to not build Kerberos 5 (KTH Heimdal). +Set this to not build Kerberos. When set, these options are also in effect: .Pp .Bl -inset -compact -.It Va WITHOUT_GSSAPI -(unless -.Va WITH_GSSAPI -is set explicitly) .It Va WITHOUT_KERBEROS_SUPPORT (unless .Va WITH_KERBEROS_SUPPORT @@ -907,7 +911,7 @@ On 64-bit platforms, do not build 32-bit library set and a runtime linker. .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, i386/i386, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LIB32 On 64-bit platforms, build the 32-bit library set and a .Nm ld-elf32.so.1 @@ -926,7 +930,7 @@ arm/armv7 and riscv/riscv64. Build the LLDB debugger. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LLD_BOOTSTRAP Do not build the LLD linker during the bootstrap phase of the build. @@ -1029,7 +1033,7 @@ with support for verification based on certificates obtained from UEFI. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_GELI Build GELI bootloader support. .Pp @@ -1039,7 +1043,7 @@ amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. Do not build the 32-bit UEFI loader. .Pp This is a default setting on -arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_IA32 Build the 32-bit UEFI loader. .Pp @@ -1049,7 +1053,7 @@ amd64/amd64. Do not build kboot, a linuxboot environment loader .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, i386/i386, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_LOADER_KBOOT Build kboot, a linuxboot environment loader .Pp @@ -1059,7 +1063,7 @@ amd64/amd64, arm64/aarch64 and powerpc/powerpc64. Do not build LUA bindings for the boot loader. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITH_LOADER_LUA Build LUA bindings for the boot loader. .Pp @@ -1074,7 +1078,7 @@ amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. Build openfirmware bootloader components. .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_LOADER_PXEBOOT Do not build pxeboot on i386/amd64. When the pxeboot is too large, or unneeded, it may be disabled with this option. @@ -1095,7 +1099,7 @@ amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64le and riscv/riscv64. Build ubldr. .Pp This is a default setting on -arm/armv7, powerpc/powerpc and powerpc/powerpc64. +arm/armv7 and powerpc/powerpc64. .It Va WITH_LOADER_VERBOSE Build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. @@ -1189,7 +1193,12 @@ for more details. .It Va WITH_MALLOC_PRODUCTION Disable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to false. .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: @@ -1288,12 +1297,14 @@ This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITHOUT_MITKRB5 +Set this to build KTH Heimdal instead of MIT Kerberos 5. .It Va WITHOUT_MLX5TOOL Do not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. +arm/armv7 and riscv/riscv64. .It Va WITH_MLX5TOOL Build .Xr mlx5tool 8 @@ -1385,7 +1396,7 @@ Build the InfiniBand software stack, including kernel modules and userspace libraries. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. .It Va WITH_OFED_EXTRA Build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" @@ -1396,7 +1407,7 @@ Enable building LDAP support for kerberos using an openldap client from ports. Do not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/armv7 and powerpc/powerpc. +arm/armv7. .It Va WITH_OPENMP Build LLVM's OpenMP runtime. .Pp @@ -1414,14 +1425,14 @@ When set, it enforces these options: .It .Va WITHOUT_KERBEROS .It -.Va WITHOUT_KERBEROS_SUPPORT -.It .Va WITHOUT_LDNS .It .Va WITHOUT_LDNS_UTILS .It .Va WITHOUT_LOADER_ZFS .It +.Va WITHOUT_MITKRB5 +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL_KTLS @@ -1438,16 +1449,16 @@ When set, it enforces these options: When set, these options are also in effect: .Pp .Bl -inset -compact -.It Va WITHOUT_GSSAPI +.It Va WITHOUT_KERBEROS_SUPPORT (unless -.Va WITH_GSSAPI +.Va WITH_KERBEROS_SUPPORT is set explicitly) .El .It Va WITHOUT_OPENSSL_KTLS Do not include kernel TLS support in OpenSSL. .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc and riscv/riscv64. +arm/armv7, i386/i386 and riscv/riscv64. .It Va WITH_OPENSSL_KTLS Include kernel TLS support in OpenSSL. .Pp @@ -1484,7 +1495,7 @@ Do not build dynamically linked binaries as Position-Independent Executable (PIE). .Pp This is a default setting on -arm/armv7, i386/i386 and powerpc/powerpc. +arm/armv7 and i386/i386. .It Va WITH_PIE Build dynamically linked binaries as Position-Independent Executable (PIE). @@ -1552,6 +1563,8 @@ utility. Build .Xr rpcbind 8 with warmstart support. +.It Va WITH_RUN_TESTS +Run tests as part of the build. .It Va WITHOUT_SCTP_SUPPORT Disable support in the kernel for the .Xr sctp 4 diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index cc5d2f6bb28a..fe8754924575 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2002-2003, 2023 David O'Brien <obrien@FreeBSD.org> .\" All rights reserved. .\" @@ -30,10 +33,7 @@ .Os .Sh NAME .Nm style.Makefile -.Nd -.Fx -.Pa Makefile -file style guide +.Nd FreeBSD Makefile style guide .Sh DESCRIPTION This file specifies the preferred style for makefiles in the .Fx diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 2c4f158280f7..1e50242a1754 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -6,6 +6,7 @@ MAN= arch.7 \ bsd.snmpmod.mk.7 \ build.7 \ c.7 \ + d.7 \ clocks.7 \ crypto.7 \ development.7 \ @@ -17,6 +18,7 @@ MAN= arch.7 \ intro.7 \ maclabel.7 \ mitigations.7 \ + named_attribute.7 \ operator.7 \ orders.7 \ ports.7 \ @@ -30,6 +32,7 @@ MAN= arch.7 \ stdint.7 \ sticky.7 \ tests.7 \ + tracing.7 \ tuning.7 MLINKS= intro.7 miscellaneous.7 diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 91f6953370d9..fe4e8055a8b1 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2025 +.Dd July 14, 2025 .Dt ARCH 7 .Os .Sh NAME @@ -67,8 +67,7 @@ and should be avoided. .Pp On some architectures, e.g., -.Dv powerpc -and AIM variants of +AIM variants of .Dv powerpc64 , the kernel uses a separate address space. On other architectures, kernel and a user mode process share a @@ -88,9 +87,6 @@ release to support each architecture. .It aarch64 Ta 11.0 .It amd64 Ta 5.1 .It armv7 Ta 12.0 -.It i386 Ta 1.0 -.It powerpc Ta 6.0 -.It powerpcspe Ta 12.0 .It powerpc64 Ta 9.0 .It powerpc64le Ta 13.0 .It riscv64 Ta 12.0 @@ -104,6 +100,7 @@ Discontinued architectures are shown in the following table. .It armeb Ta 8.0 Ta 11.4 .It armv6 Ta 10.0 Ta 14.x .It ia64 Ta 5.0 Ta 10.4 +.It i386 Ta 1.0 Ta 14.x .It mips Ta 8.0 Ta 13.5 .It mipsel Ta 9.0 Ta 13.5 .It mipselhf Ta 12.0 Ta 13.5 @@ -114,6 +111,8 @@ Discontinued architectures are shown in the following table. .It mips64elhf Ta 12.0 Ta 13.5 .It mips64hf Ta 12.0 Ta 13.5 .It pc98 Ta 2.2 Ta 11.4 +.It powerpc Ta 6.0 Ta 14.x +.It powerpcspe Ta 12.0 Ta 14.x .It riscv64sf Ta 12.0 Ta 13.5 .It sparc64 Ta 5.0 Ta 12.4 .El diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 0aae2c42ac04..4022b915c972 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 8, 2025 +.Dd August 8, 2025 .Dt BUILD 7 .Os .Sh NAME @@ -667,8 +667,12 @@ This is currently incompatible with building .Pa src into .Cm packages . -.Bd -literal -offset indent -make PORTS_MODULES=emulators/virtualbox-ose-kmod kernel +Each port must be specified as +.Ar category Ns Li / Ns Ar port Ns Op Li @ Ns Ar flavor , +e.g. +.Bd -literal +PORTS_MODULES=graphics/gpu-firmware-intel-kmod@kabylake +PORTS_MODULES+=graphics/drm-66-kmod .Ed .It Va LOCAL_MODULES A list of external kernel modules that should be built and installed diff --git a/share/man/man7/d.7 b/share/man/man7/d.7 new file mode 100644 index 000000000000..f4686d98b1d1 --- /dev/null +++ b/share/man/man7/d.7 @@ -0,0 +1,287 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd June 14, 2025 +.Dt D 7 +.Os +.Sh NAME +.Nm D +.Nd DTrace scripting language overview +.Sh SYNOPSIS +.Sm off +.Ar provider Cm \&: +.Ar module Cm \&: +.Ar function Cm \&: +.Ar name +.Sm on +.Sm off +.Oo +.Cm / +.Ar predicate +.Cm / +.Sm on +.Oc +.Op Cm \&{ Ns Ar action Ns Cm \&} +.Sh DESCRIPTION +.Nm D +is the +.Xr dtrace 1 +scripting language. +This manual provides a brief reference of the +.Nm +language and scripting. +.Pp +This manual page serves as a short reference of the language. +Refer to books listed in +.Sx SEE ALSO +for a complete reference. +.Sh PROBE'S DESCRIPTION +A probe's description consists of four elements: +.Sm off +.D1 Ar provider Ns Cm \&: Ns Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on +.Pp +The exact meaning of +.Ar module , +.Ar function , +and +.Ar name +depends on +.Ar provider . +.Sh USER-DEFINED VARIABLE TYPES +.Bl -column "thread-local" "Syntax" +.It Sy Type Ta Sy Syntax +.It global Ta Va variable_name +.It thread-local Ta Sy self-> Ns Va variable_name +.It clause-local Ta Sy this-> Ns Va variable_name +.It aggregate Ta Sy @ Ns Va variable_name +.El +.Pp +.Em Tips : +.Bl -dash -compact +.It +Always use the variable type with the smallest scope +to minimize processing overhead. +.It +Use aggregate variables instead of global variables when possible. +Aggregate variables are multi-CPU safe in contrast to global variables. +.El +.Sh BUILT-IN VARIABLES +.Ss Probe Arguments +.Bl -tag -width "arg0, ..., arg9" +.It Va args[] +The array of typed probe arguments. +.It Va arg0 , ... , arg9 +The untyped probe arguments represented as 64-bit unsigned integers. +Only the first ten arguments are available this way. +.El +.Ss Probe Information +.Bl -tag -width probeprov +.It Va epid +The enabled probe ID which uniquely identifies an enabled probe. +An enabled probe is defined by its probe ID, its predicates, and its actions. +.It Va id +The probe ID which uniquely identifies a probe available to DTrace. +.It Va probeprov +The +.Ar provider +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probemod +The +.Ar module +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probefunc +The +.Ar function +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.It Va probename +The +.Ar name +in the probe's description +.Sm off +.Pq Ar provider Cm \&: Ar module Cm \&: Ar function Cm \&: Ar name +.Sm on . +.El +.Ss Process Information +.Bl -tag -width execname +.It Va execargs +The process arguments. +Effectively, +.Ql curthread->td_proc->p_args . +.It Va execname +The name of the current process. +Effectively, +.Ql curthread->td_proc->p_comm . +.It Va gid +The group ID of the current process. +.It Va pid +The process ID of the current process. +.It Va ppid +The parent process ID of the current process. +.It Va uid +The user ID of the current process. +.El +.Ss Thread Information +.Bl -tag -width curlwpsinfo +.It Va uregs[] +The saved user-mode register values. +.It Va cpu +The ID of the current CPU. +.It Va stackdepth +The kernel stack frame depth. +.It Va ustackdepth +The userspace counterpart of +.Va stackdepth . +.It Va tid +The thread ID. +Depending on the context, +this can be either the ID of a kernel thread or a thread in a user process. +.It Va errno +The +.Xr errno 2 +value of the last system call performed by the current thread. +.It Va curlwpsinfo +A pointer to the +.Vt lwpsinfo_t +representation of the current thread. +Refer to +.Xr dtrace_proc 4 +for more details. +.It Va curpsinfo +A pointer to the +.Vt psinfo_t +representation of the current process. +Refer to +.Xr dtrace_proc 4 +for more details. +.It Va curthread +A pointer to the thread struct that is currently on-CPU. +E.g., +.Ql curthread->td_name +returns the thread name. +The +.In sys/proc.h +header documents all members of +.Vt struct thread . +.It Va caller +The address of the kernel thread instruction at the time of execution +of the current probe. +.It Va ucaller +The userspace counterpart of +.Va caller . +.El +.Ss Timestamps +.Bl -tag -width walltimestamp +.It Va timestamp +The number of nanoseconds since boot. +Suitable for calculating relative time differences of elapsed time and latency. +.It Va vtimestamp +The number of nanoseconds that the current thread spent on CPU. +The counter is not increased during handling of a fired DTrace probe. +Suitable for calculating relative time differences of on-CPU time. +.It Va walltimestamp +The number of nanoseconds since the Epoch +.Pq 1970-01-01T00+00:00 . +Suitable for timestamping logs. +.El +.Sh BUILT-IN FUNCTIONS +.Ss Aggregation Functions +.Bl -tag -compact -width "llquantize(value, factor, low, high, nsteps)" +.It Fn avg value +Average +.It Fn count +Count +.It Fn llquantize value factor low high nsteps +Log-linear quantization +.It Fn lquantize value low high nsteps +Linear quantization +.It Fn max value +Maximum +.It Fn min value +Minimum +.It Fn quantize value +Power-of-two frequency distribution +.It Fn stddev value +Standard deviation +.It Fn sum value +Sum +.El +.Ss Kernel Destructive Functions +By default, +.Xr dtrace 1 +does not permit the use of destructive actions. +.Bl -tag -width "chill(nanoseconds)" +.It Fn breakpoint +Set a kernel breakpoint and transfer control to +the +.Xr ddb 4 +kernel debugger. +.It Fn chill nanoseconds +Spin on the CPU for the specified number of +.Fa nanoseconds . +.It Fn panic +Panic the kernel. +.El +.Sh FILES +.Bl -tag -width /usr/share/dtrace +.It Pa /usr/share/dtrace +DTrace scripts shipped with +.Fx +base. +.El +.Sh SEE ALSO +.Xr awk 1 , +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%B The illumos Dynamic Tracing Guide +.%D 2008 +.%U https://illumos.org/books/dtrace/ +.Re +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%A George Neville-Neil +.%A Jonathan Anderson +.%A Graeme Jenkinson +.%A Brian Kidney +.%A Domagoj Stolfa +.%A Arun Thomas +.%A Robert N. M. Watson +.%C Cambridge, United Kingdom +.%D August 2018 +.%T Univeristy of Cambridge Computer Laboratory +.%R OpenDTrace Specification version 1.0 +.%U https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-924.pdf +.Re +.Sh HISTORY +This manual page first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh BUGS +The +.Va cwd +variable which typically provides the current working directory is +not supported on +.Fx +at the moment. diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 1c69b911f53b..814f5b769be8 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 10, 2024 +.Dd August 18, 2025 .Dt HIER 7 .Os .Sh NAME @@ -308,6 +308,21 @@ OpenSSH configuration files; see .Xr ssh 1 .It Pa ssl/ OpenSSL configuration files +.Pp +.Bl -tag -width "untrusted/" -compact +.It Pa cert.pem +System trust store in bundle form; see +.Xr certctl 8 . +.It Pa certs/ +System trust store in OpenSSL hashed-directory form; see +.Xr certctl 8 . +.It Pa openssl.cnf +OpenSSL configuration file; see +.Xr openssl.cnf 5 . +.It Pa untrusted/ +Explicitly distrusted certificates; see +.Xr certctl 8 . +.El .It Pa sysctl.conf kernel state defaults; see .Xr sysctl.conf 5 diff --git a/share/man/man7/intro.7 b/share/man/man7/intro.7 index be6f68556895..43e48de87bc5 100644 --- a/share/man/man7/intro.7 +++ b/share/man/man7/intro.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 18, 2024 +.Dd July 14, 2025 .Dt INTRO 7 .Os .Sh NAME @@ -49,6 +49,9 @@ system timekeeping clocks available in .It Xr crypto 7 cryptographic algorithms provided by OpenCrypto in .Fx +.It Xr d 7 +.Xr dtrace 1 +scripting language overview .It Xr development 7 development introduction to .Fx @@ -81,6 +84,8 @@ statistics utilities available in introduction to the .Fx Test Suite +.It Xr tracing 7 +introduction to tracing and performance monitoring facilities .It Xr tuning 7 general advice on tuning .Fx diff --git a/share/man/man7/named_attribute.7 b/share/man/man7/named_attribute.7 new file mode 100644 index 000000000000..a0599ef71496 --- /dev/null +++ b/share/man/man7/named_attribute.7 @@ -0,0 +1,320 @@ +.\" +.\" Copyright (c) 2025 Rick Macklem +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd August 5, 2025 +.Dt NAMED_ATTRIBUTE 7 +.Os +.Sh NAME +.Nm named_attribute +.Nd Solaris-like extended attribute system interface +.Sh DESCRIPTION +Description of the system interface for named attributes +(the NFS Version 4 terminology). +.Ss Introduction +This document describes an alternate system interface for extended +attributes as compared to +.Xr extattr 2 . +It is based on the interface provided by Solaris and NFS Version 4. +.Pp +This interface associates a directory, known as a named attribute directory, +to a file system object. +This directory is read in the same manner as a normal directory via the +.Xr getdents 2 +or +.Xr getdirentries 2 +system calls. +The +.Pa .\& +and +.Pa ..\& +entries refer to the directory itself and to the associated file object, +respectively. +The other entries in this directory +are the names of the extended attributes for the associated file object +and are referred to as named attributes. +These named attributes are regular files used to store the attribute's +value. +.Pp +A named attribute directory does not live in the file system's name space. +It is accessed via an +.Xr open 2 +or +.Xr openat 2 +system call done on a file to query the named attributes for the file, +with the +.Dv O_NAMEDATTR +flag specified and a +.Fa path +argument of +.Pa .\& . +This file descriptor can be used as the +.Fa fd +argument for a variety of system calls, such as: +.Xr fchdir 2 , +.Xr unlinkat 2 +and +.Xr renameat 2 . +.Xr renameat 2 +is only permitted to rename a named attribute within the same named +attribute directory. +.Pp +When a file descriptor for a file object in the file system's namespace +is used as the +.Fa fd +argument of an +.Xr openat 2 +along with the +.Fa flag +.Dv O_NAMEDATTR +and a +.Fa path +argument that is the name of a named attribute (not +.Pa .\& +or +.Pa ..\& +), a file descriptor for the named attribute is returned. +If the +.Fa flag +.Dv O_CREAT +is specified, the named attribute will be created if it does not exist. +The +.Fa path +argument must be a single component name, with no embedded +.Dq / +in it. +I/O on these named attribute file descriptors may be performed by +standard I/O system calls +such as: +.Xr read 2 , +.Xr write 2 , +.Xr lseek 2 +and +.Xr ftruncate 2 . +.Pp +The +.Dv _PC_NAMEDATTR_ENABLED +.Fa name +argument to +.Xr pathconf 2 +will return 1 if the file system supports named attributes. +The +.Dv _PC_HAS_NAMEDATTR +.Fa name +argument to +.Xr pathconf 2 +will return 1 if there are one or more named attributes for the file. +If an application does a +.Xr openat 2 +of +.Dq .\& +to open a named attribute directory when no named attribute directory exists, +an empty named attribute directory will be created. +Testing +.Dv _PC_HAS_NAMEDATTR +can be done to avoid creating these named attribute directories unnecessarily. +.Pp +The named attribute interface is a different mechanism/system call interface for +manipulating extended attributes compared with +.Xr extattr 2 . +Although the named attribute machanism might require different internal +implementation +of extended attributes within a file system, both ZFS and NFSv4 provide +both mechanisms, which can be used interchangeably to manipulate +extended attributes, but with a few limitations. +.Bl -bullet +.It +The +.Xr extattr 2 +interface requires that an extended attribute's value be set or acquired +via a single system call using a single buffer. +This limits the size of the attribute's value. +.It +The named attribute interface does not support system namespace +extended attributes and, +as such, system namespace extended attributes must be manipulated via +.Xr extattr 2 . +.It +For ZFS, if an extended attribute with a value +that is a small length in bytes is created when the ZFS +.Dv xattr +property is set to +.Dq sa , +that extended attribute is only visible via +.Xr extattr 2 +and not as a named attribute. +Archiving/de-archiving the file via +.Xr tar 1 +after setting the +.Dv xattr +property to +.Dq dir +will make the attribute(s) visible as both named attributes +and via +.Xr extattr 2 . +.It +For ZFS, it is also possible to create two attributes with the same +name by creating one when the ZFS +.Dv xattr +property is set to +.Dq sa +and then creating another one with the same name after the ZFS +property +.Dv xattr +has been changed to +.Dq dir . +The one created when the ZFS +.Dv xattr +property is set to +.Dq sa +may be removed via +.Xr rmextattr 8 . +.It +To avoid these issues for ZFS, it is strongly recommended that the ZFS +property +.Dv xattr +be set to +.Dq dir +as soon as the file system is created, if named attributes +are to be used on the file system. +.El +.Pp +The named attribute mechanism/system call interface provides certain +advantages over +.Xr extattr 2 . +Since the attribute's value is updated via +.Xr read 2 +and +.Xr write 2 +system calls, the attribute's data may be as large as any regular file +and may be partially updated. +(Note that this interface does not provide the atomicity guarantee that +.Xr extattr 2 +does.) +The permission to access a named attribute directory is determined from +the access control information for the associated file object. +However, access control information can be set on each individual attribute +in a manner similar to a regular file. +This provides +.Dq per attribute +granular control over attribute permissions via +.Xr fchown 2 . +.Pp +At this time, the only local file system which supports this interface +is ZFS and only if the +.Dv xattr +property is set to +.Dq dir . +(Note that, even when +.Dq zfs get xattr <file-system> +shows +.Dq on +the command +.Dq zfs set xattr=dir <file-system> +must be done, followed by a remount to make the setting take effect.) +A NFSv4 mount will also support this interface, but only if the NFSv4 +server file system supports named attributes (the openattr operation). +The +.Fx +NFSv4 server supports named attributes only +for ZFS exported file systems where the +.Dq xattr +property is set to +.Dq dir +for the file system. +.Sh EXAMPLES +.Bd -literal +#include <stdio.h> +#include <dirent.h> +#include <fcntl.h> +#include <unistd.h> + +\&... + +/* For a file called "myfile". Failure checks removed for brevity. */ +int file_fd, nameddir_fd, namedattr_fd; +ssize_t siz; +char buf[DIRBLKSIZ], *cp; +struct dirent *dp; +long named_enabled, has_named_attrs; + +\&... +/* Check to see if named attributes are supported. */ +named_enabled = pathconf("myfile", _PC_NAMEDATTR_ENABLED); +if (named_enabled <= 0) + err(1, "Named attributes not enabled"); +/* Test to see if named attribute(s) exist for the file. */ +has_named_attrs = pathconf("myfile", _PC_HAS_NAMEDATTR); +if (has_named_attrs == 1) + printf("myfile has named attribute(s)\\n"); +else + printf("myfile does not have any named attributes\\n"); +/* Open a named attribute directory. */ +file_fd = open("myfile", O_RDONLY, 0); +nameddir_fd = openat(file_fd, ".", O_NAMEDATTR, 0); +\&... +/* and read it, assuming it all fits in DIRBLKSIZ for simplicity. */ +siz = getdents(fd, buf, sizeof(buf)); +cp = buf; +while (cp < &buf[siz]) { + dp = (struct dirent *)cp; + printf("name=%s\\n", dp->d_name); + cp += dp->d_reclen; +} +\&... +/* Open/create a named attribute called "foo". */ +namedattr_fd = openat(file_fd, "foo", O_CREAT | O_RDWR | + O_TRUNC | O_NAMEDATTR, 0600); +\&... +/* Write foo's attribute value. */ +write(namedattr_fd, "xxxyyy", 6); +\&... +/* Read foo's attribute value. */ +lseek(namedattr_fd, 0, SEEK_SET); +siz = read(namedattr_fd, buf, sizeof(buf)); +\&... +/* And close "foo". */ +close(namedattr_fd); +\&... +/* Rename "foo" to "oldfoo". */ +renameat(nameddir_fd, "foo", nameddir_fd, "oldfoo"); +/* and delete "oldfoo". */ +unlinkat(nameddir_fd, "oldfoo", AT_RESOLVE_BENEATH); +.Ed +.Pp +The +.Xr runat 1 +command may be used to perform shell commands on named attributes. +For example: +.Bd -literal +$ runat myfile cp /etc/hosts attrhosts # creates attrhosts +$ runat myfile cat attrhosts # displays contents of attrhosts +$ runat myfile ls -l # lists the attributes for myfile +.Ed +.Pp +If using the +.Xr bash 1 +shell, the command +.Dq cd -@ foo +enters the named attribute directory for the file object +.Dq foo . +.Sh SEE ALSO +.Xr bash 1 , +.Xr runat 1 , +.Xr tar 1 , +.Xr chdir 2 , +.Xr extattr 2 , +.Xr lseek 2 , +.Xr open 2 , +.Xr pathconf 2 , +.Xr read 2 , +.Xr rename 2 , +.Xr truncate 2 , +.Xr unlinkat 2 , +.Xr write 2 , +.Xr zfsprops 7 , +.Xr rmextattr 8 +.Sh HISTORY +This interface first appeared in +.Fx 15.0 . diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 new file mode 100644 index 000000000000..7085bac78385 --- /dev/null +++ b/share/man/man7/tracing.7 @@ -0,0 +1,100 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 12, 2025 +.Dt TRACING 7 +.Os +.Sh NAME +.Nm tracing +.Nd introduction to FreeBSD tracing and performance monitoring +.Sh DESCRIPTION +.Fx +features a large variety of tracing and performance monitoring facilities. +Use them to measure performance and +troubleshoot kernel and userland problems both during +.Xr development 7 +and potentially on production systems. +The facilities differ in scope, ease of use, overhead, design, and limitations. +.Ss DTrace +.Xr dtrace 1 +is the most versatile tracing framework available on +.Fx +and is capable of tracing throughout the +.Fx +software stack from the kernel to the applications running in userland. +Refer to +.Xr dtrace 1 +and +.Xr SDT 9 +for more details. +.Pp +.Xr dwatch 1 +is a user-friendly wrapper for DTrace. +It simplifies common DTrace usage patterns and requires less expert knowledge +to operate. +.Ss Userland Tracing +.Xr truss 1 +traces system calls. +It uses +.Xr sysdecode 3 +to pretty-print system call arguments and +.Xr ptrace 2 +to trace processes. +.Pp +.Xr ktrace 1 +is useful for debugging user programs. +It enables kernel trace logging for specified processes. +Like +.Xr truss 1 , +it mainly traces system calls, but instead of using +.Xr ptrace 2 , +it asynchronously logs entries to a trace file configured with +.Xr ktrace 2 +(typically +.Pa ktrace.out ) , +and it can log other types of kernel events, such as page faults +and name lookups +.Po refer to +.Fl t +in +.Xr ktrace 1 +.Pc . +Also, programs can log to a +.Xr ktrace 1 +stream using the +.Xr utrace 2 +system call. +.Ss Kernel Tracing +.Xr ktr 4 +is a facility for logging strings in the kernel. +It comes in handy for some niche purposes during kernel development. +It lets kernel programmers log events to a global ring buffer, +which can later be dumped using +.Xr ktrdump 8 . +.Ss Hardware-Accelerated Tracing +.Xr hwt 4 +is a kernel trace framework providing infrastructure +for hardware-assisted tracing. +.Ss Hardware Counters +.Xr pmcstat 8 , +and its kernel counterpart, +.Xr hwpmc 4 , +is the +.Fx +facility for conducting performance measurements with hardware counters. +.Ss Boot-Time And Shutdown Tracing +.Xr boottrace 4 +is a facility for tracing events at boot and shutdown. +Its target audience are system administrators. +.Pp +.Xr tslog 4 +is a developer-oriented tool for tracing boot-time events. +.Sh HISTORY +The +.Nm +manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +It first appeared in +.Fx 15.0 . diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile index bd6bdfe4ba05..c408f1b65a80 100644 --- a/share/man/man8/Makefile +++ b/share/man/man8/Makefile @@ -1,5 +1,7 @@ .include <src.opts.mk> +MANGROUPS= MAN + MAN= \ beinstall.8 \ crash.8 \ @@ -7,29 +9,32 @@ MAN= \ diskless.8 \ intro.8 \ nanobsd.8 \ - rc.8 \ - rc.subr.8 \ rescue.8 \ - ${_uefi.8} \ + ${_uefi.8} MLINKS= \ beinstall.8 beinstall.sh.8 \ - nanobsd.8 nanobsd.sh.8 \ - rc.8 rc.d.8 \ - rc.8 rc.firewall.8 \ - rc.8 rc.local.8 \ - rc.8 rc.network.8 \ - rc.8 rc.pccard.8 \ - rc.8 rc.resume.8 \ - rc.8 rc.serial.8 \ - rc.8 rc.shutdown.8 + nanobsd.8 nanobsd.sh.8 -.if ${MK_NIS} != "no" -MAN+= yp.8 +MANGROUPS+= RC +RC= rc.8 rc.subr.8 +RCLINKS= rc.8 rc.d.8 \ + rc.8 rc.firewall.8 \ + rc.8 rc.local.8 \ + rc.8 rc.network.8 \ + rc.8 rc.pccard.8 \ + rc.8 rc.resume.8 \ + rc.8 rc.serial.8 \ + rc.8 rc.shutdown.8 +RCPACKAGE= rc -MLINKS+=yp.8 NIS.8 \ - yp.8 nis.8 \ - yp.8 YP.8 +.if ${MK_NIS} != "no" +MANGROUPS+= YP +YP= yp.8 +YPLINKS= yp.8 NIS.8 \ + yp.8 nis.8 \ + yp.8 YP.8 +YPPACKAGE= yp .endif # This makes more sense for aarch 64 and amd64 diff --git a/share/man/man8/crash.8 b/share/man/man8/crash.8 index 27c9c56533a5..fdb9b7213847 100644 --- a/share/man/man8/crash.8 +++ b/share/man/man8/crash.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 23, 2011 +.Dd July 25, 2025 .Dt CRASH 8 .Os .Sh NAME @@ -71,18 +71,19 @@ Left unstated in all cases is the possibility that hardware or software error produced the message in some unexpected way. .Pp .Bl -diag -compact -.It "cannot mount root" -This panic message results from a failure to mount the root file system -during the bootstrap process. -Either the root file system has been corrupted, -or the system is attempting to use the wrong device as root file system. -Usually, an alternate copy of the system binary or an alternate root -file system can be used to bring up the system to investigate. -Most often -this is done by the use of the boot floppy you used to install the system, -and then using the -.Dq fixit -floppy. +.It Mounting from <device> failed with error <err> +The system was unable to mount the configured root filesystem. +Either the root filesystem has been corrupted, +or the system is attempting to use the wrong device as root filesystem. +.Pp +This is not a panic message; rather it is followed by an interactive +.Sy mountroot> +prompt where the operator can list detected devices and filesystems, +and select an alternative root filesystem to mount. +Alternatively, the system can be booted from recovery media to repair +the situation. +The system install media provides a live environment which is suitable +for this task. .Pp .It "init: not found" This is not a panic message, as reboots are likely to be futile. @@ -108,11 +109,6 @@ after a crash, hardware failures, or other condition that should not normally occur. A file system check will normally correct the problem. .Pp -.It "timeout table full" -This really should not be a panic, but until the data structure -involved is made to be extensible, running out of entries causes a crash. -If this happens, make the timeout table bigger. -.Pp .\" .It "trap type %d, code = %x, v = %x" .\" An unexpected trap has occurred within the system; the trap types are: .\" .Bl -column xxxx -offset indent diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8 index 2ba072541ada..838f9ddc9afa 100644 --- a/share/man/man8/nanobsd.8 +++ b/share/man/man8/nanobsd.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006 Daniel Gerzo <danger@FreeBSD.org> .\" All rights reserved. .\" @@ -22,13 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2024 +.Dd July 14, 2025 .Dt NANOBSD 8 .Os .Sh NAME .Nm nanobsd.sh -.Nd utility used to create a FreeBSD system image suitable for embedded -applications +.Nd create an embedded FreeBSD system image .Sh SYNOPSIS .Nm .Op Fl BbfhIiKknqvWwX diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index f7cd206126d6..5bcde3030ebc 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,5 +1,7 @@ .include <src.opts.mk> +PACKAGE= kernel + MAN= accept_filter.9 \ accf_data.9 \ accf_dns.9 \ @@ -67,6 +69,7 @@ MAN= accept_filter.9 \ config_intrhook.9 \ contigmalloc.9 \ copy.9 \ + coredumper_register.9 \ counter.9 \ cpu_machdep.9 \ cpuset.9 \ @@ -393,7 +396,6 @@ MAN= accept_filter.9 \ vm_map_max.9 \ vm_map_protect.9 \ vm_map_remove.9 \ - vm_map_simplify_entry.9 \ vm_map_stack.9 \ vm_map_submap.9 \ vm_map_sync.9 \ @@ -435,6 +437,7 @@ MAN= accept_filter.9 \ VOP_GETEXTATTR.9 \ VOP_GETPAGES.9 \ VOP_INACTIVE.9 \ + VOP_INOTIFY.9 \ VOP_IOCTL.9 \ VOP_LINK.9 \ VOP_LISTEXTATTR.9 \ @@ -903,6 +906,7 @@ MLINKS+=copy.9 copyin.9 \ copy.9 copyout.9 \ copy.9 copyout_nofault.9 \ copy.9 copystr.9 +MLINKS+=coredumper_register.9 coredumper_unregister.9 MLINKS+=counter.9 counter_u64_alloc.9 \ counter.9 counter_u64_free.9 \ counter.9 counter_u64_add.9 \ @@ -2461,6 +2465,7 @@ MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \ MLINKS+=VOP_FSYNC.9 VOP_FDATASYNC.9 MLINKS+=VOP_GETPAGES.9 VOP_PUTPAGES.9 MLINKS+=VOP_INACTIVE.9 VOP_RECLAIM.9 +MLINKS+=VOP_INOTIFY.9 VOP_INOTIFY_ADD_WATCH.9 MLINKS+=VOP_LOCK.9 vn_lock.9 \ VOP_LOCK.9 VOP_ISLOCKED.9 \ VOP_LOCK.9 VOP_UNLOCK.9 diff --git a/share/man/man9/PCI_IOV_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD_VF.9 index d13cb6e1ddc9..512b0b8668cc 100644 --- a/share/man/man9/PCI_IOV_ADD_VF.9 +++ b/share/man/man9/PCI_IOV_ADD_VF.9 @@ -31,7 +31,7 @@ .Nd inform a PF driver that a VF is being created .Sh SYNOPSIS .In sys/bus.h -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In dev/pci/pci_iov.h .Ft int diff --git a/share/man/man9/PCI_IOV_INIT.9 b/share/man/man9/PCI_IOV_INIT.9 index 66b1e693cedb..8ce94800f6d1 100644 --- a/share/man/man9/PCI_IOV_INIT.9 +++ b/share/man/man9/PCI_IOV_INIT.9 @@ -31,7 +31,7 @@ .Nd enable SR-IOV on a PF device .Sh SYNOPSIS .In sys/bus.h -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In dev/pci/pci_iov.h .Ft int diff --git a/share/man/man9/VOP_INOTIFY.9 b/share/man/man9/VOP_INOTIFY.9 new file mode 100644 index 000000000000..43b644682153 --- /dev/null +++ b/share/man/man9/VOP_INOTIFY.9 @@ -0,0 +1,60 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Klara, Inc. +.\" +.Dd May 27, 2025 +.Dt VOP_INOTIFY 9 +.Os +.Sh NAME +.Nm VOP_INOTIFY +.Nd vnode inotify interface +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fo VOP_INOTIFY +.Fa struct vnode *vp +.Fa struct vnode *dvp +.Fa struct componentname *cnp +.Fa int event +.Fa uint32_t cookie +.Fc +.Ft int +.Fo VOP_INOTIFY_ADD_WATCH +.Fa struct vnode *vp +.Fa struct inotify_softc *sc +.Fa uint32_t mask +.Fa uint32_t *wdp +.Fa struct thread *td +.Fc +.Sh DESCRIPTION +The +.Fn VOP_INOTIFY +operation notifies the +.Xr inotify 2 +subsystem of a file system event on a vnode. +The +.Fa dvp +and +.Fa cnp +arguments are optional and are only used to obtain a file name for the event. +If they are omitted, the inotify subsystem will use the file name cache to +find a name for the vnode, but this is more expensive. +.Pp +The +.Fn VOP_INOTIFY_ADD_WATCH +operation is for internal use by the inotify subsystem to add a watch to a +vnode. +.Sh LOCKS +The +.Fn VOP_INOTIFY +operation does not assume any particular vnode lock state. +The +.Fn VOP_INOTIFY_ADD_WATCH +operation should be called with the vnode locked. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh SEE ALSO +.Xr inotify 2 , +.Xr vnode 9 diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index 397ddb0891bb..cc56e34d070a 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -319,7 +319,7 @@ to distinguish it from newer standards. Support for this compilation environment is dependent on compilers supporting this configuration. Most of the old forms of C have been deprecated or removed in -.St -isoC-2024 . +.St -isoC-2023 . Compilers make compiling in this mode increasingly difficult and support for it may ultimately be removed from the tree. .It St -ansiC @@ -349,7 +349,7 @@ since there are no new C17 only symbols or macros. .Pp This version of the standard did not introduce any new features, only made minor, technical corrections. -.It St -isoC-2024 +.It St -isoC-2023 .Dv __STDC_VERSION__ = 202311L Strict environment selected with .Dv _C23_SOURCE @@ -385,7 +385,7 @@ implements this as a NOP because too much software breaks with the correct stric .It Dv _ANSI_SOURCE Ta St -ansiC .It Dv _C99_SOURCE Ta St -isoC-99 .It Dv _C11_SOURCE Ta St -isoC-2011 -.It Dv _C23_SOURCE Ta St -isoC-2024 +.It Dv _C23_SOURCE Ta St -isoC-2023 .It Dv _BSD_SOURCE Ta Everything, including Fx extensions .El .Pp @@ -406,7 +406,7 @@ Likewise, when C23 dialog is selected with or .St -p1003.1-2024 , definitions for -.St -isoC-2024 +.St -isoC-2023 are also included. .Ss Header Visibility Macros These macros are set by @@ -432,7 +432,7 @@ Possible values include 1990, 1999, 2011, 2017 and 2023 for .St -isoC-99 , .St -isoC-2011 , ISO/IEC 9899:2018 ("ISO C17"), and -.St -isoC-2024 , +.St -isoC-2023 , respectively. .It Dv __BSD_VISIBLE Ta 1 if the .Fx diff --git a/share/man/man9/coredumper_register.9 b/share/man/man9/coredumper_register.9 new file mode 100644 index 000000000000..f4c9eb4a1bf6 --- /dev/null +++ b/share/man/man9/coredumper_register.9 @@ -0,0 +1,168 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Kyle Evans <kevans@FreeBSD.org> +.\" +.Dd July 23, 2025 +.Dt COREDUMPER_REGISTER 9 +.Os +.Sh NAME +.Nm coredumper_register , +.Nm coredumper_unregister +.Nd loadable user coredumper support +.Sh SYNOPSIS +.In sys/ucoredump.h +.Ft void +.Fn coredumper_register "struct coredumper *cd" +.Ft void +.Fn coredumper_unregister "struct coredumper *cd" +.Pp +.Ft int +.Fn coredumper_probe_fn "struct thread *td" +.Ft int +.Fn coredumper_handle_fn "struct thread *td" "off_t limit" +.Bd -literal +/* Incomplete, but the useful members are depicted here. */ +struct coredumper { + const char *cd_name; + coredumper_probe_fn *cd_probe; + coredumper_handle_fn *cd_handle; +}; +.Ed +.Pp +.Ft int +.Fn coredump_init_fn "const struct coredump_writer *" \ +"const struct coredump_params *" +.Ft int +.Fn coredump_write_fn "const struct coredump_writer *" "const void *" "size_t" \ +"off_t" "enum uio_seg" "struct ucred *" "size_t *" "struct thread *" +.Ft int +.Fn coredump_extend_fn "const struct coredump_writer *" "off_t" "struct ucred *" +.Bd -literal +struct coredump_writer { + void *ctx; + coredump_init_fn *init_fn; + coredump_write_fn *write_fn; + coredump_extend_fn *extend_fn; +}; +.Ed +.Sh DESCRIPTION +The +.Nm +mechanism provides a path for kernel modules to register a new user process core +dumper. +The expected use of +.Nm +is for a module to define the fields of the struct coredumper listed above, then +call +.Fn coredumper_register +at +.Dv MOD_LOAD +time. +A corresponding +.Fn coredumper_unregister +should be called at +.Dv MOD_UNLOAD +time. +Note that +.Fn coredumper_unregister +will block until the specified coredumper is no longer processing coredumps. +.Pp +When a user process is preparing to start dumping core, the kernel will execute +the +.Fn cd_probe +function for each coredumper currently registered. +The +.Fn cd_probe +function is expected to return either -1 if it would decline to dump the +process, or a priority level greater than 0. +The coredumper with the highest priority will handle the coredump. +The following default priorities are defined: +.Bl -tag -width indent +.It Dv COREDUMPER_NOMATCH +This dumper declines dumping the process. +.It Dv COREDUMPER_GENERIC +This dumper will dump the process at the lowest priority. +This priority is not recommended, as the default vnode dumper will bid at +.Dv COREDUMPER_GENERIC +as well. +.It Dv COREDUMPER_SPECIAL +This dumper provides special behavior, and will dump the process at a higher +priority. +.It Dv COREDUMPER_HIGHPRIORITY +This dumper would prefer to handle this coredump. +This may be used by, for instance, a custom or vendor-specific coredump +mechanism that wishes to preempt others. +.El +.Pp +Note that this system has been designed such that the +.Fn cd_probe +function can examine the process in question and make an informed decision. +Different processes being dumped could probe at different priorities in the +same coredumper. +.Pp +Once the highest priority coredumper has been selected, the +.Fn cd_handle +function will be invoked. +The +.Fn cd_handle +will receive both the thread and the +.Dv RLIMIT_CORE +.Xr setrlimit 2 +.Fa limit . +The proc lock will be held on entry, and should be unlocked before the handler +returns. +The +.Fa limit +is typically passed to the +.Fn sv_coredump +that belongs to the process's +.Va p_sysent . +.Pp +The +.Fn cd_handle +function should return either 0 if the dump was successful, or an appropriate +.Xr errno 2 +otherwise. +.Ss Customized Coredump Writers +Custom coredumpers can define their own +.Dv coredump_writer +to pass to +.Fn sv_coredump . +.Pp +The +.Va ctx +member is opaque and only to be used by the coredumper itself. +.Pp +The +.Va init_fn +function, if it's provided, will be called by the +.Fn sv_coredump +implementation before any data is to be written. +This allows the writer implementation to record any coredump parameters that it +might need to capture, or setup the object to be written to. +.Pp +The +.Va write_fn +function will be called by the +.Fn sv_coredump +implementation to write out data. +The +.Va extend_fn +function will be called to enlarge the coredump, in the sense that a hole is +created in any difference between the current size and the new size. +For convenience, the +.Fn core_vn_write +and +.Fn core_vn_extend +functions used by the vnode coredumper are exposed in +.In sys/ucordumper.h , +and the +.Dv coredump_vnode_ctx +defined there should be populated with the vnode to write to. +.Sh SEE ALSO +.Xr setrlimit 2 , +.Xr core 5 +.Sh AUTHORS +This manual page was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . diff --git a/share/man/man9/counter.9 b/share/man/man9/counter.9 index 1d3f3281ac0b..05af87e8263e 100644 --- a/share/man/man9/counter.9 +++ b/share/man/man9/counter.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 11, 2021 +.Dd June 19, 2025 .Dt COUNTER 9 .Os .Sh NAME @@ -49,8 +49,14 @@ .Fn counter_u64_fetch "counter_u64_t c" .Ft void .Fn counter_u64_zero "counter_u64_t c" +.Ft struct counter_rate * +.Fn counter_rate_alloc "int flags" "int period" .Ft int64_t .Fn counter_ratecheck "struct counter_rate *cr" "int64_t limit" +.Ft uint64_t +.Fn counter_rate_get "struct counter_rate *cr" +.Ft void +.Fn counter_rate_free "struct counter_rate *cr" .Fn COUNTER_U64_SYSINIT "counter_u64_t c" .Fn COUNTER_U64_DEFINE_EARLY "counter_u64_t c" .In sys/sysctl.h @@ -133,6 +139,13 @@ value for any moment. Clear the counter .Fa c and set it to zero. +.It Fn counter_rate_alloc flags period +Allocate a new struct counter_rate. +.Fa flags +is passed to +.Xr malloc 9 . +.Fa period +is the time over which the rate is checked. .It Fn counter_ratecheck cr limit The function is a multiprocessor-friendly version of .Fn ppsratecheck @@ -140,11 +153,17 @@ which uses .Nm internally. Returns non-negative value if the rate is not yet reached during the current -second, and a negative value otherwise. -If the limit was reached on previous second, but was just reset back to zero, -then +period, and a negative value otherwise. +If the limit was reached during the previous period, but was just reset back +to zero, then .Fn counter_ratecheck returns number of events since previous reset. +.It Fn counter_rate_get cr +The number of hits to this check within the current period. +.It Fn counter_rate_free cr +Free the +.Fa cr +counter. .It Fn COUNTER_U64_SYSINIT c Define a .Xr SYSINIT 9 diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9 index 20485059a4c8..0ca04f921f82 100644 --- a/share/man/man9/cpuset.9 +++ b/share/man/man9/cpuset.9 @@ -22,7 +22,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 23, 2022 +.Dd August 7, 2025 .Dt CPUSET 9 .Os .Sh NAME @@ -50,8 +50,10 @@ .Nm CPU_ANDNOT , .Nm CPU_XOR , .Nm CPU_CLR_ATOMIC , +.Nm CPU_TEST_CLR_ATOMIC , .Nm CPU_SET_ATOMIC , .Nm CPU_SET_ATOMIC_ACQ , +.Nm CPU_TEST_SET_ATOMIC , .Nm CPU_AND_ATOMIC , .Nm CPU_OR_ATOMIC , .Nm CPU_COPY_STORE_REL @@ -93,8 +95,10 @@ .Fn CPU_XOR "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2" .\" .Fn CPU_CLR_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_TEST_CLR_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" .Fn CPU_SET_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" .Fn CPU_SET_ATOMIC_ACQ "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_TEST_SET_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" .\" .Fn CPU_AND_ATOMIC "cpuset_t *dst" "cpuset_t *src" .Fn CPU_OR_ATOMIC "cpuset_t *dst" "cpuset_t *src" @@ -143,6 +147,10 @@ The .Fn CPU_CLR_ATOMIC macro is identical, but the bit representing the CPU is cleared with atomic machine instructions. +The +.Fn CPU_TEST_CLR_ATOMIC +macro atomically clears the bit representing the CPU and returns whether it +was set. .Pp The .Fn CPU_COPY @@ -176,6 +184,10 @@ machine instructions. The .Fn CPU_SET_ATOMIC_ACQ macro sets the bit representing the CPU with atomic acquire semantics. +The +.Fn CPU_TEST_SET_ATOMIC +macro atomically sets the bit representing the CPU and returns whether it was +set. .Pp The .Fn CPU_ISSET diff --git a/share/man/man9/domainset.9 b/share/man/man9/domainset.9 index 816ce29f04f7..702c9f83a88b 100644 --- a/share/man/man9/domainset.9 +++ b/share/man/man9/domainset.9 @@ -22,7 +22,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 14, 2021 +.Dd June 24, 2025 .Dt DOMAINSET 9 .Os .Sh NAME @@ -54,6 +54,8 @@ struct domainset { .Ft struct domainset * .Fn domainset_create "const struct domainset *key" .Ft int +.Fn domainset_populate "struct domainset *domain" "domainset_t *mask" "int policy" "size_t mask_size" +.Ft int .Fn sysctl_handle_domainset "SYSCTL_HANDLER_ARGS" .Sh DESCRIPTION The @@ -137,6 +139,7 @@ These policies should be used in preference to to avoid blocking indefinitely on a .Dv M_WAITOK request. +.Pp The .Fn domainset_create function takes a partially filled in domainset as a key and returns a @@ -148,6 +151,17 @@ is an immutable type that is shared among all matching keys and must not be modified after return. .Pp The +.Fn domainset_populate +function fills a +.Vt domainset +struct using a domain mask and policy. +It is used for validating and +translating a domain mask and policy into a +.Vt domainset +struct when creating a custom domainset using +.Vt domainset_create . +.Pp +The .Fn sysctl_handle_domainset function is provided as a convenience for modifying or viewing domainsets that are not accessible via diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9 index f324861248d2..43f965a20fb7 100644 --- a/share/man/man9/firmware.9 +++ b/share/man/man9/firmware.9 @@ -201,7 +201,7 @@ whether compiled in, or preloaded by or manually loaded with .Xr kldload 8 . However, a system can implement additional mechanisms to bring -these images in memory before calling +these images into memory before calling .Fn firmware_register . .Pp When @@ -347,7 +347,7 @@ If .Fa imagename matches the trailing subpath of a registered image with a full path, that image is returned. .It -he kernel linker searches for a kernel module named +The kernel linker searches for a kernel module named .Fa imagename . If a kernel module is found, it is loaded, and the list of registered firmware images is searched again. diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index 0262c598ed18..e4f30962ccab 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 28, 2023 +.Dd August 1, 2025 .Dt MBUF 9 .Os .\" @@ -1091,7 +1091,7 @@ network code, when data must be encrypted or otherwise altered prior to transmission. .El .Sh HARDWARE-ASSISTED CHECKSUM CALCULATION -This section currently applies to TCP/IP only. +This section currently applies to SCTP, TCP, and UDP over IP only. In order to save the host CPU resources, computing checksums is offloaded to the network interface hardware if possible. The @@ -1102,8 +1102,7 @@ of a packet contains two fields used for that purpose, .Vt int Va csum_flags and .Vt int Va csum_data . -The meaning of those fields depends on the direction a packet flows in, -and on whether the packet is fragmented. +The meaning of those fields depends on whether the packet is fragmented. Henceforth, .Va csum_flags or @@ -1117,14 +1116,14 @@ in the .Vt mbuf chain containing the packet. .Pp -On output, checksum offloading is attempted after the outgoing -interface has been determined for a packet. +When a packet is sent by SCTP, TCP, or UDP, the computation of the checksum +is delayed until the outgoing interface has been determined for a packet. The interface-specific field .Va ifnet.if_data.ifi_hwassist (see .Xr ifnet 9 ) -is consulted for the capabilities of the interface to assist in -computing checksums. +is consulted by IP for the capabilities of the network interface selected for +output to assist in computing checksums. The .Va csum_flags field of the packet header is set to indicate which actions the interface @@ -1135,12 +1134,15 @@ such actions will never be requested through .Va csum_flags . .Pp The flags demanding a particular action from an interface are as follows: -.Bl -tag -width ".Dv CSUM_TCP" -offset indent +.Bl -tag -width ".Dv CSUM_SCTP" -offset indent .It Dv CSUM_IP The IP header checksum is to be computed and stored in the corresponding field of the packet. The hardware is expected to know the format of an IP header to determine the offset of the IP checksum field. +.It Dv CSUM_SCTP +The SCTP checksum is to be computed. +(See below.) .It Dv CSUM_TCP The TCP checksum is to be computed. (See below.) @@ -1149,17 +1151,19 @@ The UDP checksum is to be computed. (See below.) .El .Pp -Should a TCP or UDP checksum be offloaded to the hardware, +Should a SCTP, TCP, or UDP checksum be offloaded to the hardware, the field .Va csum_data will contain the byte offset of the checksum field relative to the end of the IP header. -In this case, the checksum field will be initially -set by the TCP/IP module to the checksum of the pseudo header +In the case of TCP or UDP, the checksum field will be initially +set by the TCP or UDP implementation to the checksum of the pseudo header defined by the TCP and UDP specifications. +In the case of SCTP, the checksum field will be initially +set by the SCTP implementation to 0. .Pp -On input, an interface indicates the actions it has performed -on a packet by setting one or more of the following flags in +When a packet is received by an interface, it indicates the actions it has +performed on a packet by setting one or more of the following flags in .Va csum_flags associated with the packet: .Bl -tag -width ".Dv CSUM_IP_CHECKED" -offset indent @@ -1187,13 +1191,13 @@ to obtain the final checksum to be used for TCP or UDP validation purposes. .El .Pp If a particular network interface just indicates success or -failure of TCP or UDP checksum validation without returning +failure of SCTP, TCP, or UDP checksum validation without returning the exact value of the checksum to the host CPU, its driver can mark .Dv CSUM_DATA_VALID -and -.Dv CSUM_PSEUDO_HDR in -.Va csum_flags , +.Va csum_flags +as well as, for TCP and UDP, +.Dv CSUM_PSEUDO_HDR and set .Va csum_data to @@ -1203,6 +1207,28 @@ It is a peculiarity of the algorithm used that the Internet checksum calculated over any valid packet will be .Li 0xFFFF as long as the original checksum field is included. +Note that for SCTP the value of +.Va csum_data +is not relevant and +.Dv CSUM_PSEUDO_HDR +in +.Va csum_flags +is not set, since SCTP does not use a pseudo header checksum. +.Pp +If IP delivers a packet with the flags +.Dv CSUM_SCTP , +.Dv CSUM_TCP , +or +.Dv CSUM_UDP +set in +.Va csum_flags +to a local SCTP, TCP, or UDP stack, the packet will be processed without +computing or validating the checksum, since the packet has not been on the +wire. +This can happen if the packet was handled by a virtual interface such as +.Xr tap 4 +or +.Xr epair 4 . .Sh STRESS TESTING When running a kernel compiled with the option .Dv MBUF_STRESS_TEST , diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9 index 8f772e76ba99..eeb62a63a2bd 100644 --- a/share/man/man9/pci.9 +++ b/share/man/man9/pci.9 @@ -664,10 +664,14 @@ Buses in this state can cause devices to lose some context. Devices .Em must be prepared for the bus to be in this state or higher. -.It Dv PCI_POWERSTATE_D3 +.It Dv PCI_POWERSTATE_D3_HOT State in which the device is off and not running. Device context is lost, and power from the device can -be removed. +be (but is not necessarily) removed. +.It Dv PCI_POWERSTATE_D3_COLD +Same as +.Dv PCI_POWERSTATE_D3_HOT , +except power has been removed from the device. .It Dv PCI_POWERSTATE_UNKNOWN State of the device is unknown. .El diff --git a/share/man/man9/pci_iov_schema.9 b/share/man/man9/pci_iov_schema.9 index 764d357fbaee..99589b59fb91 100644 --- a/share/man/man9/pci_iov_schema.9 +++ b/share/man/man9/pci_iov_schema.9 @@ -38,7 +38,7 @@ .Nm pci_iov_schema_add_unicast_mac .Nd PCI SR-IOV config schema interface .Sh SYNOPSIS -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In sys/iov_schema.h .Ft nvlist_t * diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 5542a9685c46..26c7a3b2aa64 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 18, 2025 +.Dd July 28, 2025 .Dt STYLE 9 .Os .Sh NAME @@ -917,6 +917,161 @@ Only use the annotation for the entire if statement, rather than individual clauses. Do not add these annotations without empirical evidence of the likelihood of the branch. +.Ss C++ +KNF style was originally defined as a style for C. +C++ introduces several new idioms which do not have an existing corollary +in KNF C such as inline function definitions in classes. +C++ is also not always compatible with some KNF guidelines such as +enclosing return values in parentheses. +For C++ code, FreeBSD aims to follow broadly accepted C++ practices while +also following the general shape of KNF. +This section enumerates C++ specific guidelines that differ from KNF C. +.Pp +The preferred suffixes for C++ source files are +.Dq .cc +and +.Dq .hh . +Header files should always use a suffix, +unlike headers from the C++ standard library. +.Pp +Return values should not be enclosed in parentheses. +When converting existing C code to C++, +existing return values may remain in parentheses. +.Pp +The opening curly brace for namespace declarations should be on the first line +similar to structure and class definitions. +Nested namespaces should be declared using a single namespace declaration. +.Bd -literal +namespace foo::bar { +} +.Ed +.Pp +Member function declarations should follow the same style used for standalone +function protoypes except that a space should be used between a function's +return type and name. +.Pp +Function definitions at the top level should use a newline after the function +type similar to C function definitions. +.Pp +Nested member function definitions inside of a class, structure, or union +should not use a newline after the function type. +Instead, these should follow the style of member function declarations. +This is more common C++ style and is more compact for small methods such as +getters and setters. +.Pp +Inline functions whose body consists of a single statement may use a single +line for the function body. +Inline functions with an empty body should always use a single line. +.Bd -literal +struct widget { + int foo() { return 4; } + int bar(); +}; + +int +widget::bar() +{ + return 6; +} +.Ed +.Pp +Default and deleted methods should be declared as a single line. +.Bd -literal +class box { + ~box() = default; +}; +.Ed +.Pp +In template declarations, the +.Ic template +keyword and list of template parameters should be followed by a newline +before the templated declaration. +.Bd -literal +template <typename T> +class box { + T data; +}; +.Ed +.Pp +The +.Ic & +for reference variables should be placed on the variable name rather +than the type similar to the style used with +.Ic * +for pointers. +.Bd -literal + int x; + int &xp = x; +.Ed +.Pp +Variables may be declared at any point within a function, +not just at the start of blocks. +.Pp +Standard library containers should be used in preference to +.Xr queue 3 +or +.Xr tree 3 +macros. +.Pp +.Ic nullptr +should be used instead of +.Dv NULL +or 0. +.Pp +Use standard library types for managing strings such as +.Vt std::string +and +.Vt std::string_view +rather than +.Vt "char *" +and +.Vt "const char *" . +C types may be used when interfacing with C code. +.Pp +The +.Ic auto +keyword can be used in various contexts which improve readability. +Examples include iterators, non-trivial types of ranged-for values, +and return values of obvious types, +such as +.Ic static_cast +or +.Fn std::make_unique . +Place any qualifiers before +.Ic auto , +for example: +.Ic const auto . +.Pp +Use the +.Vt std::unique_ptr +and +.Vt std::shared_ptr +smart pointers to manage the lifetime of dynamically allocated objects +instead of +.Ic new +and +.Ic delete . +Construct smart pointers with +.Fn std::make_unique +or +.Fn std::make_shared . +Do not use +.Xr malloc 3 +except when necessary to interface with C code. +.Pp +Do not import any namespaces with +.Ic using +at global scope in header files. +Namespaces other than the +.Ic std +namespace (for example, +.Ic std::literals ) +may be imported in source files and in function scope in header files. +.Pp +Define type aliases using +.Ic using +instead of +.Ic typedef . .Sh FILES .Bl -tag -width indent .It Pa /usr/src/tools/build/checkstyle9.pl diff --git a/share/man/man9/ucred.9 b/share/man/man9/ucred.9 index e9fe2e1d02fc..38759bddb5b0 100644 --- a/share/man/man9/ucred.9 +++ b/share/man/man9/ucred.9 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd January 23, 2019 +.Dd July 29, 2025 .Dt UCRED 9 .Os .Sh NAME @@ -54,6 +54,9 @@ .Ft void .Fn crsetgroups "struct ucred *cr" "int ngrp" "gid_t *groups" .Ft void +.Fn crsetgroups_and_egid "struct ucred *cr" "int ngrp" "gid_t *groups" \ + "gid_t default_egid" +.Ft void .Fn cru2x "struct ucred *cr" "struct xucred *xcr" .Sh DESCRIPTION The @@ -110,17 +113,28 @@ The actual copying is performed by .Pp The .Fn crsetgroups -function sets the +and +.Fn crsetgroups_and_egid +functions set the .Va cr_groups and .Va cr_ngroups variables and allocates space as needed. -It also truncates the group list to the current maximum number of +They also truncate the group list to the current maximum number of groups. No other mechanism should be used to modify the .Va cr_groups -array except for updating the primary group via assignment to -.Va cr_groups[0] . +array. +Note that +.Fn crsetgroups_and_egid +will interpret the first element of +.Va groups +as the new effective GID and the rest of the array as the supplementary groups, +and +.Va default_egid +will be used as the new effective GID only if +.Va groups +is empty. .Pp The .Fn cru2x diff --git a/share/man/man9/vm_map.9 b/share/man/man9/vm_map.9 index 9f41a24541b1..d08d54bd1004 100644 --- a/share/man/man9/vm_map.9 +++ b/share/man/man9/vm_map.9 @@ -323,7 +323,6 @@ is backed by a .Xr vm_map_pmap 9 , .Xr vm_map_protect 9 , .Xr vm_map_remove 9 , -.Xr vm_map_simplify_entry 9 , .Xr vm_map_stack 9 , .Xr vm_map_submap 9 , .Xr vm_map_sync 9 , diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 5dd087725e92..d17492668298 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 9, 2024 +.Dd July 15, 2025 .Dt VNODE 9 .Os .Sh NAME @@ -113,7 +113,7 @@ The function declarations and definitions are generated from .Pa sys/kern/vnode_if.src by the -.Pa sys/tools/vndoe_if.awk +.Pa sys/tools/vnode_if.awk script. The interfaces are documented in their respective manual pages like .Xr VOP_READ 9 diff --git a/share/misc/Makefile b/share/misc/Makefile index d92a359ec367..4ddc910c891e 100644 --- a/share/misc/Makefile +++ b/share/misc/Makefile @@ -2,8 +2,9 @@ .PATH: ${.CURDIR}/../../sys/dev/usb +FILESGROUPS= FILES FILES= ascii birthtoken bsd-family-tree committers-doc.dot committers-ports.dot \ - committers-src.dot flowers init.ee \ + committers-src.dot flowers \ iso3166 iso639 latin1 mdoc.template operator pci_vendors \ scsi_modes usb_vendors \ organization.dot @@ -15,4 +16,11 @@ FILES+= usb_hid_usages FILES+= usbdevs .endif +.if ${MK_EE} != "no" +FILESGROUPS+= EE +EE= init.ee +EEDIR= ${FILESDIR} +EEPACKAGE= ee +.endif + .include <bsd.prog.mk> diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 2c55e542f5e8..3f13f72de17e 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -471,12 +471,15 @@ FreeBSD 5.2 | | | | | | 13.4 | | | OpenBSD 7.6 | | FreeBSD | | | | | | | 14.2 | | | | | | - | | | | NetBSD | | - | | | | 10.1 | | - | FreeBSD | | | | - | 13.5 | | | | - | | | OpenBSD 7.7 | - | | | | DragonFly 6.4.1 + | | | | | NetBSD | | + | | | | | 10.1 | | + | | FreeBSD | | | | + | | 13.5 | | | | + | | | | OpenBSD 7.7 | + | | | | | DragonFly 6.4.1 + | | | | | DragonFly 6.4.2 + | FreeBSD | | | | + | 14.3 | | | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -920,6 +923,8 @@ NetBSD 10.1 2024-12-16 [NBD] FreeBSD 13.5 2025-03-11 [FBD] OpenBSD 7.7 2025-04-28 [OBD] DragonFly 6.4.1 2025-04-30 [DFB] +DragonFly 6.4.2 2025-05-09 [DFB] +FreeBSD 14.3 2025-06-10 [FBD] Bibliography ------------------------ @@ -975,6 +980,15 @@ URL: https://web.archive.org/web/20090427195917/http://ezine.daemonnews.org/2001 ("what are the differences between FreeBSD, NetBSD, and OpenBSD?") +End-of-Life (EOL) +----------------- +The FreeBSD family tree shows when a release was published. +If you would like to know when the support ends, just look at +https://www.freebsd.org/security/#sup and +https://www.freebsd.org/security/unsupported +For other operating systems, see https://endoflife.date + + Acknowledgments --------------- @@ -984,5 +998,5 @@ original BSD announcements from Usenet or tapes. Steven M. Schultz for providing 2.8BSD, 2.10BSD, 2.11BSD manual pages. -- -Copyright (c) 1997-2024 Wolfram Schneider <wosch@FreeBSD.org> +Copyright (c) 1997-2025 Wolfram Schneider <wosch@FreeBSD.org> URL: https://cgit.freebsd.org/src/tree/share/misc/bsd-family-tree diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index 7bb3d936e5e5..fb6c168f1425 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -153,6 +153,7 @@ ak [label="Alex Kozlov\nak@FreeBSD.org\n2012/02/29"] ale [label="Alex Dupre\nale@FreeBSD.org\n2004/01/12"] alepulver [label="Alejandro Pulver\nalepulver@FreeBSD.org\n2006/04/01"] alexey [label="Alexey Degtyarev\nalexey@FreeBSD.org\n2013/11/09"] +alven [label="Älven\nalven@FreeBSD.org\n2025/07/28"] amdmi3 [label="Dmitry Marakasov\namdmi3@FreeBSD.org\n2008/06/19"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2013/04/03"] arrowd [label="Gleb Popov\narrowd@FreeBSD.org\n2018/05/18"] @@ -420,6 +421,7 @@ culot -> marino culot -> pi culot -> wg +db -> alven db -> tj db -> shurd @@ -865,6 +867,7 @@ wxs -> zi ygy -> yasu +yuri -> alven yuri -> rea zirias -> jbo diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index e8719a44fae7..73d142b875f2 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -51,6 +51,7 @@ eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2004/05/20\n2008/11/10"] furuta [label="Atsushi Furuta\nfuruta@FreeBSD.org\n2000/06/21\n2003/03/08"] gj [label="Gary L. Jennejohn\ngj@FreeBSD.org\n1994/??/??\n2006/04/28"] groudier [label="Gerard Roudier\ngroudier@FreeBSD.org\n1999/12/30\n2006/04/06"] +hselasky [label="Hans Petter Selasky\nhselasky@FreeBSD.org\n2023/06/23"] jake [label="Jake Burkholder\njake@FreeBSD.org\n2000/05/16\n2008/11/10"] jayanth [label="Jayanth Vijayaraghavan\njayanth@FreeBSD.org\n2000/05/08\n2008/11/10"] jb [label="John Birrell\njb@FreeBSD.org\n1997/03/27\n2009/12/15"] @@ -60,6 +61,7 @@ jkh [label="Jordan K. Hubbard\njkh@FreeBSD.org\n1993/06/12\n2008/06/13"] jlemon [label="Jonathan Lemon\njlemon@FreeBSD.org\n1997/08/14\n2008/11/10"] joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22\n2008/08/10"] jtc [label="J.T. Conklin\njtc@FreeBSD.org\n1993/06/12\n????/??/??"] +karels [label="Mike Karels\nkarels@FreeBSD.org\n2016/06/09\n2024/06/02"] kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17\n2015/06/28"] kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] @@ -114,6 +116,7 @@ andre [label="Andre Oppermann\nandre@FreeBSD.org\n2003/11/12"] andreast [label="Andreas Tobler\nandreast@FreeBSD.org\n2010/09/05"] andrew [label="Andrew Turner\nandrew@FreeBSD.org\n2010/07/19"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] +aokblast [label="ShengYi Hung\naokblast@FreeBSD.org\n2025/07/02"] araujo [label="Marcelo Araujo\naraujo@FreeBSD.org\n2015/08/04"] arichardson [label="Alex Richardson\narichardson@FreeBSD.org\n2017/10/30"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] @@ -202,7 +205,6 @@ gshapiro [label="Gregory Shapiro\ngshapiro@FreeBSD.org\n2000/07/12"] harti [label="Hartmut Brandt\nharti@FreeBSD.org\n2003/01/29"] hiren [label="Hiren Panchasara\nhiren@FreeBSD.org\n2013/04/12"] hmp [label="Hiten Pandya\nhmp@FreeBSD.org\n2004/03/23"] -hselasky [label="Hans Petter Selasky\nhselasky@FreeBSD.org\n"] ian [label="Ian Lepore\nian@FreeBSD.org\n2013/01/07"] iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] igoro [label="Igor Ostapenko\nigoro@FreeBSD.org\n2024/08/22"] @@ -244,7 +246,6 @@ jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kaktus [label="Pawel Biernacki\nkaktus@FreeBSD.org\n2019/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] -karels [label="Mike Karels\nkarels@FreeBSD.org\n2016/06/09"] kbowling [label="Kevin Bowling\nkbowling@FreeBSD.org\n2024/10/15"] kd [label="Kornel Dulęba\nkd@FreeBSD.org\n2022/06/22"] ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] @@ -298,6 +299,7 @@ nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] n_hibma [label="Nick Hibma\nn_hibma@FreeBSD.org\n1998/11/26"] +obiwac [label="Aymeric Wibo\nobiwac@FreeBSD.org\n2025/07/15"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] oh [label="Oskar Holmlund\noh@FreeBSD.org\n2021/04/21"] olce [label="Olivier Certner\nolce@FreeBSD.org\n2023/12/01"] @@ -384,6 +386,7 @@ uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2010/01/28"] vangyzen [label="Eric van Gyzen\nvangyzen@FreeBSD.org\n2015/03/08"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] +vexeduxr [label="Ahmad Khalifa\nvexeduxr@FreeBSD.org\n2025/06/13"] vmaffione [label="Vincenzo Maffione\nvmaffione@FreeBSD.org\n2018/03/19"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] @@ -638,6 +641,7 @@ imp -> takawata imp -> toshi imp -> tsoome imp -> uch +imp -> vexeduxr jake -> bms jake -> gordon @@ -708,6 +712,8 @@ joerg -> schweikh jtl -> ngie jtl -> thj +jrm -> obiwac + julian -> glebius julian -> davidxu julian -> archie @@ -762,6 +768,7 @@ kp -> nick kp -> rcm kp -> zlei +lwhsu -> aokblast lwhsu -> khng manu -> corvink @@ -775,6 +782,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> "0mp" +markj -> aokblast markj -> bnovkov markj -> cem markj -> christos @@ -794,6 +802,8 @@ mav -> eugen mav -> freqlabs mav -> ram +mckusick -> obiwac + mdf -> gleb mdodd -> jake diff --git a/share/misc/organization.dot b/share/misc/organization.dot index 1a88bc71b14e..73e879578dd7 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -30,7 +30,7 @@ doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nbcr, gabor, gjb, hrs,\nblackend, ryusuke, wblock"] pkgmgr [label="Package Management Team\npkgmgr@FreeBSD.org\nantoine, bdrewery"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nbapt, bofh, mat,\npizzamig, rene, tcberner"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nbapt, dvl, mat,\npizzamig, rene, tcberner"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nblackend, delphij, cperciva"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, markj,\nemaste,\ngjb, gordon,\noshogbo, philip"] diff --git a/share/mk/Makefile b/share/mk/Makefile index 837f7da68b4b..0e786b381fe2 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -10,6 +10,7 @@ UPDATE_DEPENDFILE= no .include <src.opts.mk> +PACKAGE= bmake FILES= \ auto.obj.mk \ bsd.README \ @@ -21,6 +22,7 @@ FILES= \ bsd.confs.mk \ bsd.cpu.mk \ bsd.crunchgen.mk \ + bsd.debug.mk \ bsd.dep.mk \ bsd.dirs.mk \ bsd.doc.mk \ diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 4820bf12c72d..89ee8527895e 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -20,6 +20,7 @@ bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.crunchgen.mk - building crunched binaries using crunchgen(1) +bsd.debug.mk - handling debug options for bsd.{prog,lib}.mk bsd.dep.mk - handle Makefile dependencies bsd.dirs.mk - handle directory creation bsd.doc.mk - building troff system documents diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index 6fa732fd730b..bad68d1ebd8e 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -74,6 +74,7 @@ LIB32WMAKEFLAGS= \ LIB32WMAKEFLAGS+= NM="${XNM}" LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}" +LIB32WMAKEFLAGS+= STRIPBIN="${XSTRIPBIN}" LIB32DTRACE= ${DTRACE} -32 LIB32_MACHINE_ABI= ${MACHINE_ABI:N*64} long32 ptr32 diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 2babccf91df1..a877b18d3b9a 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -66,9 +66,10 @@ CCACHE_BUILD_TYPE?= command # PATH since it is more clear that ccache is used and avoids wasting time # for mkdep/linking/asm builds. LOCALBASE?= /usr/local +CCACHE_NAME?= ccache CCACHE_PKG_PREFIX?= ${LOCALBASE} CCACHE_WRAPPER_PATH?= ${CCACHE_PKG_PREFIX}/libexec/ccache -CCACHE_BIN?= ${CCACHE_PKG_PREFIX}/bin/ccache +CCACHE_BIN?= ${CCACHE_PKG_PREFIX}/bin/${CCACHE_NAME} .if exists(${CCACHE_BIN}) # Export to ensure sub-makes can filter it out for mkdep/linking and # to chain down into kernel build which won't include this file. @@ -122,7 +123,12 @@ CCACHE_NOCPP2= 1 .endif # Canonicalize CCACHE_DIR for meta mode usage. .if !defined(CCACHE_DIR) +.if !empty(CCACHE_BIN:M*sccache) +# Get the temp directory and remove beginning and trailing \" +CCACHE_DIR!= ${CCACHE_BIN} -s | awk '$$2 == "location" && $$3 == "Local" {print substr($$5, 2, length($$5) - 2)}' +.else CCACHE_DIR!= ${CCACHE_BIN} -p | awk '$$2 == "cache_dir" {print $$4}' +.endif .export CCACHE_DIR .endif .if !empty(CCACHE_DIR) && empty(.MAKE.META.IGNORE_PATHS:M${CCACHE_DIR}) @@ -134,7 +140,11 @@ CCACHE_DIR:= ${CCACHE_DIR:tA} # comparisons. .MAKE.META.IGNORE_PATHS+= ${CCACHE_BIN} ccache-print-options: .PHONY +.if !empty(CCACHE_BIN:M*sccache) + @${CCACHE_BIN} -s +.else @${CCACHE_BIN} -p +.endif # !empty(CCACHE_BIN:M*sccache) .endif # exists(${CCACHE_BIN}) .endif # ${MK_CCACHE_BUILD} == "yes" diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index ea702cece28d..77b573c7e42c 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -49,7 +49,7 @@ ${group}TAGS+= package=${PACKAGE:Uutilities} . endif . endif ${group}TAGS+= config -${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g} +${group}TAG_ARGS= -T ${${group}TAGS:ts,:[*]} . endif diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk new file mode 100644 index 000000000000..cf2fb4356aef --- /dev/null +++ b/share/mk/bsd.debug.mk @@ -0,0 +1,68 @@ +# +# This file configures debug options for compiled targets. It is meant +# to consolidate common logic in bsd.prog.mk and bsd.lib.mk. It should +# not be included directly by Makefiles. +# + +.include <bsd.opts.mk> + +.if ${MK_ASSERT_DEBUG} == "no" +CFLAGS+= -DNDEBUG +# XXX: shouldn't we ensure that !asserts marks potentially unused variables as +# __unused instead of disabling -Werror globally? +MK_WERROR= no +.endif + +# If reproducible build mode is enabled, map the root of the source +# directory to /usr/src and the root of the object directory to +# /usr/obj. +.if ${MK_REPRODUCIBLE_BUILD} != "no" && !defined(DEBUG_PREFIX) +.if defined(SRCTOP) +DEBUG_PREFIX+= ${SRCTOP:S,/$,,}=/usr/src +.endif +.if defined(OBJROOT) +# Strip off compat subdirectories, e.g., /usr/obj/usr/src/amd64.amd64/obj-lib32 +# becomes /usr/obj/usr/src/amd64.amd64, since object files compiled there might +# refer to something outside the root. +DEBUG_PREFIX+= ${OBJROOT:S,/$,,:C,/obj-[^/]*$,,}=/usr/obj +.endif +.endif + +.if defined(DEBUG_PREFIX) +.for map in ${DEBUG_PREFIX} +CFLAGS+= -ffile-prefix-map=${map} +CXXFLAGS+= -ffile-prefix-map=${map} +.endfor +.endif + +.if defined(DEBUG_FLAGS) +CFLAGS+=${DEBUG_FLAGS} +CXXFLAGS+=${DEBUG_FLAGS} + +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +CTFFLAGS+= -g +.endif +.else +STRIP?= -s +.endif + +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf*) +.if !${COMPILER_FEATURES:Mcompressed-debug} +CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +.else +CFLAGS+= ${DEBUG_FILES_CFLAGS} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS} +.endif +CTFFLAGS+= -g +.endif + +_debuginstall: +.if ${MK_DEBUG_FILES} != "no" && defined(DEBUGFILE) +.if defined(DEBUGMKDIR) + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ +.endif + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \ + ${DEBUGFILE} ${DESTDIR}${DEBUGFILEDIR}/${DEBUGFILE} +.endif diff --git a/share/mk/bsd.dirs.mk b/share/mk/bsd.dirs.mk index 317ff61cd604..1f81bda80eab 100644 --- a/share/mk/bsd.dirs.mk +++ b/share/mk/bsd.dirs.mk @@ -22,7 +22,7 @@ ${dir}_FLAG= -f ${${dir}_FLAGS} . if !defined(${dir}TAGS) || ! ${${dir}TAGS:Mpackage=*} ${dir}TAGS+= package=${${dir}PACKAGE:Uutilities} . endif -${dir}TAG_ARGS= -T ${${dir}TAGS:[*]:S/ /,/g} +${dir}TAG_ARGS= -T ${${dir}TAGS:ts,:[*]} . endif installdirs: installdirs-${dir} diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk index ea8c68e87d50..675639db7611 100644 --- a/share/mk/bsd.doc.mk +++ b/share/mk/bsd.doc.mk @@ -82,7 +82,7 @@ TRFLAGS+= -t .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE:Uutilities} .endif -TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} +TAG_ARGS= -T ${TAGS:ts,:[*]} .endif DCOMPRESS_EXT?= ${COMPRESS_EXT} diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk index ba662ffc7439..24da57954b5a 100644 --- a/share/mk/bsd.endian.mk +++ b/share/mk/bsd.endian.mk @@ -20,10 +20,17 @@ LOCALEDEF_ENDIAN= -b # # During bootstrapping on !FreeBSD OSes, we need to define some value. Short of # having an exhaustive list for all variants of Linux and MacOS we simply do not -# set TARGET_ENDIANNESS and poison the other variables. They should be unused -# during the bootstrap phases (apart from one place that's adequately protected -# in bsd.compiler.mk) where we're building the bootstrap tools. +# set TARGET_ENDIANNESS (on Linux) and poison the other variables. They should +# be unused during the bootstrap phases (apart from one place that's adequately +# protected in bsd.compiler.mk) where we're building the bootstrap tools. # +.if ${.MAKE.OS} == "Darwin" +# We do assume the endianness on macOS because Apple's modern hardware is all +# little-endian. This might need revisited in the far future, but for the time +# being Apple Silicon's reign of terror continues. We only set this one up +# because libcrypto is now built in bootstrap. +TARGET_ENDIANNESS= 1234 +.endif CAP_MKDB_ENDIAN= -B # Poisoned value, invalid flags for both cap_mkdb LOCALEDEF_ENDIAN= -B # and localedef. .endif diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index aedc414d6a28..3ec4da010577 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -39,14 +39,14 @@ STAGE_SETS+= ${group:C,[/*],_,g} .if ${group} == "FILES" FILESPACKAGE?= ${PACKAGE:Uutilities} -FILESTAGS+= ${TAGS} +FILESTAGS+= ${TAGS:Npackage=*} .endif .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} -${group}TAGS+= package=${${group}PACKAGE:Uutilities} +${group}TAGS+= package=${${group}PACKAGE:U${PACKAGE:Uutilities}} .endif -${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g} +${group}TAG_ARGS= -T ${${group}TAGS:ts,:[*]} .endif diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index df4cf4641141..848ee0aa2ea9 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -37,7 +37,7 @@ ${group}TAGS+= package=${${group}PACKAGE:Uutilities},dev ${group}TAGS+= package=${PACKAGE:Uutilities},dev .endif .endif -${group}TAG_ARGS= -T ${${group}TAGS:[*]:S/ /,/g} +${group}TAG_ARGS= -T ${${group}TAGS:ts,:[*]} .endif _${group}INCS= diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 01dd979af155..6caad8956c14 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,3 @@ - .include <bsd.init.mk> .include <bsd.compiler.mk> .include <bsd.linker.mk> @@ -45,23 +44,6 @@ SONAME?= ${SHLIB_NAME} CFLAGS+= ${CRUNCH_CFLAGS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+= ${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.else -STRIP?= -s -.endif - .for _libcompat in ${_ALL_libcompats} .if ${SHLIBDIR:M*/lib${_libcompat}} || ${SHLIBDIR:M*/lib${_libcompat}/*} TAGS+= lib${_libcompat} @@ -70,11 +52,31 @@ TAGS+= lib${_libcompat} .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} -TAGS+= package=${PACKAGE:Uutilities} +TAGS+= package=${PACKAGE:Uutilities} .endif -TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} + +# By default, if PACKAGE=foo, then the native runtime libraries will go into +# the FreeBSD-foo package, and subpackages will be created for -dev, -lib32, +# and so on. If LIB_PACKAGE is set, then we also create a subpackage for +# runtime libraries with a -lib suffix. This is used when a package has +# libraries and some other content (e.g., executables) to allow consumers to +# depend on the libraries. +.if defined(LIB_PACKAGE) && ! ${TAGS:Mlib*} +.if !defined(PACKAGE) +.error LIB_PACKAGE cannot be used without PACKAGE +.endif + +LIB_TAG_ARGS= ${TAG_ARGS},lib +.else +LIB_TAG_ARGS= ${TAG_ARGS} .endif +TAG_ARGS= -T ${TAGS:ts,:[*]} + +DBG_TAG_ARGS= ${TAG_ARGS},dbg +DEV_TAG_ARGS= ${TAG_ARGS},dev +.endif # !defined(NO_ROOT) + # ELF hardening knobs .if ${MK_BIND_NOW} != "no" LDFLAGS+= -Wl,-znow @@ -130,18 +132,6 @@ CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} # bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). .sinclude "bsd.sanitizer.mk" -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif - .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax .endif @@ -156,6 +146,7 @@ _SHLIBDIR:=${SHLIBDIR} .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" SHLIB_NAME_FULL=${SHLIB_NAME}.full +DEBUGFILE= ${SHLIB_NAME}.debug # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ @@ -272,16 +263,16 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .endif .if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug -${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ +CLEANFILES+= ${SHLIB_NAME_FULL} ${DEBUGFILE} +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif -${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} +${DEBUGFILE}: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif .endif #defined(SHLIB_NAME) @@ -384,7 +375,7 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}} installpcfiles: installpcfiles-${pcfile} installpcfiles-${pcfile}: ${pcfile} - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} \ ${.ALLSRC} ${DESTDIR}${LIBDATADIR}/pkgconfig/ .endfor @@ -392,49 +383,42 @@ installpcfiles-${pcfile}: ${pcfile} installpcfiles: .PHONY .if !defined(INTERNALLIB) -realinstall: _libinstall installpcfiles -.ORDER: beforeinstall _libinstall +realinstall: _libinstall installpcfiles _debuginstall +.ORDER: beforeinstall _libinstall _debuginstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) - ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${LIB_TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ - ${_INSTALLFLAGS} \ - ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ -.endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} - ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${SHLIB_LINK} \ - ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} + ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ + ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor .else .if ${_SHLIBDIR} == ${_LIBDIR} .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \ ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ + ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .else .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME}) @@ -446,7 +430,7 @@ _libinstall: .endif # SHLIB_LINK .endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif .endif # !defined(INTERNALLIB) @@ -466,7 +450,7 @@ LINKGRP?= ${LIBGRP} LINKMODE?= ${LIBMODE} SYMLINKOWN?= ${LIBOWN} SYMLINKGRP?= ${LIBGRP} -LINKTAGS= dev +LINKTAGS= dev${_COMPAT_TAG} .include <bsd.links.mk> .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY) @@ -501,6 +485,7 @@ SUBDIR_TARGETS+= check TESTS_LD_LIBRARY_PATH+= ${.OBJDIR} .endif +.include <bsd.debug.mk> .include <bsd.dep.mk> .include <bsd.clang-analyze.mk> .include <bsd.obj.mk> diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 4177a1ef0e4e..3ff4c4e90a1b 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -18,6 +18,7 @@ LIBCRT0?= ${LIBDESTDIR}${LIBDIR_BASE}/crt0.o LIB80211?= ${LIBDESTDIR}${LIBDIR_BASE}/lib80211.a LIB9P?= ${LIBDESTDIR}${LIBDIR_BASE}/lib9p.a LIBALIAS?= ${LIBDESTDIR}${LIBDIR_BASE}/libalias.a +LIBAPPUTILS?= ${LIBDESTDIR}${LIBDIR_BASE}/libapputils.a LIBARCHIVE?= ${LIBDESTDIR}${LIBDIR_BASE}/libarchive.a LIBASN1?= ${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a LIBATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libatm.a @@ -70,6 +71,7 @@ LIBGEOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libgeom.a LIBGPIO?= ${LIBDESTDIR}${LIBDIR_BASE}/libgpio.a LIBGSSAPI?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi.a LIBGSSAPI_KRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a +LIBGSSRPC?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssrpc.a LIBHDB?= ${LIBDESTDIR}${LIBDIR_BASE}/libhdb.a LIBHEIMBASE?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimbase.a LIBHEIMNTLM?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimntlm.a @@ -88,11 +90,21 @@ LIBISCSIUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libiscsiutil.a LIBJAIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libjail.a LIBKADM5CLNT?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5clnt.a LIBKADM5SRV?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5srv.a +LIBK5CRYPTO?= ${LIBDESTDIR}${LIBDIR_BASE}/libk5crypto.a +LIBKADMIN_COMMON?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadmin_common.a +LIBKADM5CLNT_MIT?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5clnt_mit.a +LIBKADM5SRV_MIT?= ${LIBDESTDIR}${LIBDIR_BASE}/libkadm5srv_mit.a LIBKAFS5?= ${LIBDESTDIR}${LIBDIR_BASE}/libkafs5.a +LIBKDB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libkdb5.a LIBKDC?= ${LIBDESTDIR}${LIBDIR_BASE}/libkdc.a LIBKEYCAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libkeycap.a LIBKICONV?= ${LIBDESTDIR}${LIBDIR_BASE}/libkiconv.a +LIBKPROP_UTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libkprop_util.a +LIBKRAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrad.a LIBKRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrb5.a +LIBKRB5PROFILE?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrb5profile.a +LIBKRB5SS?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrb5ss.a +LIBKRB5SUPPORT?= ${LIBDESTDIR}${LIBDIR_BASE}/libkrb5support.a LIBKVM?= ${LIBDESTDIR}${LIBDIR_BASE}/libkvm.a LIBL?= ${LIBDESTDIR}${LIBDIR_BASE}/libl.a LIBLN?= "don't use LIBLN, use LIBL" @@ -158,6 +170,7 @@ LIBUSB?= ${LIBDESTDIR}${LIBDIR_BASE}/libusb.a LIBUSBHID?= ${LIBDESTDIR}${LIBDIR_BASE}/libusbhid.a LIBUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libutil.a LIBUUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libuutil.a +LIBVERTO?= ${LIBDESTDIR}${LIBDIR_BASE}/libverto.a LIBVGL?= ${LIBDESTDIR}${LIBDIR_BASE}/libvgl.a LIBVMMAPI?= ${LIBDESTDIR}${LIBDIR_BASE}/libvmmapi.a LIBWIND?= ${LIBDESTDIR}${LIBDIR_BASE}/libwind.a diff --git a/share/mk/bsd.links.mk b/share/mk/bsd.links.mk index 437ffd0d3b34..509520a24a3a 100644 --- a/share/mk/bsd.links.mk +++ b/share/mk/bsd.links.mk @@ -7,7 +7,7 @@ .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE} .endif -TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} +TAG_ARGS= -T ${TAGS:ts,:[*]} .endif afterinstall: _installlinks diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 2845d0c1fc1c..66155d1b4cd9 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -39,6 +39,13 @@ # # MANDOC_CMD command and flags to create preformatted pages # +# MANGROUPS A list of groups, each of which should be a variable containing +# a list of manual pages in that group. By default one group is +# defined called "MAN". +# +# For each group, group-specific options may be set: +# <group>OWN, <group>GRP, <group>MODE and <group>PACKAGE. +# # +++ targets +++ # # maninstall: @@ -49,11 +56,10 @@ .error bsd.man.mk cannot be included directly. .endif -.if ${MK_MANSPLITPKG} == "no" -MINSTALL?= ${INSTALL} ${TAG_ARGS} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} -.else -MINSTALL?= ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},man} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} -.endif +MANGROUPS?= MAN + +# Backwards compatibility. +MINSTALL?= ${MANINSTALL} CATDIR= ${MANDIR:H:S/$/\/cat/} CATEXT= .cat @@ -65,18 +71,55 @@ MCOMPRESS_EXT?= ${COMPRESS_EXT} SECTIONS= 1 2 3 4 5 6 7 8 9 .SUFFIXES: ${SECTIONS:S/^/./g} - # Backwards compatibility. .if !defined(MAN) .for __sect in ${SECTIONS} -.if defined(MAN${__sect}) && !empty(MAN${__sect}) -MAN+= ${MAN${__sect}} -.endif +MANGROUPS+= MAN${__sect} .endfor .endif +# Following the conventions of MANGROUPS, manpage links should be defined +# as ${group}LINKS, which means the default groups' links would be called +# MANLINKS. However it's actually called MLINKS, so for compatibility, +# use ${MLINKS} as the default group's links if it's set. +.if defined(MLINKS) +MANLINKS= ${MLINKS} +.endif + +maninstall: realmaninstall manlinksinstall .PHONY +# Make sure all manpages are installed before we try to link any. +.ORDER: realmaninstall manlinksinstall +realmaninstall: .PHONY +manlinksinstall: .PHONY + all-man: +.for __group in ${MANGROUPS} + +realmaninstall: realmaninstall-${__group} +manlinksinstall: manlinksinstall-${__group} + +${__group}OWN?= ${MANOWN} +${__group}GRP?= ${MANGRP} +${__group}MODE?= ${MANMODE} + +# Tag processing is only done for NO_ROOT installs. +.if defined(NO_ROOT) + +.if !defined(${__group}TAGS) || ! ${${__group}TAGS:Mpackage=*} +.if ${MK_MANSPLITPKG} == "no" +${__group}TAGS+= package=${${__group}PACKAGE:U${PACKAGE:Uutilities}} +.else +${__group}TAGS+= package=${${__group}PACKAGE:U${PACKAGE:Uutilities}}-man +.endif +.endif + +${__group}TAG_ARGS= -T ${${__group}TAGS:ts,:[*]} +.endif # defined(NO_ROOT) + +${__group}INSTALL?= ${INSTALL} ${${__group}TAG_ARGS} \ + -o ${${__group}OWN} -g ${${__group}GRP} -m ${${__group}MODE} + .if ${MK_MANCOMPRESS} == "no" # Make special arrangements to filter to a temporary file at build time @@ -90,37 +133,39 @@ FILTEXTENSION= ZEXT= .if defined(MANFILTER) -.if defined(MAN) && !empty(MAN) -CLEANFILES+= ${MAN:T:S/$/${FILTEXTENSION}/g} -CLEANFILES+= ${MAN:T:S/$/${CATEXT}${FILTEXTENSION}/g} -.for __page in ${MAN} -.for __target in ${__page:T:S/$/${FILTEXTENSION}/g} +.if defined(${__group}) && !empty(${__group}) +CLEANFILES+= ${${__group}:T:S/$/${FILTEXTENSION}/g} +CLEANFILES+= ${${__group}:T:S/$/${CATEXT}${FILTEXTENSION}/g} +.for __page in ${${__group}} +# Escape colons in target names to support manual pages whose +# filenames contain colons. +.for __target in ${__page:T:S/:/\:/g:S/$/${FILTEXTENSION}/g} all-man: ${__target} ${__target}: ${__page} ${MANFILTER} < ${.ALLSRC} > ${.TARGET} .endfor .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) -.for __target in ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} +.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}${FILTEXTENSION}/g} all-man: ${__target} ${__target}: ${__page} ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} > ${.TARGET} .endfor .endif .endfor -.endif # !empty(MAN) +.endif # !empty(${__group}) .else # !defined(MANFILTER) -.if defined(MAN) && !empty(MAN) -CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} +.if defined(${__group}) && !empty(${__group}) +CLEANFILES+= ${${__group}:T:S/$/${CATEXT}/g} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) -.for __page in ${MAN} -.for __target in ${__page:T:S/$/${CATEXT}/g} +.for __page in ${${__group}} +.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}/g} all-man: ${__target} ${__target}: ${__page} ${MANDOC_CMD} ${.ALLSRC} > ${.TARGET} .endfor .endfor .else -all-man: ${MAN} +all-man: ${${__group}} .endif .endif .endif # defined(MANFILTER) @@ -129,11 +174,11 @@ all-man: ${MAN} ZEXT= ${MCOMPRESS_EXT} -.if defined(MAN) && !empty(MAN) -CLEANFILES+= ${MAN:T:S/$/${MCOMPRESS_EXT}/g} -CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} -.for __page in ${MAN} -.for __target in ${__page:T:S/$/${MCOMPRESS_EXT}/} +.if defined(${__group}) && !empty(${__group}) +CLEANFILES+= ${${__group}:T:S/$/${MCOMPRESS_EXT}/g} +CLEANFILES+= ${${__group}:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} +.for __page in ${${__group}} +.for __target in ${__page:T:S/:/\:/g:S/$/${MCOMPRESS_EXT}/} all-man: ${__target} ${__target}: ${__page} .if defined(MANFILTER) @@ -143,7 +188,7 @@ ${__target}: ${__page} .endif .endfor .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) -.for __target in ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/} +.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}${MCOMPRESS_EXT}/} all-man: ${__target} ${__target}: ${__page} .if defined(MANFILTER) @@ -158,8 +203,9 @@ ${__target}: ${__page} .endif # ${MK_MANCOMPRESS} == "no" -.if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS) -.for _oname _osect _dname _dsect in ${MLINKS:C/\.([^.]*)$/.\1 \1/} +_MANLINKS= +.if !defined(NO_MLINKS) && defined(${__group}LINKS) && !empty(${__group}LINKS) +.for _oname _osect _dname _dsect in ${${__group}LINKS:C/\.([^.]*)$/.\1 \1/} _MANLINKS+= ${MANDIR}${_osect}${MANSUBDIR}/${_oname} \ ${MANDIR}${_dsect}${MANSUBDIR}/${_dname} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) @@ -169,37 +215,37 @@ _MANLINKS+= ${CATDIR}${_osect}${MANSUBDIR}/${_oname} \ .endfor .endif -.if defined(MAN) && !empty(MAN) +.if defined(${__group}) && !empty(${__group}) .if ${MK_STAGING_MAN} == "yes" -STAGE_TARGETS+= stage_files -_mansets:= ${MAN:E:O:u:M*[1-9]:@s@man$s@} -STAGE_SETS+= ${_mansets} -.for _page in ${MAN} -stage_files.man${_page:T:E}: ${_page} +STAGE_TARGETS+= stage_files.${__group} +_mansets.${__group}:= ${${__group}:E:O:u:M*[1-9]:@s@man$s@} +STAGE_SETS+= ${_mansets.${__group}} +.for _page in ${${__group}} +stage_files.${__group}.man${_page:T:E}: ${_page} .if target(${_page}${MCOMPRESS_EXT}) -stage_files.man${_page:T:E}: ${_page}${MCOMPRESS_EXT} +stage_files.${__group}.man${_page:T:E}: ${_page}${MCOMPRESS_EXT} .endif -STAGE_DIR.man${_page:T:E}?= ${STAGE_OBJTOP}${MANDIR}${_page:T:E}${MANSUBDIR} +STAGE_DIR.${__group}.man${_page:T:E}?= ${STAGE_OBJTOP}${MANDIR}${_page:T:E}${MANSUBDIR} .endfor -.if !defined(NO_MLINKS) && !empty(MLINKS) -STAGE_SETS+= mlinks -STAGE_TARGETS+= stage_links -STAGE_LINKS.mlinks:= ${MLINKS:M*.[1-9]:@f@${f:S,^,${MANDIR}${f:E}${MANSUBDIR}/,}@} -stage_links.mlinks: ${_mansets:@s@stage_files.$s@} +.if !defined(NO_MLINKS) && !empty(${__group}LINKS) +STAGE_SETS+= mlinks.${__group} +STAGE_TARGETS+= stage_links.${__group} +STAGE_LINKS.mlinks.${__group}:= ${${__group}LINKS:M*.[1-9]:@f@${f:S,^,${MANDIR}${f:E}${MANSUBDIR}/,}@} +stage_links.mlinks.${__group}: ${_mansets.${__group}:@s@stage_files.${__group}.$s@} .endif .endif .endif -maninstall: -.if defined(MAN) && !empty(MAN) -maninstall: ${MAN} +realmaninstall-${__group}: +.if defined(${__group}) && !empty(${__group}) +realmaninstall-${__group}: ${${__group}} .if ${MK_MANCOMPRESS} == "no" .if defined(MANFILTER) -.for __page in ${MAN} - ${MINSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \ +.for __page in ${${__group}} + ${${__group}INSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \ ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/${__page} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) - ${MINSTALL} ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} \ + ${${__group}INSTALL} ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page} .endif .endfor @@ -212,45 +258,41 @@ maninstall: ${MAN} esac; \ page=$$1; shift; sect=$$1; shift; \ d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \ - ${ECHO} ${MINSTALL} $${page} $${d}; \ - ${MINSTALL} $${page} $${d}; \ + ${ECHO} ${${__group}INSTALL} $${page} $${d}; \ + ${${__group}INSTALL} $${page} $${d}; \ done .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) -.for __page in ${MAN} - ${MINSTALL} ${__page:T:S/$/${CATEXT}/} \ +.for __page in ${${__group}} + ${${__group}INSTALL} ${__page:T:S/$/${CATEXT}/} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T} .endfor .endif .endif # defined(MANFILTER) .else # ${MK_MANCOMPRESS} == "yes" -.for __page in ${MAN} - ${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \ +.for __page in ${${__group}} + ${${__group}INSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \ ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/ .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) - ${MINSTALL} ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \ + ${${__group}INSTALL} ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/} .endif .endfor .endif # ${MK_MANCOMPRESS} == "no" .endif + +manlinksinstall-${__group}: .for l t in ${_MANLINKS} # On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x. .if ${.MAKE.OS} != "Darwin" || ${l:tu} != ${t:tu} -.if ${MK_MANSPLITPKG} == "no" - rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ - ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} -.else - rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ - ${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} -.endif + ${INSTALL_MANLINK} ${${__group}TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} .endif .endfor -manlint: -.if defined(MAN) && !empty(MAN) -.for __page in ${MAN} -manlint: ${__page}lint -${__page}lint: ${__page} +manlint: .PHONY checkmanlinks +.if defined(${__group}) && !empty(${__group}) +.for __page in ${${__group}} +manlint: ${__page:S/:/\:/g}lint +${__page:S/:/\:/g}lint: .PHONY ${__page} .if defined(MANFILTER) ${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} -Tlint .else @@ -258,3 +300,19 @@ ${__page}lint: ${__page} .endif .endfor .endif + +checkmanlinks: .PHONY +.if defined(${__group}LINKS) +checkmanlinks: checkmanlinks-${__group} +checkmanlinks-${__group}: .PHONY +.for __page __link in ${${__group}LINKS} +checkmanlinks-${__group}: checkmanlinks-${__group}-${__link} +checkmanlinks-${__group}-${__link}: .PHONY ${__page} + @if ! egrep -q "^(\.\\\\\" )?\.Nm ${__link:R}( ,)?$$" ${.ALLSRC}; then \ + echo "${__group}LINKS: '.Nm ${__link:R}' not found in ${__page}"; \ + exit 1; \ + fi >&2 +.endfor # __page __link in ${${__group}LINKS} +.endif # defined(${__group}LINKS) + +.endfor # __group in ${MANGROUPS} diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index f93101544bf7..4d67ba04294d 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -19,14 +19,6 @@ # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and # MK_FOO is set to "no" regardless of which list it was in. # -# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and -# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing, -# allowing this file to be included multiple times with different lists. -# -# Other parts of the build system will set BROKEN_OPTIONS to a list -# of options that are broken on this platform. This will not be unset -# before returning. Clients are expected to always += this variable. -# # Users should generally define WITH_FOO or WITHOUT_FOO, but the build # system should use MK_FOO={yes,no} when it needs to override the # user's desires or default behavior. @@ -35,6 +27,19 @@ # defined and __FOO_DEFAULT if not. Valid values for FOO are specified # by __FOO_OPTIONS. # +# All of __REQUIRED_OPTIONS, __DEFAULT_DEPENDENT_OPTIONS, +# __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS, and __SINGLE_OPTIONS +# are undef'd after all this processing, allowing this file to be +# included multiple times with different lists. However, we keep +# deduplicated lists of these options in similarly-named variables +# without the leading underscores (i.e. FOO_OPTIONS is the complete +# deduplicated list of all values of __FOO_OPTIONS across all +# invokations of this file). +# +# Other parts of the build system will set BROKEN_OPTIONS to a list +# of options that are broken on this platform. This will not be unset +# before returning. Clients are expected to always += this variable. +# # Other parts of the build system will set BROKEN_SINGLE_OPTIONS to a # list of 3-tuples of the form: "OPTION broken_value replacment_value". # This will not be unset before returning. Clients are expected to @@ -42,6 +47,33 @@ # # +# These variables accumulate all the options from our possibly +# multiple callers so they're available to build tools such as +# tools/build/options/makeman. +# +DEFAULT_NO_OPTIONS+=${__DEFAULT_NO_OPTIONS} +DEFAULT_NO_OPTIONS:=${DEFAULT_NO_OPTIONS:O:u} +DEFAULT_YES_OPTIONS+=${__DEFAULT_YES_OPTIONS} +DEFAULT_YES_OPTIONS:=${DEFAULT_YES_OPTIONS:O:u} +DEFAULT_DEPENDENT_OPTIONS+=${__DEFAULT_DEPENDENT_OPTIONS} +DEFAULT_DEPENDENT_OPTIONS:=${DEFAULT_DEPENDENT_OPTIONS:O:u} +REQUIRED_OPTIONS+=${__REQUIRED_OPTIONS} +REQUIRED_OPTIONS:=${REQUIRED_OPTIONS:O:u} +SINGLE_OPTIONS+=${__SINGLE_OPTIONS} +SINGLE_OPTIONS:=${SINGLE_OPTIONS:O:u} + +# +# All options defined by our caller; we will undef this before +# returning. +# +__ALL_OPTIONS:= \ + ${__DEFAULT_NO_OPTIONS} \ + ${__DEFAULT_YES_OPTIONS} \ + ${__REQUIRED_OPTIONS} \ + ${__DEFAULT_DEPENDENT_OPTIONS:H} \ + ${__SINGLE_OPTIONS} + +# # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} @@ -72,6 +104,7 @@ MK_${var}:= yes .endif MK_${var}:= yes .endfor +.undef __REQUIRED_OPTIONS # # MK_* options which default to "no". @@ -142,3 +175,22 @@ MK_${vv:H}?= ${MK_${vv:T}} MK_${vv:H}:= ${MK_${vv:H}} .endfor .undef __DEFAULT_DEPENDENT_OPTIONS + +# +# Define SRC_OPT_DEFS and SRC_OPT_LIST +# +SRC_OPT_DEFS?=-D__${MACHINE_ARCH}__ +SRC_OPT_LIST?=TARGET=${MACHINE} TARGET_ARCH=${MACHINE_ARCH} +.for option in ${__ALL_OPTIONS:O:u} +.if defined(OPT_${option}) +SRC_OPT_DEFS+=-D${option}=${OPT_${option}:Q} +SRC_OPT_LIST+=${option}=${OPT_${option}:Q} +.elif ${MK_${option}} == yes +SRC_OPT_DEFS+=-D${option} +SRC_OPT_LIST+=WITH_${option}=1 +.elif ${MK_${option}} == no +SRC_OPT_DEFS+=-U${option} +SRC_OPT_LIST+=WITHOUT_${option}=1 +.endif +.endfor +.undef __ALL_OPTIONS diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 85247d733a14..439924d0d596 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -78,6 +78,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + REPRODUCIBLE_BUILD \ RETPOLINE \ RUN_TESTS \ STALE_STAGED \ diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 00a048fedc1d..4dffe9723a9e 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -44,6 +44,10 @@ # # DEBUGMODE Mode for debug files. [${NOBINMODE}] # +# DEBUGOWN Owner for debug info files. [root] +# +# DEBUGGRP Group for debug info files. [wheel] +# # # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/modules] @@ -197,7 +201,8 @@ LIBMODE?= ${NOBINMODE} DEBUGDIR?= /usr/lib/debug DEBUGMODE?= ${NOBINMODE} - +DEBUGOWN?= ${BINOWN} +DEBUGGRP?= ${BINGRP} # Share files SHAREDIR?= /usr/share diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index f44556ef9b75..10e1c177e2b2 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -12,22 +12,6 @@ CFLAGS+=${COPTS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+=${DEBUG_FLAGS} -CXXFLAGS+=${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.endif - .if defined(PROG_CXX) PROG= ${PROG_CXX} .endif @@ -109,27 +93,13 @@ CFLAGS += -mno-relax .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} -.else -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf-*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif -.endif - -.if !defined(DEBUG_FLAGS) -STRIP?= -s .endif .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE:Uutilities} .endif -TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} +TAG_ARGS= -T ${TAGS:ts,:[*]} .endif .if defined(NO_SHARED) && ${NO_SHARED:tl} != "no" @@ -159,6 +129,9 @@ PROG_FULL= ${PROG} .if defined(PROG) PROGNAME?= ${PROG} +.if ${MK_DEBUG_FILES} != "no" +DEBUGFILE= ${PROGNAME}.debug +.endif .if defined(SRCS) @@ -223,11 +196,12 @@ ${PROG_FULL}: ${OBJS} .endif # !defined(SRCS) .if ${MK_DEBUG_FILES} != "no" -${PROG}: ${PROG_FULL} ${PROGNAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ +CLEANFILES+= ${PROG_FULL} ${DEBUGFILE} +${PROG}: ${PROG_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${PROG_FULL} ${.TARGET} -${PROGNAME}.debug: ${PROG_FULL} +${DEBUGFILE}: ${PROG_FULL} ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} .endif @@ -266,9 +240,6 @@ all: all-man .if defined(PROG) CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll -.if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug -.endif .endif .if defined(OBJS) @@ -308,19 +279,12 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor .if !target(realinstall) && !defined(INTERNALPROG) -realinstall: _proginstall -.ORDER: beforeinstall _proginstall +realinstall: _proginstall _debuginstall +.ORDER: beforeinstall _proginstall _debuginstall _proginstall: .if defined(PROG) ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ - ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug -.endif .endif .endif # !target(realinstall) @@ -391,6 +355,7 @@ TESTS_PATH+= ${.OBJDIR} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .endif +.include <bsd.debug.mk> .include <bsd.dep.mk> .include <bsd.clang-analyze.mk> .include <bsd.obj.mk> diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index cf19c9d66201..289e3d591c8c 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -76,13 +76,14 @@ obj: .PHONY .endif .if !defined(NEED_SUBDIR) +.if ${MK_DIRDEPS_BUILD} == "yes" +# ignore this +_SUBDIR: # .MAKE.DEPENDFILE==/dev/null is set by bsd.dep.mk to avoid reading # Makefile.depend -.if ${.MAKE.LEVEL} == 0 && ${MK_DIRDEPS_BUILD} == "yes" && !empty(SUBDIR) && \ - ${.MAKE.DEPENDFILE} != "/dev/null" +.if ${.MAKE.LEVEL} == 0 && !empty(SUBDIR) && ${.MAKE.DEPENDFILE} != "/dev/null" .include <meta.subdir.mk> -# ignore this -_SUBDIR: +.endif .endif .endif diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index a92539689a31..bdc7242d4bfd 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -185,7 +185,7 @@ C_DIRDEPS= \ # libgcc is needed as well but is added later. -.if ${MK_GSSAPI} != "no" +.if ${MK_KERBEROS} != "no" && ${MK_MITKRB5} == "no" C_DIRDEPS+= include/gssapi .endif diff --git a/share/mk/local.sys.machine.mk b/share/mk/local.sys.machine.mk index 5e40dfe805f9..961362cb048a 100644 --- a/share/mk/local.sys.machine.mk +++ b/share/mk/local.sys.machine.mk @@ -7,9 +7,9 @@ TARGET_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv MACHINE_ARCH_host?= ${_HOST_ARCH} MACHINE_ARCH_host32?= ${_HOST_ARCH32} -MACHINE_ARCH_LIST_arm?= armv7 ${EXTRA_ARCHES_arm} +MACHINE_ARCH_LIST_arm?= armv7 MACHINE_ARCH_LIST_arm64?= aarch64 -MACHINE_ARCH_LIST_powerpc?= powerpc powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} +MACHINE_ARCH_LIST_powerpc?= powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} MACHINE_ARCH_LIST_riscv?= riscv64 .for m in ${TARGET_MACHINE_LIST} diff --git a/share/mk/src.init.mk b/share/mk/src.init.mk index 01ea5437e5a7..fd3f3501f609 100644 --- a/share/mk/src.init.mk +++ b/share/mk/src.init.mk @@ -3,7 +3,7 @@ __<src.init.mk>__: .NOTMAIN .if !target(buildenv) -buildenv: .PHONY +buildenv: .PHONY .NOTMAIN ${_+_}@env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv .endif diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index a3b38db570bf..9ca043e7733c 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -33,6 +33,7 @@ _PRIVATELIBS= \ ssh \ ucl \ unbound \ + yaml \ zstd # Let projects based on FreeBSD append to _PRIVATELIBS @@ -41,6 +42,7 @@ _PRIVATELIBS+= ${LOCAL_PRIVATELIBS} _INTERNALLIBS= \ amu \ + apputils \ bsnmptools \ c_nossp_pic \ cron \ @@ -52,6 +54,10 @@ _INTERNALLIBS= \ ifconfig \ ipf \ iscsiutil \ + kadmin_common \ + kprop_util \ + krb5apputils \ + krb5ss \ lpr \ lua \ lutok \ @@ -66,11 +72,13 @@ _INTERNALLIBS= \ pfctl \ pkgecc \ pmcstat \ + samplerate \ sl \ sm \ smdb \ smutil \ telnet \ + util++ \ vers \ wpaap \ wpacommon \ @@ -151,6 +159,7 @@ _LIBRARIES= \ gpio \ gssapi \ gssapi_krb5 \ + gssrpc \ hdb \ heimbase \ heimntlm \ @@ -160,12 +169,17 @@ _LIBRARIES= \ ipsec \ ipt \ jail \ - kadm5clnt \ - kadm5srv \ + k5crypto \ + kadm5 \ + kadmin_common \ kafs5 \ + kdb5 \ kdc \ kiconv \ + krad \ krb5 \ + krb5profile \ + krb5support \ kvm \ l \ lzma \ @@ -223,6 +237,7 @@ _LIBRARIES= \ usbhid \ util \ uutil \ + verto \ vmmapi \ wind \ wrap \ @@ -237,6 +252,16 @@ _LIBRARIES= \ zpool \ zutil +.if ${MK_KERBEROS} != "no" && ${MK_MITKRB5} != "no" +_LIBRARIES+= \ + kadm5clnt_mit \ + kadm5srv_mit +.else +_LIBRARIES+= \ + kadm5clnt \ + kadm5srv +.endif + .if ${MK_BLACKLIST} != "no" _LIBRARIES+= \ blacklist \ @@ -369,7 +394,7 @@ _DP_gmock_main= gmock _DP_gtest_main= gtest _DP_devstat= kvm _DP_pam= radius tacplus md util -.if ${MK_KERBEROS} != "no" +.if ${MK_KERBEROS} != "no" && ${MK_MITKRB5} != "no" _DP_pam+= krb5 .endif .if ${MK_OPENSSH} != "no" @@ -379,6 +404,22 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif +.if ${MK_KERBEROS} != "no" +.if ${MK_MITKRB5} != "no" +# _DP_krb5support= no dependencies except for libc +# _DP_verto= no dependencies except for libc +# _DP_apputils= no dependencies except for libc +_DP_com_err= krb5support +_DP_k5crypto= com_err krb5support crypto +_DP_krb5profile= com_err krb5support +_DP_gssapi_krb5= krb5 k5crypto com_err krb5profile krb5support +_DP_kadm5clnt_mit= gssrpc gssapi_krb5 krb5 k5crypto krb5support com_err krb5profile +_DP_kadm5srv_mit= krb5profile gssrpc gssapi_krb5 kdb5 krb5 k5crypto krb5support com_err +_DP_kdb5= gssrpc krb5 k5crypto com_err krb5support gssapi_krb5 krb5profile +_DP_krad= krb5 k5crypto com_err krb5profile krb5support verto +_DP_krb5= krb5profile k5crypto com_err krb5support +_DP_gssrpc= gssapi_krb5 krb5 k5crypto com_err krb5support +.else _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken @@ -394,6 +435,8 @@ _DP_heimipcs= heimbase roken pthread _DP_kafs5= asn1 krb5 roken _DP_krb5= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5= gssapi krb5 crypto roken asn1 com_err +.endif +.endif _DP_lzma= md pthread _DP_ucl= m _DP_vmmapi= util @@ -429,7 +472,11 @@ _DP_ncursesw= tinfow _DP_formw= ncursesw _DP_nvpair= spl _DP_panelw= ncursesw +.if ${MK_MITKRB5} == "no" _DP_rpcsec_gss= gssapi +.else +_DP_rpcsec_gss= gssapi_krb5 +.endif _DP_smb= kiconv _DP_ulog= md _DP_fifolog= z @@ -446,6 +493,7 @@ _DP_be= zfs spl nvpair zfsbootenv _DP_netmap= _DP_ifconfig= m _DP_pfctl= nv +_DP_krb5ss= edit # OFED support .if ${MK_OFED} != "no" @@ -651,6 +699,9 @@ LIBPKGECC?= ${LIBPKGECCDIR}/libpkgecc${PIE_SUFFIX}.a LIBPMCSTATDIR= ${_LIB_OBJTOP}/lib/libpmcstat LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a +LIBUTIL++DIR= ${_LIB_OBJTOP}/lib/libutil++ +LIBUTIL++?= ${LIBUTIL++DIR}/libutil++${PIE_SUFFIX}.a + LIBWPAAPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/ap LIBWPAAP?= ${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a @@ -705,6 +756,9 @@ LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a LIBSYS_PICDIR= ${_LIB_OBJTOP}/lib/libsys LIBSYS_PIC?= ${LIBSYS_PICDIR}/libsys_pic.a +LIBSAMPLERATEDIR?= ${_LIB_OBJTOP}/lib/libsamplerate +LIBSAMPLERATE?= ${LIBSAMPLERATEDIR}/libsamplerate${PIE_SUFFIX}.a + # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. @@ -751,6 +805,40 @@ LIBOSMVENDORDIR=${_LIB_OBJTOP}/lib/ofed/libvendor LIBDIALOGDIR= ${_LIB_OBJTOP}/gnu/lib/libdialog LIBSSPDIR= ${_LIB_OBJTOP}/lib/libssp LIBSSP_NONSHAREDDIR= ${_LIB_OBJTOP}/lib/libssp_nonshared +.if ${MK_MITKRB5} != "no" +LIBAPPUTILSDIR= ${_LIB_OBJTOP}/krb5/lib/apputils +LIBAPPUTILS?= ${LIBAPPUTILSDIR}/libapputils${PIE_SUFFIX}.a +LIBGSSAPI_KRB5DIR= ${_LIB_OBJTOP}/krb5/lib/gssapi +LIBGSSAPI_KRB5?= ${LIBGSSAPI_KRB5DIR}/libgssapi_krb5${PIE_SUFFIX}.a +LIBGSSRPCDIR= ${_LIB_OBJTOP}/krb5/lib/rpc +LIBGSSRPC?= ${LIBGSSRPCDIR}/libgssrpc${PIE_SUFFIX}.a +LIBK5CRYPTODIR= ${_LIB_OBJTOP}/krb5/lib/crypto +LIBK5CRYPTO?= ${LIBK5CRYPTODIR}/libk5crypto${PIE_SUFFIX}.a +LIBK5GSSRPCDIR= ${_LIB_OBJTOP}/krb5/lib/rpc +LIBK5GSSRPC?= ${LIBK5GSSRPCDIR}/libgssrpc${PIE_SUFFIX}.a +LIBKADM5CLNT_MITDIR= ${_LIB_OBJTOP}/krb5/lib/kadm5clnt +LIBKADM5CLNT_MIT?= ${LIBKADM5CLNT_MITDIR}/libkadm5clnt_mit${PIE_SUFFIX}.a +LIBKADM5SRV_MITDIR= ${_LIB_OBJTOP}/krb5/lib/kadm5srv +LIBKADM5SRV_MIT?= ${LIBKADM5SRV_MITDIR}/libkadm5srv_mit${PIE_SUFFIX}.a +LIBKADMIN_COMMONDIR= ${_LIB_OBJTOP}/krb5/lib/kadmin_common +LIBKADMIN_COMMON?= ${LIBKADMIN_COMMONDIR}/libkadmin_common${PIE_SUFFIX}.a +LIBKDB5DIR= ${_LIB_OBJTOP}/krb5/lib/kdb +LIBKDB5?= ${LIBKDB5DIR}/libkdb5${PIE_SUFFIX}.a +LIBKPROP_UTILDIR= ${_LIB_OBJTOP}/krb5/lib/kprop_util +LIBKPROP_UTIL?= ${LIBKPROP_UTILDIR}/libkprop_util${PIE_SUFFIX}.a +LIBKRADDIR= ${_LIB_OBJTOP}/krb5/lib/krad +LIBKRAD?= ${LIBKRADDIR}/libkrad${PIE_SUFFIX}.a +LIBKRB5DIR= ${_LIB_OBJTOP}/krb5/lib/krb5 +LIBKRB5?= ${LIBKRB5DIR}/libkrb5${PIE_SUFFIX}.a +LIBKRB5SSDIR= ${_LIB_OBJTOP}/krb5/util/ss +LIBKRB5SS?= ${LIBKRB5SUPPORTDIR}/libkrb5ss${PIE_SUFFIX}.a +LIBKRB5SUPPORTDIR= ${_LIB_OBJTOP}/krb5/util/support +LIBKRB5SUPPORT?= ${LIBKRB5SUPPORTDIR}/libkrb5support${PIE_SUFFIX}.a +LIBKRB5PROFILEDIR= ${_LIB_OBJTOP}/krb5/util/profile +LIBKRB5PROFILE?= ${LIBPROFILEDIR}/libkrb5profile${PIE_SUFFIX}.a +LIBVERTODIR= ${_LIB_OBJTOP}/krb5/util/verto +LIBVERTO?= ${LIBVERTODIR}/libverto${PIE_SUFFIX}.a +.else LIBASN1DIR= ${_LIB_OBJTOP}/kerberos5/lib/libasn1 LIBGSSAPI_KRB5DIR= ${_LIB_OBJTOP}/kerberos5/lib/libgssapi_krb5 LIBGSSAPI_NTLMDIR= ${_LIB_OBJTOP}/kerberos5/lib/libgssapi_ntlm @@ -768,6 +856,7 @@ LIBKDCDIR= ${_LIB_OBJTOP}/kerberos5/lib/libkdc LIBKRB5DIR= ${_LIB_OBJTOP}/kerberos5/lib/libkrb5 LIBROKENDIR= ${_LIB_OBJTOP}/kerberos5/lib/libroken LIBWINDDIR= ${_LIB_OBJTOP}/kerberos5/lib/libwind +.endif LIBATF_CDIR= ${_LIB_OBJTOP}/lib/atf/libatf-c LIBATF_CXXDIR= ${_LIB_OBJTOP}/lib/atf/libatf-c++ LIBGMOCKDIR= ${_LIB_OBJTOP}/lib/googletest/gmock diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 387e570f8518..85a003eb4eaf 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MITKRB5 \ MLX5TOOL \ NETCAT \ NETGRAPH \ @@ -211,7 +212,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_FULL_DEBUGINFO \ MALLOC_PRODUCTION \ - MITKRB5 \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ @@ -296,9 +296,9 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS .include <bsd.compiler.mk> .if ${__T} == "i386" || ${__T} == "amd64" -__DEFAULT_NO_OPTIONS += FDT +__DEFAULT_NO_OPTIONS+=FDT .else -__DEFAULT_YES_OPTIONS += FDT +__DEFAULT_YES_OPTIONS+=FDT .endif .if ${__T:Marm*} == "" && ${__T:Mriscv64*} == "" @@ -508,7 +508,7 @@ MK_LOADER_VERIEXEC_PASS_MANIFEST := no # MK_* options whose default value depends on another option. # .for vv in \ - GSSAPI/KERBEROS \ + KERBEROS_SUPPORT/KERBEROS \ MAN_UTILS/MAN .if defined(WITH_${vv:H}) MK_${vv:H}:= yes @@ -519,8 +519,4 @@ MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor -# -# Set defaults for the MK_*_SUPPORT variables. -# - .endif # !target(__<src.opts.mk>__) diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk index d5c2af0c559d..2b9fc255a26d 100644 --- a/share/mk/src.sys.mk +++ b/share/mk/src.sys.mk @@ -42,7 +42,7 @@ CFLAGS+= ${CFCOMMONFLAG} CFLAGS+= -fmacro-prefix-map=${SRCTOP}=/usr/src -fdebug-prefix-map=${SRCTOP}=/usr/src .endif -DEFAULTWARNS= 6 +DEFAULTWARNS?= 6 # tempting, but bsd.compiler.mk causes problems this early # probably need to remove dependence on bsd.own.mk diff --git a/share/syscons/Makefile.inc b/share/syscons/Makefile.inc index 07cde30e3d52..d4635b273f40 100644 --- a/share/syscons/Makefile.inc +++ b/share/syscons/Makefile.inc @@ -1 +1 @@ -FILESPACKAGE= syscons +FILESPACKAGE= syscons-data diff --git a/share/syscons/fonts/Makefile b/share/syscons/fonts/Makefile index e1b6614b5684..ba3341da87e3 100644 --- a/share/syscons/fonts/Makefile +++ b/share/syscons/fonts/Makefile @@ -1,5 +1,3 @@ -PACKAGE= syscons-data - FILES= armscii8-8x8.fnt armscii8-8x14.fnt armscii8-8x16.fnt \ cp437-8x8.fnt cp437-8x14.fnt cp437-8x16.fnt \ cp437-thin-8x8.fnt cp437-thin-8x16.fnt \ diff --git a/share/syscons/keymaps/Makefile b/share/syscons/keymaps/Makefile index 139834abcd2b..bf0099288a19 100644 --- a/share/syscons/keymaps/Makefile +++ b/share/syscons/keymaps/Makefile @@ -1,5 +1,3 @@ -PACKAGE= syscons-data - FILES= INDEX.keymaps \ be.iso.kbd be.iso.acc.kbd \ bg.bds.ctrlcaps.kbd bg.phonetic.ctrlcaps.kbd \ diff --git a/share/syscons/scrnmaps/Makefile b/share/syscons/scrnmaps/Makefile index 8da31ed32be4..ffbd6be3df4d 100644 --- a/share/syscons/scrnmaps/Makefile +++ b/share/syscons/scrnmaps/Makefile @@ -1,5 +1,3 @@ -PACKAGE= syscons-data - SCRMAPS = armscii8-2haik8.scm \ iso-8859-1_to_cp437.scm iso-8859-4_for_vga9.scm \ iso-8859-7_to_cp437.scm \ diff --git a/share/termcap/termcap b/share/termcap/termcap index 9704d85c942f..44704653045d 100644 --- a/share/termcap/termcap +++ b/share/termcap/termcap @@ -3549,8 +3549,7 @@ ti931|ti 931:\ # using \EPC\\ and \EPD\\, but I don't think there is a # capability for that. ti703|ti707|Texas Instruments Silent 703/707, 80 cols:\ - :am:hc:os:xn:\ - :co#80:it#8:\ + :am:hc:os:xn:co#80:\ :do=\n:le=\b:cr=\r:nd= :bl=^G:ta=\t:is=\EPC\\: ti703-w|ti707-w|Texas Instruments Silent 703/707, 132 cols:\ :co#132:is=\EPD\\:tc=ti703: @@ -4706,14 +4705,14 @@ xterm-termite|VTE-based terminal:\ :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: -# Termcap for st terminal taken from the st-0.8 sources -st|simpleterm:\ +# Termcap for st terminal taken from the st-0.9.2 sources +st-mono|simpleterm monocolor:\ :am:hs:mi:ms:xn:\ :co#80:it#8:li#24:\ :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\ - :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\ - :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=\E(B:al=\E[L:\ + :as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\ :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ @@ -4726,6 +4725,14 @@ st|simpleterm:\ :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h: +st|simpleterm:\ + :Co#8:\ + :AB=\E[4%dm:AF=\E[3%dm:\ + :..Sb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m:\ + :..Sf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m:\ + :..sa=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m:\ + :tc=st-mono: + st-256color|simpleterm with 256 colors:\ :cc:\ :Co#256:pa#32767:\ @@ -4743,6 +4750,12 @@ st-meta-256color|simpleterm with meta key and 256 colors:\ :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ :rs=\E[4l\E>\E[?1034h:tc=st-256color: +st-bs|simpleterm with backspace as backspace:\ + :kD=\177:kb=^H:tc=st: + +st-bs-256color|simpleterm with backspace as backspace and 256colors:\ + :kD=\177:kb=^H:tc=st-256color: + # From version 0.13.3 xterm-kitty|KovId's TTY:\ @@ -4808,6 +4821,26 @@ alacritty+common|base fragment for alacritty:\ :te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\ :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + +# From Tim Culverhouse <tim@timculverhouse.com> +xterm-ghostty|ghostty|Ghostty:\ + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ + :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:ic=\E[@:im=\E[4h:k1=\EOP:k2=\EOQ:\ + :k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\ + :ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\ + :mh=\E[2m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:\ + :so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:\ + :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ + :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + # # END OF TERMCAP # ------------------------ diff --git a/share/vt/fonts/INDEX.fonts b/share/vt/fonts/INDEX.fonts index 8a36ccfbf211..dee9e855c42e 100644 --- a/share/vt/fonts/INDEX.fonts +++ b/share/vt/fonts/INDEX.fonts @@ -25,14 +25,6 @@ MENU:da:Vælg skrifttypen til din terminal MENU:de:Wählen Sie Ihre Schrift MENU:fr:Choisissez votre fonte écran -# -# The font definition for "en" is the fall-back font for -# all languages. -# Add language specific font definitions only where required! -# -FONT:en:vgarom-8x14.fnt -# - gallant.fnt:en:Gallant Character set, 12x22 gallant.fnt:da:Gallant-tegnsæt, 12x22 gallant.fnt:de:Gallant Zeichensatz, 12x22 diff --git a/share/vt/keymaps/INDEX.keymaps b/share/vt/keymaps/INDEX.keymaps index b650765d68df..fd00d0e71c87 100644 --- a/share/vt/keymaps/INDEX.keymaps +++ b/share/vt/keymaps/INDEX.keymaps @@ -33,14 +33,6 @@ MENU:el:Επιλέξτε το πληκτρολόγιο της κονσόλας MENU:hy:Ընտրեք ստեղնաշարի դասավորությունը MENU:tr:Klavye düzeninizi seçiniz -# -# The font definition for "en" is the fall-back font for -# all languages. -# Add language specific font definitions only where required! -# -FONT:en:vgarom-8x16.hex - -# am.kbd:en:Armenian phonetic layout am.kbd:da:Armensk fonetisk layout am.kbd:de:Armenische phonetische Tastenbelegung @@ -211,7 +203,7 @@ ca-fr.kbd:fr:Français Canadien (avec accents) ca-fr.kbd:es:Francocanadiense (con acentos) ca-fr.kbd:uk:Французько-канадська (accent keys) -ca-multi.kbd:en:Canadian Mulitlingual Standard +ca-multi.kbd:en:Canadian Multilingual Standard ca-multi.kbd:fr:Canadien multilingue standard de.kbd:en:German diff --git a/share/vt/keymaps/uk.kbd b/share/vt/keymaps/uk.kbd index 4a805fae12b9..261af190dcbe 100644 --- a/share/vt/keymaps/uk.kbd +++ b/share/vt/keymaps/uk.kbd @@ -7,7 +7,7 @@ 002 '1' '!' nop nop '`' '`' nop nop O 003 '2' '"' nul nul '@' '@' nul nul O 004 '3' 0xa3 nop nop '#' '#' nop nop O - 005 '4' '$' 0xa4 0xa4 '4' '$' nop nop O + 005 '4' '$' nop nop 0x20ac '$' nop nop O 006 '5' '%' nop nop '5' '%' nop nop O 007 '6' '^' rs rs '^' '^' rs rs O 008 '7' '&' nop nop '[' '[' esc esc O |