Skip to content

Commit

Permalink
amd8111e: Fix rx return code
Browse files Browse the repository at this point in the history
The amd8111e rx poll routine currently mishandles the case when we
process exactly the number of packets specified in the budget.

This patch is basically as suggested by David Miller.

Signed-off-by: Chris Friesen <cfriesen@nortel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chris Friesen authored and David S. Miller committed Oct 28, 2008
1 parent 8827166 commit 48e5eca
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/net/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)

} while(intr0 & RINT0);

/* Receive descriptor is empty now */
spin_lock_irqsave(&lp->lock, flags);
__netif_rx_complete(dev, napi);
writel(VAL0|RINTEN0, mmio + INTEN0);
writel(VAL2 | RDMD0, mmio + CMD0);
spin_unlock_irqrestore(&lp->lock, flags);
if (rx_pkt_limit > 0) {
/* Receive descriptor is empty now */
spin_lock_irqsave(&lp->lock, flags);
__netif_rx_complete(dev, napi);
writel(VAL0|RINTEN0, mmio + INTEN0);
writel(VAL2 | RDMD0, mmio + CMD0);
spin_unlock_irqrestore(&lp->lock, flags);
}

rx_not_empty:
return num_rx_pkt;
Expand Down

0 comments on commit 48e5eca

Please sign in to comment.