All of lore.kernel.org
 help / color / mirror / Atom feed
* Unaligned accesses in ip_rcv and ip_fast_csum
@ 2007-02-25 20:07 Jurij Smakov
  2007-02-27 18:52 ` Doug Nazar
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Jurij Smakov @ 2007-02-25 20:07 UTC (permalink / raw)
  To: sparclinux

Hi,

We have a report (Debian bug #409313 [0]) of the following unaligned 
accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with 
kernel 2.6.18 and newer:

Kernel unaligned access at TPC[5e4420] ip_rcv+0xd0/0x58c
Kernel unaligned access at TPC[517f84] ip_fast_csum+0xc/0x80
Kernel unaligned access at TPC[517f88] ip_fast_csum+0x10/0x80
Kernel unaligned access at TPC[517f8c] ip_fast_csum+0x14/0x80
Kernel unaligned access at TPC[517f94] ip_fast_csum+0x1c/0x80

I was hoping to debug it myself, but due to time constraints was not 
able to get too far.

[0] http://bugs.debian.org/409313

Best regards,
-- 
Jurij Smakov                                           jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
@ 2007-02-27 18:52 ` Doug Nazar
  2007-02-27 19:43 ` Doug Nazar
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Doug Nazar @ 2007-02-27 18:52 UTC (permalink / raw)
  To: sparclinux

> We have a report (Debian bug #409313 [0]) of the following unaligned
> accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
> kernel 2.6.18 and newer:

This took me a little longer to track down than it should have. I started
looking at the wrong end of the issue but on the plus side I now have a
better understanding sparcv9 asm and the networking stack.


diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 5a35354..e3774a5 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -67,7 +67,7 @@ const char * const medianame[32] = {
 
 /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
 #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
-	|| defined(__sparc_) || defined(__ia64__) \
+	|| defined(__sparc__) || defined(__ia64__) \
 	|| defined(__sh__) || defined(__mips__)
 static int rx_copybreak = 1518;
 #else



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
  2007-02-27 18:52 ` Doug Nazar
@ 2007-02-27 19:43 ` Doug Nazar
  2007-02-27 20:00 ` David Miller
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Doug Nazar @ 2007-02-27 19:43 UTC (permalink / raw)
  To: sparclinux

