site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com chas williams - CONTRACTOR writes:
is this definition for MINCLSIZE right?
from sys/mbuf.h:
/* * Mbufs are of a single size, MSIZE (machine/param.h), which * includes overhead. An mbuf may add a single "mbuf cluster" of size * MCLBYTES (also in machine/param.h), which has no additional overhead * and is used instead of the internal data area; this is done when * at least MINCLSIZE of data must be stored. */
#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ #define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
#define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
based on the usage (and description) of MINCLSIZE i would guess it should be closer to MHLEN + 1. MHLEN + MLEN is essentially 2 * MSIZE which will not fit inside a single mbuf?
Mbufs may also be chained. You can easily encounter an mbuf chain of multiple mbufs of any type. For MINCLSIZE, I think the rationale is that it is cheaper, and wastes less space to allocate another mbuf and chain them than it does to allocate a cluster. Drew _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrew Gallatin