Altera_Forum
Honored Contributor
8 years agoAltera Cyclone V: UDP data transfer without packet loss
Dear all,
I am a newbie in Altera Cyclone V SOC. We are conducting a feasibility study on our Altera Cyclone V SOC. We are having some streaming data receiving at FPGA at 300 Megabits per second. We have to transfer this data without any packet loss to a server machine over WiFi connection. UDP client application works on Altera SOC and server application works on an Ubuntu desktop machine. Initially we tried out a sample UDP_client and UDP_Server application which sends hardcoded buffer of data [from user space only. Not data read from FPGA via kernel space] to measure the maximum data rate over WiFi. We got the range of 250Mbps to 500Mbps. [Without tuning and tuning some network parameters as suggested in the link [https://opensourceforu.com/2016/10/network-performance-monitoring/] We are running Angstrom Linux supplied by Altera (Linux kernel version 4.9). Two methods we have tried out already. Method 1:- FPGA is programmed to write the streaming data to DDR memory. We have written a character driver, tried out interrupt driven approach (one interrupt in every 1 ms). From the ISR, we have woke up a read() method of our character driver which copies the 30K buffer available in DDR memory in every 1ms to user space. (copy_to_user()). From the user application, we used sendto() method for UDP transfer. We found out that periodically packets gets lost. Method 2:- FPGA is programmed to write the streaming data to DDR memory every 1ms to a reserved 1MB space and a register is available which tracks the number of packets already written (Erase on read type programmed). Character driver is written to access the DDR memory. User application in every 10ms issues a IOCTL to read the register storing number of packets available, copies the available packets to user space using read(). copy_to_user() mechanism at kernel side. Split the buffer received in chunks of one packet. (30K buffer send via UDP in a for loop). we used sendto() method for UDP transfer. We found out that periodically packets gets lost. Again we found packets gets lost at server side. Please share your valuable thoughts on this. Are we going in the right direction? Are there any better methods to attack this problem? Does any zero copy / mmap the kernel buffer solve this issue? Or are there any techniques to avoid the multiple overhead of kernel space/user space transition so that data can be sent directly via UDP? Please help.. We are now almost blocked.. Looking forward to hear from you soon. Thank you, Lullaby