Forum Discussion
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- Hi guys, I've defitivatelly achieved 58Mbps sending images by UDP, it suposes for me a data transfer of 41fps. lwip 1.4 Optimization -O3 DMA isntead of memcopy's TSE-SGMA Small Mac 10/100Mb Nios /f @ 100Mhz Cyclone III 3c40 Quartus II v8.0sp1 --- Quote End --- Alberto! Probably you can achieve better speed if you avoid memory copy completely. I found out that ROM-type pbufs are very handy for this. If you preallocate single ROM-type pbuf, than you only need to set its payload pointer, len and tot_len fields for each packet transfer. On my board this approach gives 210M (decimal M) throughput for transfers from external SDRAM. Further, to avoid memory allocations inside lwIP, you can preallocate RAM-type pbuf for headers, ROM-type pbuf for payload and chain them together. This allows 250M throughput. Finally, you can set-up the DMA, which delivers your data into memory, to leave space for a pbuf structure and headers in front of the payload and use this space for single RAM-type pbuf. This allows 280M on my board. You may see attached file for example. The benchmark, as previously, runs with original Bill's example upgraded to lwIP1.4.0_rc1. UDP payload size is 1472 bytes, no checksum. In my project I use hardware UDP offloading for main data stream. (In fact, thanks to freely available IP cores from offloading example (#36 (http://alteraforum.org/forum/showpost.php?p=100189&postcount=36)), hardware solution is even easier to implement). All outgoing packets are copied by dedicated SGDMA channel into large circular buffer in external SDRAM for retransmission upon receiver's request. I haven't implemented top-level protocol yet, and currently just retransmit all the packets from the buffer through lwIP to another UDP port for benchmarking. Best regards, Igor