lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] again... Zero Copy Ethernet interface


From: Alain M.
Subject: Re: [lwip-devel] again... Zero Copy Ethernet interface
Date: Wed, 07 Jan 2009 19:04:44 -0200
User-agent: Thunderbird 2.0.0.17 (X11/20080914)


address@hidden escreveu:
Nice list. I guess the hook method is quite a nice start for a generic solution: I can't see how we can easily cover all of the above.

Actualy I have one suggestion that might covver all those and future ones too...

Create a set of fuctions to be implemented in each port, to allocate, release and delete pbufs.
- There should be flags or different functions fot TX/RX
- there should be provision of the case where a TX pbuf is relased after DMA is completed - there should be provision for reentrancy in all this because most will be happening inside IRQs. - maybe a few parameters can be available even if they are not used in the refference implementation

The the standard implementation is just what happens today using malloc() and can be a reasonable example to make a first working version...

In addition to the hooks we could/should provide:
a) an example or template implementation of a relocatable pool to allocate memory from a specific predefined region,
b) a flag if a pbuf is allocated for RX or for TX and
c) an example or ready-to-use routine to be used in low_level_output() that can copy a pbuf to new pbufs if the originals cannot be used

The seldom cases where an RX pbuf is reused for TX can be solved by c).

Although this is not a complete solution for zero-copy, it would allow many users for zero-copy DMA which currently have to change the lwIP core code to get that.

I like more the modular approach, that is because those things are getting too complex, too fast.

If over time o suitable set of pbuf functions can be found, it would be easy to port. Something like AllocTxPbuf, AllocRxPbuf, FreeTxPbuf... and so on.

Alain





reply via email to

[Prev in Thread] Current Thread [Next in Thread]