This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
freebsd buffer sizes
- From: Will Wagner <will_wagner at carallon dot com>
- To: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 12 Oct 2007 18:43:52 +0100
- Subject: [ECOS] freebsd buffer sizes
Hi All,
Been reviewing the memory buffers for networking on my board.
It seems like the default rules for memory buffer in freebsd_net.cdl is
wrong.
If you follow the default rules the total memory usage is
(256*1024)+(CYGPKG_NET_MAXSOCKETS*1024) and the net mempool ends up
being a quarter of that.
However with a large amount of sockets (I'm using 256) this will assert
on load as there is not enough memory in the net mempool. It seems like
for every socket you have the following allocated on startup by zinit:
176 bytes/socket for sockets
280 bytes/socket for udpcb
616 bytes/socket for tcpcb
280 bytes/socket for ripcb
Adding in other allocations when a socket gets created (this seems to be
200 - 300 bytes) this is well over the 256 bytes/socket the cdl allows.
It seems like it would be more reasonable to allocate 2k/socket for net
mempool. Does that make sense?
At the very least the cdl needs changing as it claims that the current
defaults will always allow the network code to start up and this is not
correct.
Not sure what values you need for mbufs & clusters, for now I am running
with the default rules and it seems to be working.
Regards,
Will
--
------------------------------------------------------------------------
Will Wagner will_wagner@carallon.com
Senior Project Engineer Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss