netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>, David Miller <davem@davemloft.net>
Cc: Alexander Huemer <alexander.huemer@sbg.ac.at>,
	linux-net@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH] Re: kernel panics with net_rx_action on kernels >2.6.26
Date: Tue, 16 Dec 2008 14:06:51 +0000	[thread overview]
Message-ID: <20081216140651.GA6537@ff.dom.local> (raw)
In-Reply-To: <20081216.012247.267028680.davem@davemloft.net>

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(-)

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:

  reply	other threads:[~2008-12-16 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4945157C.9000305@sbg.ac.at>
2008-12-15  6:48 ` kernel panics with net_rx_action on kernels >2.6.26 David Miller
2008-12-15 13:35   ` Jarek Poplawski
2008-12-15 20:11     ` Alexander Huemer
2008-12-16  6:59       ` Jarek Poplawski
2008-12-16  9:22     ` David Miller
2008-12-16 14:06       ` Jarek Poplawski [this message]
2008-12-16 23:42         ` [PATCH] " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081216140651.GA6537@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=alexander.huemer@sbg.ac.at \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-net@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).