aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile3
-rw-r--r--share/man/man9/bitset.96
-rw-r--r--share/man/man9/cpuset.96
-rw-r--r--share/man/man9/lock.97
-rw-r--r--share/man/man9/pci.925
-rw-r--r--share/man/man9/tcp_functions.952
-rw-r--r--share/man/man9/timeout.9137
7 files changed, 201 insertions, 35 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index f519e0f20f28..aff86cf9e8ad 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1015,7 +1015,6 @@ MLINKS+=lock.9 lockdestroy.9 \
lock.9 lockmgr_printinfo.9 \
lock.9 lockmgr_recursed.9 \
lock.9 lockmgr_rw.9 \
- lock.9 lockmgr_waiters.9 \
lock.9 lockstatus.9
MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9
MLINKS+=make_dev.9 destroy_dev.9 \
@@ -1303,6 +1302,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_ident.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_iov_attach.9 \
+ pci.9 pci_iov_attach_name.9 \
pci.9 pci_iov_detach.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \
@@ -1766,6 +1766,7 @@ MLINKS+=timeout.9 callout.9 \
timeout.9 callout_schedule_sbt_curcpu.9 \
timeout.9 callout_schedule_sbt_on.9 \
timeout.9 callout_stop.9 \
+ timeout.9 callout_when.9 \
timeout.9 untimeout.9
MLINKS+=ucred.9 cred_update_thread.9 \
ucred.9 crcopy.9 \
diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9
index 19f53a2a029c..ef5511503333 100644
--- a/share/man/man9/bitset.9
+++ b/share/man/man9/bitset.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 20, 2015
+.Dd July 29, 2016
.Dt BITSET 9
.Os
.Sh NAME
@@ -77,9 +77,9 @@
.Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset"
.Ft bool
.Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
.Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset"
-.Ft size_t
+.Ft int
.Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset"
.\"
.Ft bool
diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9
index fb0a9fcd95b1..1d778ad940d3 100644
--- a/share/man/man9/cpuset.9
+++ b/share/man/man9/cpuset.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 20, 2015
+.Dd July 29, 2016
.Dt CPUSET 9
.Os
.Sh NAME
@@ -75,9 +75,9 @@
.Fn CPU_EMPTY "cpuset_t *cpuset"
.Ft bool
.Fn CPU_ISFULLSET "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
.Fn CPU_FFS "cpuset_t *cpuset"
-.Ft size_t
+.Ft int
.Fn CPU_COUNT "cpuset_t *cpuset"
.\"
.Ft bool
diff --git a/share/man/man9/lock.9 b/share/man/man9/lock.9
index db99cad4abaa..001c5f182120 100644
--- a/share/man/man9/lock.9
+++ b/share/man/man9/lock.9
@@ -39,7 +39,6 @@
.Nm lockmgr_printinfo ,
.Nm lockmgr_recursed ,
.Nm lockmgr_rw ,
-.Nm lockmgr_waiters ,
.Nm lockstatus ,
.Nm lockmgr_assert
.Nd "lockmgr family of functions"
@@ -66,8 +65,6 @@
.Ft int
.Fn lockmgr_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk"
.Ft int
-.Fn lockmgr_waiters "const struct lock *lkp"
-.Ft int
.Fn lockstatus "const struct lock *lkp"
.Pp
.Cd "options INVARIANTS"
@@ -279,10 +276,6 @@ function returns true if the lock is recursed, 0
otherwise.
.Pp
The
-.Fn lockmgr_waiters
-function returns true if the lock has waiters, 0 otherwise.
-.Pp
-The
.Fn lockstatus
function returns the status of the lock in relation to the current thread.
.Pp
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index a53f971ad0bb..161f9aa13292 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 24, 2016
+.Dd August 3, 2016
.Dt PCI 9
.Os
.Sh NAME
@@ -50,6 +50,7 @@
.Nm pci_get_vpd_ident ,
.Nm pci_get_vpd_readonly ,
.Nm pci_iov_attach ,
+.Nm pci_iov_attach_name ,
.Nm pci_iov_detach ,
.Nm pci_msi_count ,
.Nm pci_msix_count ,
@@ -152,6 +153,14 @@
.Ft int
.Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
.Ft int
+.Fo pci_iov_attach_name
+.Fa "device_t dev"
+.Fa "nvlist_t *pf_schema"
+.Fa "nvlist_t *vf_schema"
+.Fa "const char *fmt"
+.Fa "..."
+.Fc
+.Ft int
.Fn pci_iov_detach "device_t dev"
.Sh DESCRIPTION
The
@@ -595,6 +604,20 @@ and is responsible for freeing them.
The driver must never free the schemas itself.
.Pp
The
+.Fn pci_iov_attach_name
+function is a variant of
+.Fn pci_iov_attach
+that allows the name of the associated character device in
+.Pa /dev/iov
+to be specified by
+.Fa fmt .
+The
+.Fn pci_iov_attach
+function uses the name of
+.Fa dev
+as the device name.
+.Pp
+The
.Fn pci_iov_detach
function is used to advise the SR-IOV infrastructure that the driver for the
given device is attempting to detach and that all SR-IOV resources for the
diff --git a/share/man/man9/tcp_functions.9 b/share/man/man9/tcp_functions.9
index 06c42ff0fa60..b998dd0dd7df 100644
--- a/share/man/man9/tcp_functions.9
+++ b/share/man/man9/tcp_functions.9
@@ -114,14 +114,17 @@ struct tcp_function_block {
struct inpcb *inp, struct tcpcb *tp);
/* Optional memory allocation/free routine */
void (*tfb_tcp_fb_init)(struct tcpcb *);
- void (*tfb_tcp_fb_fini)(struct tcpcb *);
+ void (*tfb_tcp_fb_fini)(struct tcpcb *, int);
/* Optional timers, must define all if you define one */
int (*tfb_tcp_timer_stop_all)(struct tcpcb *);
void (*tfb_tcp_timer_activate)(struct tcpcb *,
uint32_t, u_int);
int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t);
void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t);
+ /* Optional functions */
void (*tfb_tcp_rexmit_tmr)(struct tcpcb *);
+ void (*tfb_tcp_handoff_ok)(struct tcpcb *);
+ /* System use */
volatile uint32_t tfb_refcnt;
uint32_t tfb_flags;
};
@@ -157,6 +160,16 @@ in the
.Va tfb_tcp_fb_fini
field.
.Pp
+If the
+.Va tfb_tcp_fb_fini
+argument is non-NULL, the function to which it points is called when the
+kernel is destroying the TCP control block or when the socket is transitioning
+to use a different TCP stack.
+The function is called with arguments of the TCP control block and an integer
+flag.
+The flag will be zero if the socket is transitioning to use another TCP stack
+or one if the TCP control block is being destroyed.
+.Pp
If the TCP stack implements additional timers, the TCP stack should set a
non-NULL pointer in the
.Va tfb_tcp_timer_stop_all ,
@@ -193,6 +206,37 @@ However, care must be taken to ensure the retransmit timer leaves the
TCP control block in a valid state for the remainder of the retransmit
timer logic.
.Pp
+A user may select a new TCP stack before calling
+.Xr connect 2
+or
+.Xr listen 2 .
+Optionally, a TCP stack may also allow a user to begin using the TCP stack for
+a connection that is in a later state by setting a non-NULL function pointer in
+the
+.Va tfb_tcp_handoff_ok
+field.
+If this field is non-NULL and a user attempts to select that TCP stack after
+calling
+.Xr connect 2
+or
+.Xr listen 2
+for that socket, the kernel will call the function pointed to by the
+.Va tfb_tcp_handoff_ok
+field.
+The function should return 0 if the user is allowed to switch the socket to use
+the TCP stack. Otherwise, the function should return an error code, which will
+be returned to the user.
+If the
+.Va tfb_tcp_handoff_ok
+field is
+.Dv NULL
+and a user attempts to select the TCP stack after calling
+.Xr connect 2
+or
+.Xr listen 2
+for that socket, the operation will fail and the kernel will return
+.Er EINVAL .
+.Pp
The
.Va tfb_refcnt
and
@@ -269,8 +313,10 @@ The
.Fa blk
argument references a function block that is not currently registered.
.Sh SEE ALSO
-.Xr malloc 9 ,
-.Xr tcp 4
+.Xr connect 2 ,
+.Xr listen 2 ,
+.Xr tcp 4 ,
+.Xr malloc 9
.Sh HISTORY
This framework first appeared in
.Fx 11.0 .
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 73925b2947d7..54b63d22272d 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 4, 2016
+.Dd July 27, 2016
.Dt TIMEOUT 9
.Os
.Sh NAME
@@ -56,6 +56,7 @@
.Nm callout_schedule_sbt_curcpu ,
.Nm callout_schedule_sbt_on ,
.Nm callout_stop ,
+.Nm callout_when ,
.Nm timeout ,
.Nm untimeout
.Nd execute a function after a specified length of time
@@ -91,20 +92,48 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle);
.Ft int
.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg"
.Ft int
-.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \
-"void *arg"
+.Fo callout_reset_curcpu
+.Fa "struct callout *c"
+.Fa "int ticks"
+.Fa "timeout_t *func"
+.Fa "void *arg"
+.Fc
.Ft int
-.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \
-"void *arg" "int cpu"
+.Fo callout_reset_on
+.Fa "struct callout *c"
+.Fa "int ticks"
+.Fa "timeout_t *func"
+.Fa "void *arg"
+.Fa "int cpu"
+.Fc
.Ft int
-.Fn callout_reset_sbt "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "timeout_t *func" "void *arg" "int flags"
+.Fo callout_reset_sbt
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "timeout_t *func"
+.Fa "void *arg"
+.Fa "int flags"
+.Fc
.Ft int
-.Fn callout_reset_sbt_curcpu "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "timeout_t *func" "void *arg" "int flags"
+.Fo callout_reset_sbt_curcpu
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "timeout_t *func"
+.Fa "void *arg"
+.Fa "int flags"
+.Fc
.Ft int
-.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags"
+.Fo callout_reset_sbt_on
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "timeout_t *func"
+.Fa "void *arg"
+.Fa "int cpu"
+.Fa "int flags"
+.Fc
.Ft int
.Fn callout_schedule "struct callout *c" "int ticks"
.Ft int
@@ -112,16 +141,37 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle);
.Ft int
.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu"
.Ft int
-.Fn callout_schedule_sbt "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "int flags"
+.Fo callout_schedule_sbt
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "int flags"
+.Fc
.Ft int
-.Fn callout_schedule_sbt_curcpu "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "int flags"
+.Fo callout_schedule_sbt_curcpu
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "int flags"
+.Fc
.Ft int
-.Fn callout_schedule_sbt_on "struct callout *c" "sbintime_t sbt" \
-"sbintime_t pr" "int cpu" "int flags"
+.Fo callout_schedule_sbt_on
+.Fa "struct callout *c"
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t pr"
+.Fa "int cpu"
+.Fa "int flags"
+.Fc
.Ft int
.Fn callout_stop "struct callout *c"
+.Ft sbintime_t
+.Fo callout_when
+.Fa "sbintime_t sbt"
+.Fa "sbintime_t precision"
+.Fa "int flags"
+.Fa "sbintime_t *sbt_res"
+.Fa "sbintime_t *precision_res"
+.Fc
.Ft struct callout_handle
.Fn timeout "timeout_t *func" "void *arg" "int ticks"
.Ft void
@@ -387,6 +437,26 @@ or this value is used as the length of the time window.
Smaller values
.Pq which result in larger time intervals
allow the callout subsystem to aggregate more events in one timer interrupt.
+.It Dv C_PRECALC
+The
+.Fa sbt
+argument specifies the absolute time at which the callout should be run,
+and the
+.Fa pr
+argument specifies the requested precision, which will not be
+adjusted during the scheduling process.
+The
+.Fa sbt
+and
+.Fa pr
+values should be calculated by an earlier call to
+.Fn callout_when
+which uses the user-supplied
+.Fa sbt ,
+.Fa pr ,
+and
+.Fa flags
+values.
.It Dv C_HARDCLOCK
Align the timeouts to
.Fn hardclock
@@ -503,6 +573,39 @@ but it
.Em does not
clear it when a callout expires normally via the execution of the
callout function.
+.Pp
+The
+.Fn callout_when
+function may be used to pre-calculate the absolute time at which the
+timeout should be run and the precision of the scheduled run time
+according to the required time
+.Fa sbt ,
+precision
+.Fa precision ,
+and additional adjustments requested by the
+.Fa flags
+argument.
+Flags accepted by the
+.Fn callout_when
+function are the same as flags for the
+.Fn callout_reset
+function.
+The resulting time is assigned to the variable pointed to by the
+.Fa sbt_res
+argument, and the resulting precision is assigned to
+.Fa *precision_res .
+When passing the results to
+.Fa callout_reset ,
+add the
+.Va C_PRECALC
+flag to
+.Fa flags ,
+to avoid incorrect re-adjustment.
+The function is intended for situations where precise time of the callout
+run should be known in advance, since
+trying to read this time from the callout structure itself after a
+.Fn callout_reset
+call is racy.
.Ss "Avoiding Race Conditions"
The callout subsystem invokes callout functions from its own thread
context.