summaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-08-14 05:25:30 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-08-14 05:25:30 +0000
commitfc5e6e905c0592dfb3e47078a194cb111c88b040 (patch)
tree0c2413c61cf523c5a1b55960eb7ab526404a6e3c /share/man
parent33c89536397ceb5dd2950df6e201816950484c60 (diff)
provide ml_requeue and mq_requeue for prepending mbufs on lists/queues
ok mpi@ claudio@
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/Makefile10
-rw-r--r--share/man/man9/ml_init.916
-rw-r--r--share/man/man9/mq_init.928
3 files changed, 43 insertions, 11 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index ded507f946c..3f31bfa1c34 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.237 2015/07/08 07:21:49 mpi Exp $
+# $OpenBSD: Makefile,v 1.238 2015/08/14 05:25:29 dlg Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -266,7 +266,8 @@ MLINKS+=microtime.9 getmicrotime.9 microtime.9 microuptime.9 \
microtime.9 getnanotime.9 microtime.9 nanouptime.9 \
microtime.9 getnanouptime.9 microtime.9 bintime.9 \
microtime.9 binuptime.9
-MLINKS+=ml_init.9 ml_enqueue.9 ml_init.9 ml_dequeue.9 ml_init.9 ml_dechain.9 \
+MLINKS+=ml_init.9 ml_enqueue.9 ml_init.9 ml_dequeue.9 ml_init.9 ml_requeue.9 \
+ ml_init.9 ml_dechain.9 \
ml_init.9 ml_filter.9 ml_init.9 ml_len.9 ml_init.9 ml_empty.9 \
ml_init.9 MBUF_LIST_INITIALIZER.9 ml_init.9 MBUF_LIST_FOREACH.9
MLINKS+=mountroothook_establish.9 mountroothook_disestablish.9
@@ -274,8 +275,9 @@ MLINKS+=mutex.9 mtx_init.9 mutex.9 mtx_enter.9 mutex.9 mtx_leave.9 \
mutex.9 MUTEX_ASSERT_LOCKED.9 mutex.9 MUTEX_ASSERT_UNLOCKED.9 \
mutex.9 MUTEX_INITIALIZER.9
MLINKS+=mutex.9 mtx_enter_try.9
-MLINKS+=mq_init.9 mq_enqueue.9 mq_init.9 mq_dequeue.9 mq_init.9 mq_enlist.9 \
- mq_init.9 mq_delist.9 mq_init.9 mq_dechain.9 mq_init.9 mq_filter.9 \
+MLINKS+=mq_init.9 mq_enqueue.9 mq_init.9 mq_dequeue.9 mq_init.9 mq_requeue.9 \
+ mq_init.9 mq_enlist.9 mq_init.9 mq_delist.9 \
+ mq_init.9 mq_dechain.9 mq_init.9 mq_filter.9 \
mq_init.9 mq_len.9 mq_init.9 mq_empty.9 mq_init.9 mq_drops.9 \
mq_init.9 mq_set_maxlen.9 mq_init.9 MBUF_QUEUE_INITIALIZER.9
MLINKS+=namei.9 vfs_lookup.9 namei.9 vfs_relookup.9 namei.9 NDINIT.9
diff --git a/share/man/man9/ml_init.9 b/share/man/man9/ml_init.9
index 89c1ac778bc..c6e1ce2308c 100644
--- a/share/man/man9/ml_init.9
+++ b/share/man/man9/ml_init.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ml_init.9,v 1.1 2015/06/17 06:24:46 mpi Exp $
+.\" $OpenBSD: ml_init.9,v 1.2 2015/08/14 05:25:29 dlg Exp $
.\"
.\" Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
.\"
@@ -14,13 +14,14 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 17 2015 $
+.Dd $Mdocdate: August 14 2015 $
.Dt ML_INIT 9
.Os
.Sh NAME
.Nm ml_init ,
.Nm ml_enqueue ,
.Nm ml_dequeue ,
+.Nm ml_requeue ,
.Nm ml_dechain ,
.Nm ml_len ,
.Nm ml_empty ,
@@ -34,6 +35,8 @@
.Fn "ml_enqueue" "struct mbuf_list *ml" "struct mbuf *m"
.Ft struct mbuf *
.Fn "ml_dequeue" "struct mbuf_list *ml"
+.Ft void
+.Fn "ml_requeue" "struct mbuf_list *ml" "struct mbuf *m"
.Ft struct mbuf *
.Fn "ml_dechain" "struct mbuf_list *ml"
.Ft struct mbuf *
@@ -61,6 +64,8 @@ Insertion of a new mbuf at the end of the list.
.It
Removal of an mbuf from the head of the list.
.It
+Reinsertion of an mbuf at the head of the list.
+.It
Removal of the entire chain of mbufs on the list.
.El
.Bl -tag -width Ds
@@ -80,6 +85,12 @@ mbuf list.
Dequeue an mbuf from the front of the
.Fa ml
mbuf list.
+.It Fn "ml_requeue" "struct mbuf_list *ml" "struct mbuf *m"
+Enqueue mbuf
+.Fa m
+at the head of the
+.Fa ml
+mbuf list.
.It Fn "ml_dechain" "struct mbuf_list *ml"
Dequeues all mbufs from the
.Fa ml
@@ -124,6 +135,7 @@ Note that it is unsafe to modify the list while iterating over it.
.Fn ml_init ,
.Fn ml_enqueue ,
.Fn ml_dequeue ,
+.Fn ml_requeue ,
.Fn ml_dechain ,
.Fn ml_len ,
.Fn ml_empty ,
diff --git a/share/man/man9/mq_init.9 b/share/man/man9/mq_init.9
index 18d22fa13d5..9cd3537ffc1 100644
--- a/share/man/man9/mq_init.9
+++ b/share/man/man9/mq_init.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mq_init.9,v 1.1 2015/06/17 06:24:46 mpi Exp $
+.\" $OpenBSD: mq_init.9,v 1.2 2015/08/14 05:25:29 dlg Exp $
.\"
.\" Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
.\"
@@ -14,13 +14,14 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 17 2015 $
+.Dd $Mdocdate: August 14 2015 $
.Dt MQ_INIT 9
.Os
.Sh NAME
.Nm mq_init ,
.Nm mq_enqueue ,
.Nm mq_dequeue ,
+.Nm mq_requeue ,
.Nm mq_enlist ,
.Nm mq_delist ,
.Nm mq_dechain ,
@@ -38,6 +39,8 @@
.Ft struct mbuf *
.Fn "mq_dequeue" "struct mbuf_queue *mq"
.Ft int
+.Fn "mq_requeue" "struct mbuf_queue *mq" "struct mbuf *m"
+.Ft int
.Fn "mq_enlist" "struct mbuf_queue *mq" "struct mbuf_list *ml"
.Ft void
.Fn "mq_delist" "struct mbuf_queue *mq" "struct mbuf_list *ml"
@@ -78,6 +81,8 @@ Insertion of a new mbuf at the end of the queue.
.It
Removal of an mbuf from the head of the queue.
.It
+Reinsertion of an mbuf at the head of the queue.
+.It
Removal of the entire chain of mbufs on the queue.
.It
Insertion of the mbufs in an mbuf_list at the end of the queue.
@@ -88,14 +93,14 @@ Removal of all the mbufs on the queue as an mbuf_list.
.It Fn "mq_init" "struct mbuf_queue *mq" "unsigned int maxlen" "int ipl"
Initialises the mbuf queue structure
.Fa mq .
-The maximum number of mbufs that can be queued is specified with
+The maximum number of mbufs that should be queued is specified with
.Fa maxlen .
The highest interrupt priority level the queue will be operated at is
specified via
.Fa ipl .
.It Fn "MBUF_QUEUE_INITIALIZER" "unsigned int maxlen" "int ipl"
Initialises an mbuf queue structure declaration.
-The maximum number of mbufs that can be queued is specified with
+The maximum number of mbufs that should be queued is specified with
.Fa maxlen .
The highest interrupt priority level the queue will be operated at is
specified via
@@ -110,6 +115,14 @@ mbuf queue.
Dequeue an mbuf from the front of the
.Fa mq
mbuf queue.
+.It Fn "mq_requeue" "struct mbuf_queue *mq" "struct mbuf *m"
+Enqueue mbuf
+.Fa m
+at the head of the
+.Fa mq
+mbuf queue.
+Note, this operation will succeed even if it will cause the queue to exceed its
+maximum length.
.It Fn "mq_enlist" "struct mbuf_queue *mq" "struct mbuf_list *ml"
Enqueue all the mbufs on the
.Fa ml
@@ -161,7 +174,7 @@ if the
.Fa mq
mbuf queue was too full.
.It Fn "mq_set_maxlen" "struct mbuf_queue *mq" "unsigned int"
-Alter the maximum number of mbufs that can be queued on the
+Alter the maximum number of mbufs that should be queued on the
.Fa mq
mbuf queue.
Note,
@@ -173,6 +186,7 @@ already exist on the queue.
.Fn mq_init ,
.Fn mq_enqueue ,
.Fn mq_dequeue ,
+.Fn mq_requeue ,
.Fn mq_enlist ,
.Fn mq_delist ,
.Fn mq_dechain ,
@@ -215,6 +229,10 @@ returns 0 if the mbuf was successfully queued, or non-zero if the
mbuf was freed because it would cause the queue to exceed its maximum
length.
.Pp
+.Fn mq_requeue
+returns non-zero if the mbuf queue is now full, otherwise 0.
+length.
+.Pp
.Fn mq_enlist
returns the number of mbufs that were dropped from the list if the
length of the queue exceeded its maximum length.