> We have a report (Debian bug #409313 [0]) of the following unaligned
> accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
> kernel 2.6.18 and newer:

A quick grep shows this issue is also in de2104x module in case somebody is
using that.

diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 9d67f11..dacea4f 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC (debug, "de2104x bitmapped message enable
number");
 
 /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
 #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
-        || defined(__sparc_) || defined(__ia64__) \
+        || defined(__sparc__) || defined(__ia64__) \
         || defined(__sh__) || defined(__mips__)
 static int rx_copybreak = 1518;
 #else


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
  2007-02-27 18:52 ` Doug Nazar
  2007-02-27 19:43 ` Doug Nazar
@ 2007-02-27 20:00 ` David Miller
  2007-02-27 20:22 ` Daniel J. Priem
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2007-02-27 20:00 UTC (permalink / raw)
  To: sparclinux

From: "Doug Nazar" <nazard@dragoninc.ca>
Date: Tue, 27 Feb 2007 14:43:23 -0500

> > We have a report (Debian bug #409313 [0]) of the following unaligned
> > accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
> > kernel 2.6.18 and newer:
> 
> A quick grep shows this issue is also in de2104x module in case somebody is
> using that.

I've forwarded both of your patches to the netdev lists and
Jeff Garzik, the network drivers maintainer.

Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (2 preceding siblings ...)
  2007-02-27 20:00 ` David Miller
@ 2007-02-27 20:22 ` Daniel J. Priem
  2007-02-27 21:02 ` David Miller
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Daniel J. Priem @ 2007-02-27 20:22 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]

David Miller <davem@davemloft.net> writes:

> From: "Doug Nazar" <nazard@dragoninc.ca>
> Date: Tue, 27 Feb 2007 14:43:23 -0500
>
>> > We have a report (Debian bug #409313 [0]) of the following unaligned
>> > accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
>> > kernel 2.6.18 and newer:

This also occurs on netra t1 105  TI UltraSparc IIe (Hummingbird)

[93548.504961] Kernel unaligned access at TPC[6aa660]
aoenet_rcv+0xa8/0x1a0


>> 
>> A quick grep shows this issue is also in de2104x module in case somebody is
>> using that.
>
> I've forwarded both of your patches to the netdev lists and
> Jeff Garzik, the network drivers maintainer.
>
> Thanks.
> -
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
 .''`.
 : :' :      Daniel J. Priem
 `. `'       http://flexserv.de
   `-        

[-- Attachment #2: Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (3 preceding siblings ...)
  2007-02-27 20:22 ` Daniel J. Priem
@ 2007-02-27 21:02 ` David Miller
  2007-02-27 21:07 ` Daniel J. Priem
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2007-02-27 21:02 UTC (permalink / raw)
  To: sparclinux

From: "Daniel J. Priem" <daniel@flexserv.de>
Date: Tue, 27 Feb 2007 21:22:00 +0100

> David Miller <davem@davemloft.net> writes:
> 
> > From: "Doug Nazar" <nazard@dragoninc.ca>
> > Date: Tue, 27 Feb 2007 14:43:23 -0500
> >
> >> > We have a report (Debian bug #409313 [0]) of the following unaligned
> >> > accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
> >> > kernel 2.6.18 and newer:
> 
> This also occurs on netra t1 105  TI UltraSparc IIe (Hummingbird)
> 
> [93548.504961] Kernel unaligned access at TPC[6aa660]
> aoenet_rcv+0xa8/0x1a0

This is a different problem, it's totally unrelated.

I fixed that particular issue in a seperate patch to the AOE driver
which I posted yesterday, please test it out.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (4 preceding siblings ...)
  2007-02-27 21:02 ` David Miller
@ 2007-02-27 21:07 ` Daniel J. Priem
  2007-02-27 21:14 ` David Miller
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Daniel J. Priem @ 2007-02-27 21:07 UTC (permalink / raw)
  To: sparclinux

David Miller <davem@davemloft.net> writes:

> From: "Daniel J. Priem" <daniel@flexserv.de>
> Date: Tue, 27 Feb 2007 21:22:00 +0100
>
>> David Miller <davem@davemloft.net> writes:
>> 
>> > From: "Doug Nazar" <nazard@dragoninc.ca>
>> > Date: Tue, 27 Feb 2007 14:43:23 -0500
>> >
>> >> > We have a report (Debian bug #409313 [0]) of the following unaligned
>> >> > accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
>> >> > kernel 2.6.18 and newer:
>> 
>> This also occurs on netra t1 105  TI UltraSparc IIe (Hummingbird)
>> 
>> [93548.504961] Kernel unaligned access at TPC[6aa660]
>> aoenet_rcv+0xa8/0x1a0
>
> This is a different problem, it's totally unrelated.
>
> I fixed that particular issue in a seperate patch to the AOE driver
> which I posted yesterday, please test it out.

Can you please send me both patches?

Thanks
Daniel

> -
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
 .''`.
 : :' :      Daniel J. Priem
 `. `'       http://flexserv.de
   `-        


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (5 preceding siblings ...)
  2007-02-27 21:07 ` Daniel J. Priem
@ 2007-02-27 21:14 ` David Miller
  2007-02-27 22:19 ` Daniel J. Priem
  2007-02-28 12:30 ` Richard Mortimer
  8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2007-02-27 21:14 UTC (permalink / raw)
  To: sparclinux

From: "Daniel J. Priem" <daniel@flexserv.de>
Date: Tue, 27 Feb 2007 22:07:41 +0100

> Can you please send me both patches?

You're replying to a thread that has the Tulip driver
patch, and here is the one for the AOE driver:

From 2b274ebbdd2ea9b7d1ddfa4ca6f2e173bec830e9 Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@sunset.davemloft.net>
Date: Mon, 26 Feb 2007 10:38:26 -0800
Subject: [PATCH] [AOE]: Add get_unaligned() calls where needed.

Based upon a report by Andrew Walrond.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/block/aoe/aoecmd.c |   12 ++++++------
 drivers/block/aoe/aoenet.c |    5 +++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index bb022ed..8d17d8d 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -530,7 +530,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 	u16 aoemajor;
 
 	hin = (struct aoe_hdr *) skb->mac.raw;
-	aoemajor = be16_to_cpu(hin->major);
+	aoemajor = be16_to_cpu(get_unaligned(&hin->major));
 	d = aoedev_by_aoeaddr(aoemajor, hin->minor);
 	if (d = NULL) {
 		snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
@@ -542,7 +542,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 
 	spin_lock_irqsave(&d->lock, flags);
 
-	n = be32_to_cpu(hin->tag);
+	n = be32_to_cpu(get_unaligned(&hin->tag));
 	f = getframe(d, n);
 	if (f = NULL) {
 		calc_rttavg(d, -tsince(n));
@@ -550,9 +550,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 		snprintf(ebuf, sizeof ebuf,
 			"%15s e%d.%d    tag=%08x@%08lx\n",
 			"unexpected rsp",
-			be16_to_cpu(hin->major),
+			be16_to_cpu(get_unaligned(&hin->major)),
 			hin->minor,
-			be32_to_cpu(hin->tag),
+			be32_to_cpu(get_unaligned(&hin->tag)),
 			jiffies);
 		aoechr_error(ebuf);
 		return;
@@ -631,7 +631,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 			printk(KERN_INFO
 				"aoe: unrecognized ata command %2.2Xh for %d.%d\n",
 				ahout->cmdstat,
-				be16_to_cpu(hin->major),
+				be16_to_cpu(get_unaligned(&hin->major)),
 				hin->minor);
 		}
 	}
@@ -733,7 +733,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
 	 * Enough people have their dip switches set backwards to
 	 * warrant a loud message for this special case.
 	 */
-	aoemajor = be16_to_cpu(h->major);
+	aoemajor = be16_to_cpu(get_unaligned(&h->major));
 	if (aoemajor = 0xfff) {
 		printk(KERN_ERR "aoe: Warning: shelf address is all ones.  "
 			"Check shelf dip switches.\n");
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 9626e0f..5b85c0a 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -8,6 +8,7 @@
 #include <linux/blkdev.h>
 #include <linux/netdevice.h>
 #include <linux/moduleparam.h>
+#include <asm/unaligned.h>
 #include "aoe.h"
 
 #define NECODES 5
@@ -123,7 +124,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
 	skb_push(skb, ETH_HLEN);	/* (1) */
 
 	h = (struct aoe_hdr *) skb->mac.raw;
-	n = be32_to_cpu(h->tag);
+	n = be32_to_cpu(get_unaligned(&h->tag));
 	if ((h->verfl & AOEFL_RSP) = 0 || (n & 1<<31))
 		goto exit;
 
@@ -133,7 +134,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
 			n = 0;
 		if (net_ratelimit())
 			printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
-			       be16_to_cpu(h->major), h->minor, 
+			       be16_to_cpu(get_unaligned(&h->major)), h->minor, 
 			       h->err, aoe_errlist[n]);
 		goto exit;
 	}
-- 
1.5.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (6 preceding siblings ...)
  2007-02-27 21:14 ` David Miller
@ 2007-02-27 22:19 ` Daniel J. Priem
  2007-02-28 12:30 ` Richard Mortimer
  8 siblings, 0 replies; 10+ messages in thread
From: Daniel J. Priem @ 2007-02-27 22:19 UTC (permalink / raw)
  To: sparclinux

David Miller <davem@davemloft.net> writes:

> From: "Daniel J. Priem" <daniel@flexserv.de>
> Date: Tue, 27 Feb 2007 21:22:00 +0100
>
>> David Miller <davem@davemloft.net> writes:
>> 
>> > From: "Doug Nazar" <nazard@dragoninc.ca>
>> > Date: Tue, 27 Feb 2007 14:43:23 -0500
>> >
>> >> > We have a report (Debian bug #409313 [0]) of the following unaligned
>> >> > accesses, occuring every 5-6 seconds on Netra X1 and SunFire v100 with
>> >> > kernel 2.6.18 and newer:
>> 
>> This also occurs on netra t1 105  TI UltraSparc IIe (Hummingbird)
>> 
>> [93548.504961] Kernel unaligned access at TPC[6aa660]
>> aoenet_rcv+0xa8/0x1a0
>
> This is a different problem, it's totally unrelated.
>
> I fixed that particular issue in a seperate patch to the AOE driver
> which I posted yesterday, please test it out.

Yes it works perfect.
Thanks!

-- 
 .''`.
 : :' :      Daniel J. Priem
 `. `'       http://flexserv.de
   `-        


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Unaligned accesses in ip_rcv and ip_fast_csum
  2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
                   ` (7 preceding siblings ...)
  2007-02-27 22:19 ` Daniel J. Priem
@ 2007-02-28 12:30 ` Richard Mortimer
  8 siblings, 0 replies; 10+ messages in thread
From: Richard Mortimer @ 2007-02-28 12:30 UTC (permalink / raw)
  To: sparclinux

Excellent. I haven't had chance to compile a new kernel yet but
I tried changing rx_copybreak at modprobe time and can confirm
that the issue goes away.

rmmod tulip
modprobe tulip rx_copybreak\x1518

Thanks

Richard 

> -----Original Message-----
> From: sparclinux-owner@vger.kernel.org 
> [mailto:sparclinux-owner@vger.kernel.org] On Behalf Of Doug Nazar
> Sent: 27 February 2007 18:52
> To: 'Jurij Smakov'
> Cc: sparclinux@vger.kernel.org
> Subject: RE: Unaligned accesses in ip_rcv and ip_fast_csum
> 
> > We have a report (Debian bug #409313 [0]) of the following unaligned
> > accesses, occuring every 5-6 seconds on Netra X1 and 
> SunFire v100 with
> > kernel 2.6.18 and newer:
> 
> This took me a little longer to track down than it should 
> have. I started
> looking at the wrong end of the issue but on the plus side I 
> now have a
> better understanding sparcv9 asm and the networking stack.
> 
> 
> diff --git a/drivers/net/tulip/tulip_core.c 
> b/drivers/net/tulip/tulip_core.c
> index 5a35354..e3774a5 100644
> --- a/drivers/net/tulip/tulip_core.c
> +++ b/drivers/net/tulip/tulip_core.c
> @@ -67,7 +67,7 @@ const char * const medianame[32] = {
>  
>  /* Set the copy breakpoint for the copy-only-tiny-buffer Rx 
> structure. */
>  #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
> -	|| defined(__sparc_) || defined(__ia64__) \
> +	|| defined(__sparc__) || defined(__ia64__) \
>  	|| defined(__sh__) || defined(__mips__)
>  static int rx_copybreak = 1518;
>  #else
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe 
> sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-02-28 12:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-25 20:07 Unaligned accesses in ip_rcv and ip_fast_csum Jurij Smakov
2007-02-27 18:52 ` Doug Nazar
2007-02-27 19:43 ` Doug Nazar
2007-02-27 20:00 ` David Miller
2007-02-27 20:22 ` Daniel J. Priem
2007-02-27 21:02 ` David Miller
2007-02-27 21:07 ` Daniel J. Priem
2007-02-27 21:14 ` David Miller
2007-02-27 22:19 ` Daniel J. Priem
2007-02-28 12:30 ` Richard Mortimer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.