netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: netdev@vger.kernel.org
Subject: [patch 6/9] sky2: dont write status ring
Date: Mon, 08 May 2006 15:11:31 -0700	[thread overview]
Message-ID: <20060508221229.198503000@localhost.localdomain> (raw)
In-Reply-To: 20060508221125.177816000@localhost.localdomain

[-- Attachment #1: sky2-status-ring.patch --]
[-- Type: text/plain, Size: 1428 bytes --]

It is more efficient not to write the status ring from the
processor and just read the active portion.

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


--- sky2.orig/drivers/net/sky2.c	2006-05-02 09:49:38.000000000 -0700
+++ sky2/drivers/net/sky2.c	2006-05-02 09:49:42.000000000 -0700
@@ -1865,35 +1865,28 @@
 static int sky2_status_intr(struct sky2_hw *hw, int to_do)
 {
 	int work_done = 0;
+	u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
 
 	rmb();
 
-	for(;;) {
+	while (hw->st_idx != hwidx) {
 		struct sky2_status_le *le  = hw->st_le + hw->st_idx;
 		struct net_device *dev;
 		struct sky2_port *sky2;
 		struct sk_buff *skb;
 		u32 status;
 		u16 length;
-		u8  link, opcode;
-
-		opcode = le->opcode;
-		if (!opcode)
-			break;
-		opcode &= ~HW_OWNER;
 
 		hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
-		le->opcode = 0;
 
-		link = le->link;
-		BUG_ON(link >= 2);
-		dev = hw->dev[link];
+		BUG_ON(le->link >= 2);
+		dev = hw->dev[le->link];
 
 		sky2 = netdev_priv(dev);
 		length = le->length;
 		status = le->status;
 
-		switch (opcode) {
+		switch (le->opcode & ~HW_OWNER) {
 		case OP_RXSTAT:
 			skb = sky2_receive(sky2, length, status);
 			if (!skb)
@@ -1944,8 +1937,8 @@
 		default:
 			if (net_ratelimit())
 				printk(KERN_WARNING PFX
-				       "unknown status opcode 0x%x\n", opcode);
-			break;
+				       "unknown status opcode 0x%x\n", le->opcode);
+			goto exit_loop;
 		}
 	}
 

--


  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 ` [patch 5/9] sky2: edge triggered workaround enhancement Stephen Hemminger
2006-05-08 22:11 ` Stephen Hemminger [this message]
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=20060508221229.198503000@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).