My understanding is zero copy for send operation is very difficoult with actual lwip implementation... so, at the first, i'll be happy to solve problem for RX packet
Jared, if you can share your driver implementation with me, it will be useful for sure, thanks in advance!
As also mentioned in the past, outgoing zero copy is more
difficult because lwIP wants to free the pbuf after the call to low_level_output
and this could happen before the DMA transfer has occurred. Maybe I have
this wrong but I recall some complication in regards to sending data.
I cannot imagine a implementation for sending operation using zero copy...
i can see TWO problems:
- first, as already someone said above, i have to solve problem of lwip which wants to free pbuf after low_level_output... a solution could be (if a RTOS is used) waiting on semaphore until emac isr unlocks it, after DMA sending packet. In this way CPU will be avalaible for other tasks (threads) during DMA sending
- second (correlated to similar problem for rx), when lwip send a packet, this is allocated in pbuf RAM, in lwip heap, (if i'm right...), but, again, my DMA wants packet in specific region (emac RAM)... so, pbuf ram needs relocation in fixed memory region too, but i think is difficoult to change lwip code for this...
Thanks to all for interesting discussion here...
other comment will be appreciated.
Bye
Piero