[PATCH] epic100: fix counting of work_done in epic_poll
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 19 Oct 2005 01:31:01 +0000 (21:31 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 19 Oct 2005 02:26:01 +0000 (22:26 -0400)
work_done is overwritten each time through the rx_action loop in
epic_poll.  This screws-up the NAPI accounting if the loop is executed
more than once.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/epic100.c

index 87f522738bfcb718b63526450844f696bd750181..f119ec4e89ea3702e22f15f3dfda948e61f9bad3 100644 (file)
@@ -1334,7 +1334,7 @@ static void epic_rx_err(struct net_device *dev, struct epic_private *ep)
 static int epic_poll(struct net_device *dev, int *budget)
 {
        struct epic_private *ep = dev->priv;
-       int work_done, orig_budget;
+       int work_done = 0, orig_budget;
        long ioaddr = dev->base_addr;
 
        orig_budget = (*budget > dev->quota) ? dev->quota : *budget;
@@ -1343,7 +1343,7 @@ rx_action:
 
        epic_tx(dev, ep);
 
-       work_done = epic_rx(dev, *budget);
+       work_done += epic_rx(dev, *budget);
 
        epic_rx_err(dev, ep);