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
This commit is contained in:
Felix Fietkau 2013-03-10 18:25:16 +00:00
parent c1adc79328
commit c44506fcbd

View file

@ -706,15 +706,15 @@ static int eth_poll(struct napi_struct *napi, int budget)
} }
} }
cns3xxx_alloc_rx_buf(sw, received); if (!received) {
rx_ring->cur_index = i;
if (received != budget) {
napi_complete(napi); napi_complete(napi);
enable_irq(IRQ_CNS3XXX_SW_R0RXC); enable_irq(IRQ_CNS3XXX_SW_R0RXC);
} }
cns3xxx_alloc_rx_buf(sw, received);
rx_ring->cur_index = i;
wmb(); wmb();
enable_rx_dma(sw); enable_rx_dma(sw);