• Benjamin Herrenschmidt's avatar
    ftgmac100: Rework NAPI & interrupts handling · 10cbd640
    Benjamin Herrenschmidt authored
    First, don't look at the interrupt status in the poll loop
    to decide what to poll. It's wrong. If we have run out of
    budget, we may still have RX packets to unqueue but no more
    RX interrupt pending.
    
    So instead move the code looking at the interrupt status
    into the interrupt handler where it belongs. That avoids a slow
    MMIO read in the NAPI fast path. We keep the abnormal interrupts
    enabled while NAPI is scheduled.
    
    While at it, actually do something useful in the "error" cases:
    
    On AHB bus error, trigger the new reset task, that's about all
    we can do. On RX packet fifo or descriptor overflows, we need
    to restart the MAC after having freed things up. So set a flag
    that NAPI will see and use to perform that restart after
    harvesting the RX ring.
    
    Finally, we shouldn't complete NAPI if there are still outgoing
    packets that will need harvesting. Waiting for more interrupts
    is less efficient than letting NAPI run a while longer while
    the queue drains.
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    10cbd640
ftgmac100.c 39.9 KB