[patch 17/21] drivers/net: starfire: Fix napi ->poll() weighthandling

From: Greg KH
Date: Mon Jan 12 2009 - 20:35:50 EST


2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jarek Poplawski <jarkao2@xxxxxxxxx>

commit 9a3de25544dadab1971847f28f33b1cd0d1770a6 upstream.

starfire napi ->poll() handler can return work == weight after calling
netif_rx_complete() (if there is no more work). It is illegal and this
patch fixes it.

Reported-by: Alexander Huemer <alexander.huemer@xxxxxxxxx>
Tested-by: Alexander Huemer <alexander.huemer@xxxxxxxxx>
Signed-off-by: Jarek Poplawski <jarkao2@xxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Rafael J. Wysocki <rjw@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/net/starfire.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1509,6 +1509,11 @@ static int __netdev_rx(struct net_device
desc->status = 0;
np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE;
}
+
+ if (*quota == 0) { /* out of rx quota */
+ retcode = 1;
+ goto out;
+ }
writew(np->rx_done, np->base + CompletionQConsumerIdx);

out:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/