public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Chubb <peter@chubb.wattle.id.au>
To: linux-ia64@vger.kernel.org
Subject: Re: NS83820 2.6.0-test5 driver seems unstable on IA64
Date: Tue, 23 Sep 2003 00:34:18 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106427735209595@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106394503001622@msgid-missing>


OK, a patch for the driver in 2.6.0-test5 is appended.

I suspect that there are other architectures that don't like unaligned
accesses...  feel free to add them to the #ifdef.
This is based on code I found in the revision history.  It seems to
work.

Without this patch, the console messages saying `unaligned access'
would come out fast enough and often enough to delay and or miss
interrupts, leading to an eventual machine hangup on I2000.

=== drivers/net/ns83820.c 1.30 vs edited ==--- 1.30/drivers/net/ns83820.c	Thu Sep 11 09:46:45 2003
+++ edited/drivers/net/ns83820.c	Mon Sep 22 12:49:18 2003
@@ -793,6 +793,25 @@
 	}
 }
 
+#if defined(__ia64__)
+static inline struct sk_buff *skb_realign_iphdr(struct sk_buff *skb, int len, struct ns83820 *dev)
+{
+	struct sk_buff *tmp = __dev_alloc_skb(len+2, GFP_ATOMIC);
+	if (!tmp)
+		return NULL;
+	tmp->dev = &dev->net_dev;
+	skb_reserve(tmp, 2);
+	memcpy(skb_put(tmp, len), skb->data, len);
+	kfree_skb(skb);
+	return tmp;
+}
+#else
+static inline  struct sk_buff *skb_realign_iphdr(struct sk_buff *skb, int len, struct ns83820 *dev)
+{
+	return skb;
+}
+#endif
+
 static void FASTCALL(ns83820_rx_kick(struct ns83820 *dev));
 static void ns83820_rx_kick(struct ns83820 *dev)
 {
@@ -862,6 +881,7 @@
 		if (likely(CMDSTS_OK & cmdsts)) {
 			int len = cmdsts & 0xffff;
 			skb_put(skb, len);
+			skb = skb_realign_iphdr(skb, len, dev);
 			if (unlikely(!skb))
 				goto netdev_mangle_me_harder_failed;
 			if (cmdsts & CMDSTS_DEST_MULTI)

  parent reply	other threads:[~2003-09-23  0:34 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-19  4:16 NS83820 2.6.0-test5 driver seems unstable on IA64 Peter Chubb
2003-09-19  4:38 ` Grant Grundler
2003-09-19  4:43 ` Andi Kleen
2003-09-19  5:01 ` Peter Chubb
2003-09-19  5:04 ` Grant Grundler
2003-09-19  5:11 ` Peter Chubb
2003-09-19  5:53 ` Andi Kleen
2003-09-19 10:49 ` Benjamin LaHaise
2003-09-23  0:34 ` Peter Chubb [this message]
2003-09-23  0:36 ` Benjamin LaHaise
2003-09-23  6:22 ` David S. Miller
2003-09-23 10:40 ` Peter Chubb
2003-09-23 10:51 ` David S. Miller
2003-09-23 14:59 ` David Mosberger
2003-09-23 17:27 ` David S. Miller
2003-09-23 17:56 ` David Mosberger
2003-09-23 17:56 ` David Mosberger
2003-09-23 17:57 ` David S. Miller
2003-09-23 17:58 ` Van Maren, Kevin
2003-09-23 18:06 ` David Mosberger
2003-09-23 18:21 ` Luck, Tony
2003-09-23 18:27 ` David Mosberger
2003-09-23 18:29 ` Benjamin LaHaise
2003-09-23 18:45 ` David S. Miller
2003-09-23 18:47 ` David S. Miller
2003-09-23 18:51 ` Grant Grundler
2003-09-23 18:51 ` David S. Miller
2003-09-23 18:52 ` David S. Miller
2003-09-23 18:54 ` Andreas Schwab
2003-09-23 19:01 ` David S. Miller
2003-09-23 19:04 ` Benjamin LaHaise
2003-09-23 19:08 ` David S. Miller
2003-09-23 19:09 ` Andreas Schwab
2003-09-23 19:10 ` Jeff Garzik
2003-09-23 19:10 ` David S. Miller
2003-09-23 19:11 ` David S. Miller
2003-09-23 19:11 ` Benjamin LaHaise
2003-09-23 19:16 ` Andreas Schwab
2003-09-23 19:17 ` David Mosberger
2003-09-23 19:22 ` David S. Miller
2003-09-23 19:22 ` Jeff Garzik
2003-09-23 19:28 ` Matthew Wilcox
2003-09-23 20:00 ` David Mosberger
2003-09-23 20:00 ` David Mosberger
2003-09-23 20:38 ` Grant Grundler
2003-09-23 20:45 ` David S. Miller
2003-09-23 21:00 ` Alan Cox
2003-09-23 21:16 ` David Mosberger
2003-09-23 22:35 ` Grant Grundler
2003-09-23 22:58 ` Luck, Tony
2003-09-23 23:04 ` Ian Wienand
2003-09-23 23:15 ` Andrew Morton
2003-09-23 23:32 ` David S. Miller
2003-09-23 23:35 ` David S. Miller
2003-09-23 23:35 ` David S. Miller
2003-09-23 23:37 ` David S. Miller
2003-09-24  0:04 ` David S. Miller
2003-09-24  0:06 ` David S. Miller
2003-09-24  0:13 ` Grant Grundler
2003-09-24  0:14 ` Matthew Wilcox
2003-09-24  1:47 ` David S. Miller
2003-09-24  1:58 ` William Lee Irwin III
2003-09-24  2:55 ` David S. Miller
2003-09-24  3:08 ` David S. Miller
2003-09-24  5:18 ` Valdis.Kletnieks
2003-09-25 16:11 ` Ivan Kokshaysky
2003-09-26  1:12 ` David S. Miller

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=marc-linux-ia64-106427735209595@msgid-missing \
    --to=peter@chubb.wattle.id.au \
    --cc=linux-ia64@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