mbuf.9 (152586) | mbuf.9 (156756) |
---|---|
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.\" | 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 152586 2005-11-18 17:04:49Z andre $ | 25.\" $FreeBSD: head/share/man/man9/mbuf.9 156756 2006-03-15 21:11:11Z sam $ |
26.\" | 26.\" |
27.Dd November 18, 2005 | 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" | 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" |
|
135.\" 136.Sh DESCRIPTION 137An 138.Vt mbuf 139is a basic unit of memory management in the kernel IPC subsystem. 140Network packets and socket buffers are stored in 141.Vt mbufs . 142A network packet may span multiple --- 738 unchanged lines hidden (view full) --- 881.Dv M_TRYWAIT 882or 883.Dv M_DONTWAIT , 884depending on the caller's preference. 885.Pp 886This function is especially useful in network drivers, where 887certain long mbuf chains must be shortened before being added 888to TX descriptor lists. | 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. |
|
889.El 890.Sh HARDWARE-ASSISTED CHECKSUM CALCULATION 891This section currently applies to TCP/IP only. 892In order to save the host CPU resources, computing checksums is 893offloaded to the network interface hardware if possible. 894The 895.Va m_pkthdr 896member of the leading --- 207 unchanged lines hidden --- | 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 --- |