Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122763
b: refs/heads/master
c: 4219988
h: refs/heads/master
i:
  122761: 204b35b
  122759: 634bb43
v: v3
  • Loading branch information
Andy Fleming authored and David S. Miller committed Dec 18, 2008
1 parent 31055a0 commit bb57490
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c7396aebb68994c0519e438eecdf4d5fa9c7844
refs/heads/master: 42199884594bc336c9185441cbed99a9324dab34
14 changes: 9 additions & 5 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,8 @@ static int gfar_poll(struct napi_struct *napi, int budget)
{
struct gfar_private *priv = container_of(napi, struct gfar_private, napi);
struct net_device *dev = priv->dev;
int howmany;
int tx_cleaned = 0;
int rx_cleaned = 0;
unsigned long flags;

/* Clear IEVENT, so interrupts aren't called again
Expand All @@ -1852,13 +1853,16 @@ static int gfar_poll(struct napi_struct *napi, int budget)

/* If we fail to get the lock, don't bother with the TX BDs */
if (spin_trylock_irqsave(&priv->txlock, flags)) {
gfar_clean_tx_ring(dev);
tx_cleaned = gfar_clean_tx_ring(dev);
spin_unlock_irqrestore(&priv->txlock, flags);
}

howmany = gfar_clean_rx_ring(dev, budget);
rx_cleaned = gfar_clean_rx_ring(dev, budget);

if (howmany < budget) {
if (tx_cleaned)
return budget;

if (rx_cleaned < budget) {
netif_rx_complete(dev, napi);

/* Clear the halt bit in RSTAT */
Expand All @@ -1878,7 +1882,7 @@ static int gfar_poll(struct napi_struct *napi, int budget)
}
}

return howmany;
return rx_cleaned;
}

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down

0 comments on commit bb57490

Please sign in to comment.