diff options
author | Erik Waling <erik.waling@konftel.com> | 2009-04-15 19:32:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-17 04:30:34 -0400 |
commit | f72f550c5885419ee1b32f47213087e6640e766b (patch) | |
tree | 312d614efcb30f54ea609d2a48315faad5190047 /drivers/net/macb.c | |
parent | ee33c58541bae92669fe64a39f695ab533d0de14 (diff) |
macb: process the RX ring regardless of interrupt status
Suppose that we receive lots of frames, start processing them, but
exhaust our budget so that we return before we had a chance to look
at all of them.
Then, when the network layer calls us again, we will only continue
processing the buffers if the REC bit was set in the mean time, which it
might not be if there was a brief pause in the flow of packets. If this
happens, we'll simply display a warning and call netif_rx_complete()
with potentially lots of unprocessed packets in the RX ring...
Fix this by scanning the ring no matter what flags are set in the
interrupt status register.
Signed-off-by: Erik Waling <erik.waling@konftel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r-- | drivers/net/macb.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 9fcc717f4d1a..e82aee41d77e 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -521,27 +521,10 @@ static int macb_poll(struct napi_struct *napi, int budget) | |||
521 | macb_writel(bp, RSR, status); | 521 | macb_writel(bp, RSR, status); |
522 | 522 | ||
523 | work_done = 0; | 523 | work_done = 0; |
524 | if (!status) { | ||
525 | /* | ||
526 | * This may happen if an interrupt was pending before | ||
527 | * this function was called last time, and no packets | ||
528 | * have been received since. | ||
529 | */ | ||
530 | napi_complete(napi); | ||
531 | goto out; | ||
532 | } | ||
533 | 524 | ||
534 | dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n", | 525 | dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n", |
535 | (unsigned long)status, budget); | 526 | (unsigned long)status, budget); |
536 | 527 | ||
537 | if (!(status & MACB_BIT(REC))) { | ||
538 | dev_warn(&bp->pdev->dev, | ||
539 | "No RX buffers complete, status = %02lx\n", | ||
540 | (unsigned long)status); | ||
541 | napi_complete(napi); | ||
542 | goto out; | ||
543 | } | ||
544 | |||
545 | work_done = macb_rx(bp, budget); | 528 | work_done = macb_rx(bp, budget); |
546 | if (work_done < budget) | 529 | if (work_done < budget) |
547 | napi_complete(napi); | 530 | napi_complete(napi); |
@@ -550,7 +533,6 @@ static int macb_poll(struct napi_struct *napi, int budget) | |||
550 | * We've done what we can to clean the buffers. Make sure we | 533 | * We've done what we can to clean the buffers. Make sure we |
551 | * get notified when new packets arrive. | 534 | * get notified when new packets arrive. |
552 | */ | 535 | */ |
553 | out: | ||
554 | macb_writel(bp, IER, MACB_RX_INT_FLAGS); | 536 | macb_writel(bp, IER, MACB_RX_INT_FLAGS); |
555 | 537 | ||
556 | /* TODO: Handle errors */ | 538 | /* TODO: Handle errors */ |