AnsweredAssumed Answered

p1020, linux Qoriq SDK v1.9, CRITICAL etsec gianfar driver patch

Question asked by Ivan Lukyanchuk on May 23, 2016

Hi, we used linux Qoriq SDK v1.4 with p1020 and had problem: p1020, linux Qoriq SDK v1.4, problem with etsec gianfar driver.  After that, we decide test last linux Qoriq SDK v1.9. And we again had a problem with net. I am not sure, that new problem is the same as old problem, therefore I create new question at this community forum.

Method that activate problem is same:

We connect from one PC to device 2 way. 1. Ping. 2. Cyclic download files from device to PC. We restart device every 20-30 min, and problem is activated several times during one day.

Problem: Device response to request only after it receive new request!

If several clients communicate with device, the net work slowly unlike usual. If we run only one ping, then we have response to few requests with seconds pause. These responses send only when the ARP packets receved. See wireshark log 1.pcap.

I analize the problem, debug gianfar driver and find critical bug. I create and test the patch which solve the problem.

Patch description.

Function gfar_clean_rx_ring() contain error. Code contain parallel long time iterations for BDPs and SKBs. And these iterations not assosiated with each other. BDPs iterate by next_bd(). SKBs iterate by rx_queue->skb_currx++. If these iterations work synchronous than all is ok. But in some moment SKBs iteration become behind from BDPs iteration (may be synchronisation errors exists). And, after that, gianfar send up to core net stack previous received packet, not last.

Solution.

Use only one BDPs iteration, and replace rx_queue->skb_currx to (bdp - base). Exclude rx_queue->skb_currx from code.

Original Attachment has been moved to: 1.pcap.zip

Original Attachment has been moved to: gianfar.patch.zip

Original Attachment has been moved to: radius_oe.dts.zip

Original Attachment has been moved to: radius_defconfig.zip

Outcomes