netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 4/5] sky2: force NAPI repoll if busy
Date: Wed, 17 May 2006 14:37:06 -0700	[thread overview]
Message-ID: <20060517213802.471236000@localhost.localdomain> (raw)
In-Reply-To: 20060517213702.322762000@localhost.localdomain

[-- Attachment #1: sky2-morework.patch --]
[-- Type: text/plain, Size: 1258 bytes --]

If the status ring processing can't keep up with the incoming frames,
it is more efficient to have NAPI keep scheduling the poll routine
rather than causing another interrupt.

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


--- sky2.orig/drivers/net/sky2.c	2006-05-17 08:55:54.000000000 -0700
+++ sky2/drivers/net/sky2.c	2006-05-17 08:56:03.000000000 -0700
@@ -1920,6 +1920,12 @@
 	}
 }
 
+/* Is status ring empty or is there more to do? */
+static inline int sky2_more_work(const struct sky2_hw *hw)
+{
+	return (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX));
+}
+
 /* Process status response ring */
 static int sky2_status_intr(struct sky2_hw *hw, int to_do)
 {
@@ -2192,19 +2198,19 @@
 	if (status & Y2_IS_CHK_TXA2)
 		sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2);
 
-	if (status & Y2_IS_STAT_BMU)
-		sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
-
 	work_done = sky2_status_intr(hw, work_limit);
 	*budget -= work_done;
 	dev0->quota -= work_done;
 
-	if (work_done >= work_limit)
+	if (status & Y2_IS_STAT_BMU)
+		sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
+
+	if (sky2_more_work(hw))
 		return 1;
 
 	netif_rx_complete(dev0);
 
-	status = sky2_read32(hw, B0_Y2_SP_LISR);
+	sky2_read32(hw, B0_Y2_SP_LISR);
 	return 0;
 }
 

--


  parent reply	other threads:[~2006-05-17 21:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17 21:37 [PATCH 0/5] sky2 bugfixes for 2.6.17 Stephen Hemminger
2006-05-17 21:37 ` [PATCH 1/5] sky2: allow dual port usage Stephen Hemminger
2006-05-18 18:16   ` [PATCH 1a/5] " Stephen Hemminger
2006-05-17 21:37 ` [PATCH 2/5] Subjec: sky2, skge: correct PCI id for DGE-560T Stephen Hemminger
2006-05-17 21:37 ` [PATCH 3/5] sky2: more fixes for Yukon Ultra Stephen Hemminger
2006-05-17 21:37 ` Stephen Hemminger [this message]
2006-05-17 21:37 ` [PATCH 5/5] sky2 version 1.4 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=20060517213802.471236000@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --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).