1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Document the m_defrag function. (Mostly copied from the description

in uipc_mbuf.c)
This commit is contained in:
Mike Silbersack 2004-04-01 06:50:21 +00:00
parent 5eb09c7066
commit a61bc764ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127701

View File

@ -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.