Commit Graph

13 Commits

Author SHA1 Message Date
Felix Fietkau
8665c57923 cns3xxx: ethernet - clean up tx descs only when needed
We already clean up tx descriptors in the napi eth_poll() function so it
would likely be rare to run out of available descriptors in eth_xmit. Thus
we can clean them up only when needed and return busy only when we
still don't have enough.

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

SVN-Revision: 39762
2014-02-27 23:02:43 +00:00
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
Felix Fietkau
bd6c9d6252 cns3xxx: ethernet - clean the tx ring before refilling the rx ring to reduce memory pressure
SVN-Revision: 35953
2013-03-11 02:29:53 +00:00
Felix Fietkau
d7a529709a cns3xxx: ethernet - clean the tx ring only in the poll function, not in the xmit handler
SVN-Revision: 35952
2013-03-11 02:29:47 +00:00
Felix Fietkau
0d13baff1e cns3xxx: increase number of ethernet driver rx buffers
SVN-Revision: 35951
2013-03-10 21:59:32 +00:00
Felix Fietkau
ee2b511e1f cns3xxx: prevent the ethernet driver from accessing uninitialized dma descriptor entries
SVN-Revision: 35950
2013-03-10 21:59:28 +00:00
Felix Fietkau
d22ac8d8fb cns3xxx: minor ethernet driver cleanup
SVN-Revision: 35949
2013-03-10 21:59:21 +00:00
Felix Fietkau
9facda9570 cns3xxx: use kmalloc instead of kzalloc for ethernet rx buffers
SVN-Revision: 35943
2013-03-10 18:25:20 +00:00
Felix Fietkau
c44506fcbd cns3xxx: fix an rx irq handling corner case
When an rx interrupt comes in, rx interrupts are disabled and NAPI
polling is scheduled. During the NAPI poll, the driver first processes
received frames in the ring, then fills the dma descriptor slots with
new buffers and calls tx complete, before finally re-enabling rx
interrupts and completing NAPI (if below the budget).
If the hardware rx queue overflows before the napi complete is called,
the hardware will not throw any further rx interrupts and rx processing
stops completely.
Fix this by keeping NAPI polling scheduled until it completes a poll
without receiving any packets, and also handle NAPI completion before
refilling rx or completing tx.

SVN-Revision: 35942
2013-03-10 18:25:16 +00:00
Felix Fietkau
c1adc79328 cns3xxx: fix ethernet driver memory barrier usage
SVN-Revision: 35941
2013-03-10 18:25:11 +00:00
Felix Fietkau
446409f43e cns3xxx: reduce buffer allocation size to 2048 bytes, improves ethernet performance
SVN-Revision: 35917
2013-03-10 01:27:04 +00:00
Felix Fietkau
95f14d052a cns3xxx: add linux 3.8 support and use it by default
SVN-Revision: 35908
2013-03-09 18:51:46 +00:00
Luka Perkov
e38adfc912 cns3xxx: convert ethernet patches to files
SVN-Revision: 34161
2012-11-11 20:03:56 +00:00