[En-Nut-Discussion] NETBUF handling
dferbas at etech.cz
Fri Jun 5 22:20:16 CEST 2009
Hi Nathan & Harald,
If there are plans to do st with network buffers, I wish to have a
possibility to preallocate a space for whole packet.
I understand, that you want to save RAM space, so I checked all
places, where NutNetBufAlloc() is called.
In most cases the length of a packet is known prior to first alolocation.
There can be a modification, that will allocate a contiguous area and
setting all following bits + a NBAF_CONTIG
NBAF_APPLICATION | NBAF_TRANSPORT | NBAF_NETWORK | NBAF_DATALINK
An ethernet driver with DMA can benefit from this.
Also 1 call for allocation.
What do you think ?
At 11:24 5.6.2009, you wrote:
> > Today fatal errors occur almost never. May be it's the right time to
> > change this weird NETBUF handling now.
>This would make it much easier for other people to work on networking code.
>I had thought about using a linked list or tree-like structure for
>netbufs (maybe even
>with reference counting and garbage collection). That would be a
>but would allow for more than the current 4 layer model, and cloning
>just be aliasing them at the layer that you were interested in --
>handling of broadcast would just pass the same netbuf head to all
>and they would all generate their own headers for the same IP packet.
More information about the En-Nut-Discussion