summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2004-04-01 06:50:21 +0000
committersilby <silby@FreeBSD.org>2004-04-01 06:50:21 +0000
commit5a95a9a0f2874b87d3e970726c39ea8c387c73e0 (patch)
treef7e07363fb7da4a48c9c6a6593be770167b5cb1b /share
parentd976b2d5bf16cbcc0c50d98ce5ac052919ba8080 (diff)
downloadFreeBSD-src-5a95a9a0f2874b87d3e970726c39ea8c387c73e0.zip
FreeBSD-src-5a95a9a0f2874b87d3e970726c39ea8c387c73e0.tar.gz
Document the m_defrag function. (Mostly copied from the description
in uipc_mbuf.c)
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/mbuf.918
1 files changed, 18 insertions, 0 deletions
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 3bf02d7..d1d5d46 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -126,6 +126,8 @@
.Fn m_apply "struct mbuf *mbuf" "int off" "int len" "int (*f)(void *arg, void *data, u_int len)" "void *arg"
.Ft struct mbuf *
.Fn m_getptr "struct mbuf *mbuf" "int loc" "int *off"
+.Ft struct mbuf *
+.Fn m_defrag "struct mbuf *m0" "int how"
.\"
.Sh DESCRIPTION
An
@@ -806,6 +808,22 @@ bytes from the beginning of the
.Vt mbuf chain .
The corresponding offset into the mbuf will be stored in
.Fa *off .
+.It Fn m_defrag m0 how
+Defragment a mbuf chain, returning the shortest possible
+chain of mbufs and clusters. If allocation fails and this can
+not be completed, NULL will be returned and the original chain
+will be unchanged. Upon success, the original chain will be
+freed and the new chain will be returned.
+.Fa how
+should be either
+.Dv M_TRYWAIT
+or
+.Dv M_DONTWAIT ,
+depending on the caller's preference.
+.Pp
+This function is especially useful in network drivers, where
+certain long mbuf chains must be shortened before being added
+to TX descriptor lists.
.El
.Sh HARDWARE-ASSISTED CHECKSUM CALCULATION
This section currently applies to TCP/IP only.
OpenPOWER on IntegriCloud