[patch 2.6.14-rc3] epic100: fix counting of work_done in epic_poll

From: John W. Linville (linville_at_tuxdriver.com)
Date: 10/19/05

  • Next message: John W. Linville: "[patch 2.6.14-rc3 1/3] sundance: remove if (1) { ... } block in sundance_probe1"
    Date:	Tue, 18 Oct 2005 21:31:01 -0400
    To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
    
    

    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>

    ---
     drivers/net/epic100.c |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
    --- a/drivers/net/epic100.c
    +++ b/drivers/net/epic100.c
    @@ -1334,7 +1334,7 @@ static void epic_rx_err(struct net_devic
     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);
     
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: John W. Linville: "[patch 2.6.14-rc3 1/3] sundance: remove if (1) { ... } block in sundance_probe1"

    Relevant Pages

    • wait_event and preemption in 2.6
      ... I'm writing a device driver for PPC Linux and I'm using wait_event. ... preemption is turned on. ... check the condition and break out of the loop. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] NULL pointer deref in tcp_do_twkill_work()
      ... Shouldn't the loop always restart from the beginning instead of using the ... The alternative is to not drop the lock, but I'm guessing we need to do ... Proposed patch is attached. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • x86 build issue with software suspend code
      ... collision and the relocation from and alloc section targeting targeting ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 2.6.9-rc2-mm1 0/2] mm: memory policy for page cache allocation
      ... Patches done with the 'diff -p' option are slightly easier to ... Could you explain the for loop in alloc_page_roundrobin? ... pseudo-uniform distribution, without any need for the additional rr_next ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Fw: x86 build issue with software suspend code
      ... since otherwise problems with this code path should have been ... > incorrectly line wrapped) patch changes the attributes of the section to ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)