[ECOS] CYGPKG_NET_MEM_USAGE in the FreeBSD stack cdl

Stanislav Meduna stano@meduna.org
Wed Feb 2 17:05:00 GMT 2011


Hi,

the formula for  CYGPKG_NET_MEM_USAGE in freebsd_net.cdl

  (256*1024)+(CYGPKG_NET_MAXSOCKETS*1024)

is IMHO completely bogus.

First, from my debugging it looks like the stack allocates
1352 bytes per socket:
- 176 for socket
- 280 for UDP
- 616 for TCP
- 280 for raw

Second, these things are allocated from an area of
CYGPKG_NET_MEMPOOL_SIZE, which is CYGPKG_NET_MEM_USAGE/4.

I don't understand the BSD stack enough to know what exactly
can be allocated and from where, but this is surely wrong -
the pool size expands 256 bytes per additional socket,
whereas it should be 1352 bytes per socket.

Anyone already tried to find the correct way of counting?

Regards
-- 
                              Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list