Deleted Added
sdiff udiff text old ( 152586 ) new ( 156756 )
full compact
1.\" Copyright (c) 2000 FreeBSD Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 8 unchanged lines hidden (view full) ---

17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/share/man/man9/mbuf.9 156756 2006-03-15 21:11:11Z sam $
26.\"
27.Dd March 15, 2006
28.Dt MBUF 9
29.Os
30.\"
31.Sh NAME
32.Nm mbuf
33.Nd "memory management in the kernel IPC subsystem"
34.\"
35.Sh SYNOPSIS

--- 91 unchanged lines hidden (view full) ---

127.Ft struct mbuf *
128.Fn m_split "struct mbuf *mbuf" "int len" "int how"
129.Ft int
130.Fn m_apply "struct mbuf *mbuf" "int off" "int len" "int (*f)(void *arg, void *data, u_int len)" "void *arg"
131.Ft struct mbuf *
132.Fn m_getptr "struct mbuf *mbuf" "int loc" "int *off"
133.Ft struct mbuf *
134.Fn m_defrag "struct mbuf *m0" "int how"
135.Ft struct mbuf *
136.Fn m_unshare "struct mbuf *m0" "int how"
137.\"
138.Sh DESCRIPTION
139An
140.Vt mbuf
141is a basic unit of memory management in the kernel IPC subsystem.
142Network packets and socket buffers are stored in
143.Vt mbufs .
144A network packet may span multiple

--- 738 unchanged lines hidden (view full) ---

883.Dv M_TRYWAIT
884or
885.Dv M_DONTWAIT ,
886depending on the caller's preference.
887.Pp
888This function is especially useful in network drivers, where
889certain long mbuf chains must be shortened before being added
890to TX descriptor lists.
891.It Fn m_unshare m0 how
892Create a version of the specified mbuf chain whose
893contents can be safely modified without affecting other users.
894If allocation fails and this operation can not be completed,
895.Dv NULL
896will be returned.
897The original mbuf chain is always reclaimed and the reference
898count of any shared mbuf clusters is decremented.
899.Fa how
900should be either
901.Dv M_TRYWAIT
902or
903.Dv M_DONTWAIT ,
904depending on the caller's preference.
905As a side-effect of this process the returned
906mbuf chain may be compacted.
907.Pp
908This function is especially useful in the transmit path of
909network code, when data must be encrypted or otherwise
910altered prior to transmission.
911.El
912.Sh HARDWARE-ASSISTED CHECKSUM CALCULATION
913This section currently applies to TCP/IP only.
914In order to save the host CPU resources, computing checksums is
915offloaded to the network interface hardware if possible.
916The
917.Va m_pkthdr
918member of the leading

--- 207 unchanged lines hidden ---