From: Greg KH <gregkh@suse•de>
To: linux-kernel@vger•kernel.org, stable@kernel•org
Cc: Justin Forbes <jmforbes@linuxtx•org>,
Zwane Mwaikambo <zwane@arm•linux.org.uk>,
Theodore Ts'o <tytso@mit•edu>,
Randy Dunlap <rdunlap@xenotime•net>,
Dave Jones <davej@redhat•com>,
Chuck Wolber <chuckw@quantumlinux•com>,
Chris Wedgwood <reviews@ml•cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv•org>,
Chuck Ebbert <cebbert@redhat•com>,
Domenico Andreoli <cavokz@gmail•com>,
torvalds@linux-foundation•org, akpm@linux-foundation•org,
alan@lxorguk•ukuu.org.uk, netdev@vger•kernel.org,
Stephen Hemminger <shemminger@linux-foundation•org>,
Greg Kroah-Hartman <gregkh@suse•de>
Subject: [patch 05/20] sky2: check for more work before leaving NAPI
Date: Mon, 20 Aug 2007 23:54:15 -0700 [thread overview]
Message-ID: <20070821065415.GF5275@kroah.com> (raw)
In-Reply-To: <20070821065210.GA5275@kroah.com>
[-- Attachment #1: sky2-napi-fill.patch --]
[-- Type: text/plain, Size: 2291 bytes --]
-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stephen Hemminger <shemminger@linux-foundation•org>
Backport of commit 5c11ce700f77fada15b6264417d72462da4bbb1c
This patch avoids generating another IRQ if more packets
arrive while in the NAPI poll routine. Before marking device as
finished, it rechecks that the status ring is empty.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation•org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse•de>
---
drivers/net/sky2.c | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2428,8 +2428,7 @@ static void sky2_err_intr(struct sky2_hw
static int sky2_poll(struct net_device *dev0, int *budget)
{
struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw;
- int work_limit = min(dev0->quota, *budget);
- int work_done = 0;
+ int work_done;
u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
if (unlikely(status & Y2_IS_ERROR))
@@ -2441,25 +2440,25 @@ static int sky2_poll(struct net_device *
if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);
- work_done = sky2_status_intr(hw, work_limit);
- if (work_done < work_limit) {
- /* Bug/Errata workaround?
- * Need to kick the TX irq moderation timer.
- */
- if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
- }
- netif_rx_complete(dev0);
+ work_done = sky2_status_intr(hw, min(dev0->quota, *budget));
+ *budget -= work_done;
+ dev0->quota -= work_done;
- /* end of interrupt, re-enables also acts as I/O synchronization */
- sky2_read32(hw, B0_Y2_SP_LISR);
- return 0;
- } else {
- *budget -= work_done;
- dev0->quota -= work_done;
+ /* More work? */
+ if (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX))
return 1;
+
+ /* Bug/Errata workaround?
+ * Need to kick the TX irq moderation timer.
+ */
+ if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
}
+ netif_rx_complete(dev0);
+
+ sky2_read32(hw, B0_Y2_SP_LISR);
+ return 0;
}
static irqreturn_t sky2_intr(int irq, void *dev_id)
--
next prev parent reply other threads:[~2007-08-21 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070821064251.972690753@blue.kroah.org>
[not found] ` <20070821065210.GA5275@kroah.com>
2007-08-21 6:53 ` [patch 03/20] sky2: restore workarounds for lost interrupts Greg KH
2007-08-21 6:54 ` [patch 04/20] sky2: carrier management Greg KH
2007-08-21 6:54 ` Greg KH [this message]
2007-08-21 6:54 ` [patch 06/20] sky2: check drop truncated packets Greg KH
2007-08-21 18:10 ` [PATCH] sky2: don't clear phy power bits Stephen Hemminger
2007-08-21 18:26 ` Linus Torvalds
2007-08-21 18:50 ` Stephen Hemminger
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=20070821065415.GF5275@kroah.com \
--to=gregkh@suse$(echo .)de \
--cc=akpm@linux-foundation$(echo .)org \
--cc=alan@lxorguk$(echo .)ukuu.org.uk \
--cc=cavokz@gmail$(echo .)com \
--cc=cebbert@redhat$(echo .)com \
--cc=chuckw@quantumlinux$(echo .)com \
--cc=davej@redhat$(echo .)com \
--cc=jmforbes@linuxtx$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mkrufky@linuxtv$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rdunlap@xenotime$(echo .)net \
--cc=reviews@ml$(echo .)cw.f00f.org \
--cc=shemminger@linux-foundation$(echo .)org \
--cc=stable@kernel$(echo .)org \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=tytso@mit$(echo .)edu \
--cc=zwane@arm$(echo .)linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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