Forum Discussion
Altera_Forum
Honored Contributor
12 years agoActually 30Mbps is not bad already.
Yes, increasing the packet size will improve the bandwidth, as the CPU is spending a lot of time to process each packet, so the more data you can fit in one packet, the better. There are several things that can be done to make the system faster. The one with the most impact is to compile your software with optimizations (-O2). I haven't used Eclipse in a while, but it should be somewhere in the project C/C++ settings. Compiling the project in Release mode instead of Debug might be enough to enable the optimizations. But if you already have 30Mbps with so small packets, maybe you are already using optimizations? Other than that you can use some hardware improvements. If your CPU doesn't have data or instruction caches, enable them. Add to your SOPC/QSYS project a double port packet memory, with one port connected to the DMAs and another to the CPU through a tightly coupled data port. You will also need to change some parameters in the software driver, the procedure is explained in application note 440 (http://www.altera.com/literature/an/an440.pdf). There are other optimizations that can be done, but they are much harder. Once I used a software profiler to find which functions were most used, and placed them in a tightly coupled instruction memory. Together with the data optimization, I managed to get a 100MHz Nios II system to send or receive data at about 80-100Mb/s, but I really think it is the maximum you can obtain with this TCP/IP stack. 400Mb/s seems rather unrealistic. You could try to use the LwIP stack instead (I think you'll find some threads about this stack on the forum) or move to a hardware solution, as shown in the offload example on the wiki (http://www.alterawiki.com/wiki/nios_ii_udp_offload_example).