openwrtv3/target/linux/cns3xxx
Felix Fietkau 96eb3d883d cns3xxx: ethernet - resolve SMP issue
The combination of r35942 and r35952 causes an issue where eth_schedule_poll()
can be called from a different CPU between the call to napi_complete() and the
setting of cur_index which can break the rx ring accounting and cause ethernet
latency and/or ethernet stalls.  The issue can be easilly created by adding
a couple of artificial delays such as:

@@ -715,6 +715,7 @@ static int eth_poll(struct napi_struct *napi, int budget)

 	if (!received) {
 		napi_complete(napi);
+udelay(1000);
 		enable_irq(IRQ_CNS3XXX_SW_R0RXC);
 	}

@@ -727,6 +728,7 @@ static int eth_poll(struct napi_struct *napi, int budget)
 	rx_ring->cur_index = i;

 	wmb();
+udelay(1000);
 	enable_rx_dma(sw);

 	return received;

This patch moves the setting of cur_index back up where it needs to be and
addresses the original corner case that r35942 was trying to catch in an
improved fashion by checking to see if the rx descriptor ring has become
full before interrupts were re-enabled so that a poll can be scheduled again
and avoid an rx stall caused by rx interrupts ceasing to fire again.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

SVN-Revision: 39761
2014-02-27 23:02:37 +00:00
..
base-files cns3xxx: disable CONFIG_PROC_STRIPPED and add an init script to set the ethernet cpu affinity (improves lan<->wlan bridging performance) 2013-03-10 01:01:51 +00:00
files cns3xxx: ethernet - resolve SMP issue 2014-02-27 23:02:37 +00:00
image add uImage image build 2013-11-10 09:57:07 +00:00
patches-3.8 cns3xxx: fix USB ehci/ohci platform driver 2013-04-10 16:20:50 +00:00
config-3.8 cns3xxx: disable CONFIG_PROC_STRIPPED and add an init script to set the ethernet cpu affinity (improves lan<->wlan bridging performance) 2013-03-10 01:01:51 +00:00
Makefile build: unify arm target cflags 2013-09-26 17:53:20 +00:00