netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: netdev@vger.kernel.org
Subject: [patch 5/9] sky2: edge triggered workaround enhancement
Date: Mon, 08 May 2006 15:11:30 -0700	[thread overview]
Message-ID: <20060508221228.989827000@localhost.localdomain> (raw)
In-Reply-To: 20060508221125.177816000@localhost.localdomain

[-- Attachment #1: sky2-timer-tweak.patch --]
[-- Type: text/plain, Size: 2111 bytes --]

Need to make the edge-triggered workaround timer faster to get marginally
better peformance. The test_and_set_bit in schedule_prep() acts as a barrier
already. Make it a module parameter so that laptops who are concerned
about power can set it to 0; and user's stuck with broken BIOS's
can turn the driver into pure polling.

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


--- sky2.orig/drivers/net/sky2.c	2006-05-02 09:49:37.000000000 -0700
+++ sky2/drivers/net/sky2.c	2006-05-02 09:49:38.000000000 -0700
@@ -98,6 +98,10 @@
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
+static int idle_timeout = 100;
+module_param(idle_timeout, int, 0);
+MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)");
+
 static const struct pci_device_id sky2_id_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
@@ -2092,12 +2096,13 @@
  */
 static void sky2_idle(unsigned long arg)
 {
-	struct net_device *dev = (struct net_device *) arg;
+	struct sky2_hw *hw = (struct sky2_hw *) arg;
+	struct net_device *dev = hw->dev[0];
 
-	local_irq_disable();
 	if (__netif_rx_schedule_prep(dev))
 		__netif_rx_schedule(dev);
-	local_irq_enable();
+
+	mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout));
 }
 
 
@@ -2145,8 +2150,6 @@
 	if (work_done >= work_limit)
 		return 1;
 
-	mod_timer(&hw->idle_timer, jiffies + HZ);
-
 	netif_rx_complete(dev0);
 
 	status = sky2_read32(hw, B0_Y2_SP_LISR);
@@ -2167,8 +2170,6 @@
 	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;
 }
@@ -3290,7 +3291,10 @@
 
 	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
 
-	setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev);
+	setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
+	if (idle_timeout > 0)
+		mod_timer(&hw->idle_timer,
+			  jiffies + msecs_to_jiffies(idle_timeout));
 
 	pci_set_drvdata(pdev, hw);
 

--


  parent 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 ` [patch 1/9] sky2: backout NAPI reschedule Stephen Hemminger
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 ` Stephen Hemminger [this message]
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.989827000@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).