Changeset 35942


Ignore:
Timestamp:
2013-03-10T19:25:16+01:00 (5 years ago)
Author:
nbd
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c

    r35941 r35942  
    707707        } 
    708708 
    709         cns3xxx_alloc_rx_buf(sw, received); 
    710  
    711         rx_ring->cur_index = i; 
    712  
    713         if (received != budget) { 
     709        if (!received) { 
    714710                napi_complete(napi); 
    715711                enable_irq(IRQ_CNS3XXX_SW_R0RXC); 
    716712        } 
     713 
     714        cns3xxx_alloc_rx_buf(sw, received); 
     715 
     716        rx_ring->cur_index = i; 
    717717 
    718718        wmb(); 
Note: See TracChangeset for help on using the changeset viewer.