Skip to content

Commit

Permalink
forcedeth: fix rx-work condition in nv_rx_process_optimized() too
Browse files Browse the repository at this point in the history
The merge of my previous fix to forcedeth.c,
bcb5feb, lost an important hunk.

We need to fix nv_rx_process_optimized() too, as it contains duplicate logic.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ingo Molnar authored and Jeff Garzik committed Oct 18, 2007
1 parent d85714d commit c1b7151
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,13 +2408,13 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
struct fe_priv *np = netdev_priv(dev);
u32 flags;
u32 vlanflags = 0;
u32 rx_processed_cnt = 0;
int rx_work = 0;
struct sk_buff *skb;
int len;

while((np->get_rx.ex != np->put_rx.ex) &&
!((flags = le32_to_cpu(np->get_rx.ex->flaglen)) & NV_RX2_AVAIL) &&
(rx_processed_cnt++ < limit)) {
(rx_work < limit)) {

dprintk(KERN_DEBUG "%s: nv_rx_process_optimized: flags 0x%x.\n",
dev->name, flags);
Expand Down Expand Up @@ -2517,9 +2517,11 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
np->get_rx.ex = np->first_rx.ex;
if (unlikely(np->get_rx_ctx++ == np->last_rx_ctx))
np->get_rx_ctx = np->first_rx_ctx;

rx_work++;
}

return rx_processed_cnt;
return rx_work;
}

static void set_bufsize(struct net_device *dev)
Expand Down

0 comments on commit c1b7151

Please sign in to comment.