This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Meaning of Mbuf statistics
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: chandrag at danlawinc dot com
- Cc: eCos Disuss <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 14 Jan 2002 09:39:28 +0100
- Subject: Re: [ECOS] Meaning of Mbuf statistics
- References: <3C3FC0EA.1F2A8812@danlawinc.com>
On Sat, Jan 12, 2002 at 10:21:54AM +0530, chandrag@danlawinc.com wrote:
> Hi,
>
> When I print the statistics of mbufs by calling the routine
> cyg_kmem_print_stats(), from a network test program I got the
> following.
>
> -------------------------------------------------------
> Network stack mbuf stats:
> mbufs 2, clusters 2, free clusters 2
> Failed to get 0 times
> Waited to get 0 times
> Drained queues to get 0 times
> Misc mpool: total 65520, free 62560, max free block 61604
> Mbufs pool: total 65408, free 65024, blocksize 128
> Clust pool: total 131072, free 124928, blocksize 2048
> -------------------------------------------------------
>
> Can anybody explain the meaning of the line
> 'mbufs 2, clusters 2, free clusters 2'?
mbufs are memory buffers used to hold parts of network packets. An
mbuf is quite small, 128 bytes. It contains a header and then
something like 100 bytes of data storage. You can chain them together
to form bigger storage area's or you can use a cluster. A cluster is
just a 2Kbytes buffer. A cluster can be linked to an mbuf. When this
happens the data is stored only in the cluster and not the mbuf.
This line is saying that currently two mbufs have been allocated from
the pool. Also 2 clusters have also been allocated. The free clusters
value is confusing. Clusters are not returned to the pool. Instead
they are placed on a linked list. This is saying there are two
clusters on this linked list of unused clusters.
Andrew