netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: netdev@vger.kernel.org
Subject: [patch 1/9] sky2: backout NAPI reschedule
Date: Mon, 08 May 2006 15:11:26 -0700	[thread overview]
Message-ID: <20060508221228.153966000@localhost.localdomain> (raw)
In-Reply-To: 20060508221125.177816000@localhost.localdomain

[-- Attachment #1: sky2-backout-resched.patch --]
[-- Type: text/plain, Size: 2584 bytes --]

This is a backout of earlier patch.

The whole rescheduling hack was a bad idea. It doesn't really solve
the problem and it makes the code more complicated for no good reason.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- sky2.orig/drivers/net/sky2.c
+++ sky2/drivers/net/sky2.c
@@ -2105,7 +2105,6 @@ static int sky2_poll(struct net_device *
 	int work_done = 0;
 	u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
 
- restart_poll:
 	if (unlikely(status & ~Y2_IS_STAT_BMU)) {
 		if (status & Y2_IS_HW_ERR)
 			sky2_hw_intr(hw);
@@ -2136,7 +2135,7 @@ static int sky2_poll(struct net_device *
 	}
 
 	if (status & Y2_IS_STAT_BMU) {
-		work_done += sky2_status_intr(hw, work_limit - work_done);
+		work_done = sky2_status_intr(hw, work_limit);
 		*budget -= work_done;
 		dev0->quota -= work_done;
 
@@ -2148,22 +2147,9 @@ static int sky2_poll(struct net_device *
 
 	mod_timer(&hw->idle_timer, jiffies + HZ);
 
-	local_irq_disable();
-	__netif_rx_complete(dev0);
+	netif_rx_complete(dev0);
 
 	status = sky2_read32(hw, B0_Y2_SP_LISR);
-
-	if (unlikely(status)) {
-		/* More work pending, try and keep going */
-		if (__netif_rx_schedule_prep(dev0)) {
-			__netif_rx_reschedule(dev0, work_done);
-			status = sky2_read32(hw, B0_Y2_SP_EISR);
-			local_irq_enable();
-			goto restart_poll;
-		}
-	}
-
-	local_irq_enable();
 	return 0;
 }
 
@@ -2181,6 +2167,8 @@ static irqreturn_t sky2_intr(int irq, vo
 	prefetch(&hw->st_le[hw->st_idx]);
 	if (likely(__netif_rx_schedule_prep(dev0)))
 		__netif_rx_schedule(dev0);
+	else
+		printk(KERN_DEBUG PFX "irq race detected\n");
 
 	return IRQ_HANDLED;
 }
--- sky2.orig/include/linux/netdevice.h
+++ sky2/include/linux/netdevice.h
@@ -829,21 +829,19 @@ static inline void netif_rx_schedule(str
 		__netif_rx_schedule(dev);
 }
 
-
-static inline void  __netif_rx_reschedule(struct net_device *dev, int undo)
-{
-	dev->quota += undo;
-	list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
-	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
-}
-
-/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */
+/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete().
+ * Do not inline this?
+ */
 static inline int netif_rx_reschedule(struct net_device *dev, int undo)
 {
 	if (netif_rx_schedule_prep(dev)) {
 		unsigned long flags;
+
+		dev->quota += undo;
+
 		local_irq_save(flags);
-		__netif_rx_reschedule(dev, undo);
+		list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
+		__raise_softirq_irqoff(NET_RX_SOFTIRQ);
 		local_irq_restore(flags);
 		return 1;
 	}

--


  reply	other threads:[~2006-05-08 22:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-08 22:11 [patch 0/9] sky2 update Stephen Hemminger
2006-05-08 22:11 ` Stephen Hemminger [this message]
2006-05-08 22:11 ` [patch 2/9] sky2: status irq hang fix Stephen Hemminger
2006-05-08 22:11 ` [patch 3/9] sky2: tx ring index mask fix Stephen Hemminger
2006-05-08 22:11 ` [patch 4/9] sky2: use mask instead of modulo operation Stephen Hemminger
2006-05-08 22:11 ` [patch 5/9] sky2: edge triggered workaround enhancement Stephen Hemminger
2006-05-08 22:11 ` [patch 6/9] sky2: dont write status ring Stephen Hemminger
2006-05-08 22:11 ` [patch 7/9] sky2: synchronize irq on remove Stephen Hemminger
2006-05-08 22:11 ` [patch 8/9] Add more support for the Yukon Ultra chip found in dual core centino laptops Stephen Hemminger
2006-05-08 22:11 ` [patch 9/9] sky2: version 1.3 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=20060508221228.153966000@localhost.localdomain \
    --to=shemminger@osdl.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).