Patchwork Re: kernel panics with net_rx_action on kernels >2.6.26

login
register
mail settings
Submitter Jarek Poplawski
Date Dec. 16, 2008, 2:06 p.m.
Message ID <20081216140651.GA6537@ff.dom.local>
Download mbox | patch
Permalink /patch/14238/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jarek Poplawski - Dec. 16, 2008, 2:06 p.m.
On Tue, Dec 16, 2008 at 01:22:47AM -0800, David Miller wrote:
...
> Jarek this looks good and it looks to be tested as well.
> 
> Could you formally submit this?

------------------->

drivers/net: starfire: Fix napi ->poll() weight handling

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@sbg.ac.at>
Tested-by: Alexander Huemer <alexander.huemer@sbg.ac.at>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 16, 2008, 11:42 p.m.
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Tue, 16 Dec 2008 14:06:51 +0000

> drivers/net: starfire: Fix napi ->poll() weight handling
> 
> 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@sbg.ac.at>
> Tested-by: Alexander Huemer <alexander.huemer@sbg.ac.at>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 0358809..f86d6bb 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1503,6 +1503,11 @@  static int __netdev_rx(struct net_device *dev, int *quota)
 		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: