Forum Discussion
Altera_Forum
Honored Contributor
7 years agoHi Daixiwen,
Thank you for your valuable response. We understood the point regarding transmission side. A slight update based on our latest analysis results. We have put a long run of our test code commenting out the data transmission porting. That means from a user thread in a 10ms period, call the read() [Kernel side - copy_to_user()] for a fixed size bytes. Check the circular buffer usage at this time. We understood that circular buffer overflow happens at this time. 1st reason of our packet loss is we can't handle the data copy within data generation speed. We need to understand whether copy_to_user() is the real culprit. To confirm this, we have put another overnight test where we measure the read() API time taken with gettimeofday() API like the following. while(1) { ... gettimeofday(start) read() //fixed size buffer gettimeofday() printf(elapsedtime); } From this we understood, elapsed time varies from 2ms to 14ms for a fixed size 300K buffer. We doubt this is the scheduling latency at different layers + fixed overhead of memcpy that is causing this issue. Hence we are trying to change our design to interrupt driven approach using memory mapping. Please share your valuable thoughts on this.. We will update you with our findings meanwhile. Thank you, Lullaby