HomeFreeBSD

mbuf: provide new type for mbuf manipulation - mbuf chain

Description

mbuf: provide new type for mbuf manipulation - mbuf chain

It tracks both the first mbuf and last mbuf, making it handy to use inside
functions that are interested in both. It also tracks length of data and
memory usage. It can be allocated on stack and passed to an mbuf
allocation or another mbuf manipulation function. It can be embedded into
some kernel facility internal structure representing most simple data
buffer. It uses modern queue(3) based linkage, but is also compatible with
old style m_next linkage. Transitioning older code to new type can be done
gradually - a code that doesn't understand the chain yet, can be supplied
with STAILQ_FIRST(&mc.mc_q). So you can have a mix of old style and new
style code in one function as a temporary solution.

Reviewed by: markj, tuexen
Differential Revision: https://reviews.freebsd.org/D44147

Details

Provenance
glebiusAuthored on Apr 8 2024, 8:16 PM
Reviewer
markj
Differential Revision
D44147: mbuf: provide new type for mbuf manipulation - mbuf chain
Parents
rG3b7aa842e27d: sendfile: mark it explicitly as a TCP only feature
Branches
Unknown
Tags
Unknown