* [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN
@ 2005-09-29 16:45 Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [2/3]: use get_unaligned for accesses in ATA id buffer Ed L. Cashin
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ed L. Cashin @ 2005-09-29 16:45 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Explicitly set the minimum packet length to ETH_ZLEN and zero the
packet data.
diff -u 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c 2005-09-29 12:01:55.000000000 -0400
+++ 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c 2005-09-29 12:01:56.000000000 -0400
@@ -20,6 +20,9 @@
{
struct sk_buff *skb;
+ if (len < ETH_ZLEN)
+ len = ETH_ZLEN;
+
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
skb->nh.raw = skb->mac.raw = skb->data;
@@ -27,6 +30,7 @@
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
skb_put(skb, len);
+ memset(skb->head, 0, len);
skb->next = skb->prev = NULL;
/* tell the network layer not to perform IP checksums
--
Ed L. Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.6.14-rc2] aoe [2/3]: use get_unaligned for accesses in ATA id buffer
2005-09-29 16:45 [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Ed L. Cashin
@ 2005-09-29 16:47 ` Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [3/3]: update to version 14 Ed L. Cashin
2005-09-29 22:21 ` [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Alan Cox
2 siblings, 0 replies; 7+ messages in thread
From: Ed L. Cashin @ 2005-09-29 16:47 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H, David S. Miller
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Use get_unaligned for possibly-unaligned multi-byte accesses to the
ATA device identify response buffer.
Index: 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c
===================================================================
--- 2.6.14-rc2-aoe.orig/drivers/block/aoe/aoecmd.c 2005-09-29 12:01:56.000000000 -0400
+++ 2.6.14-rc2-aoe/drivers/block/aoe/aoecmd.c 2005-09-29 12:01:56.000000000 -0400
@@ -8,6 +8,7 @@
#include <linux/blkdev.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
+#include <asm/unaligned.h>
#include "aoe.h"
#define TIMERTICK (HZ / 10)
@@ -315,16 +316,16 @@
u16 n;
/* word 83: command set supported */
- n = le16_to_cpup((__le16 *) &id[83<<1]);
+ n = le16_to_cpu(get_unaligned((__le16 *) &id[83<<1]));
/* word 86: command set/feature enabled */
- n |= le16_to_cpup((__le16 *) &id[86<<1]);
+ n |= le16_to_cpu(get_unaligned((__le16 *) &id[86<<1]));
if (n & (1<<10)) { /* bit 10: LBA 48 */
d->flags |= DEVFL_EXT;
/* word 100: number lba48 sectors */
- ssize = le64_to_cpup((__le64 *) &id[100<<1]);
+ ssize = le64_to_cpu(get_unaligned((__le64 *) &id[100<<1]));
/* set as in ide-disk.c:init_idedisk_capacity */
d->geo.cylinders = ssize;
@@ -335,12 +336,12 @@
d->flags &= ~DEVFL_EXT;
/* number lba28 sectors */
- ssize = le32_to_cpup((__le32 *) &id[60<<1]);
+ ssize = le32_to_cpu(get_unaligned((__le32 *) &id[60<<1]));
/* NOTE: obsolete in ATA 6 */
- d->geo.cylinders = le16_to_cpup((__le16 *) &id[54<<1]);
- d->geo.heads = le16_to_cpup((__le16 *) &id[55<<1]);
- d->geo.sectors = le16_to_cpup((__le16 *) &id[56<<1]);
+ d->geo.cylinders = le16_to_cpu(get_unaligned((__le16 *) &id[54<<1]));
+ d->geo.heads = le16_to_cpu(get_unaligned((__le16 *) &id[55<<1]));
+ d->geo.sectors = le16_to_cpu(get_unaligned((__le16 *) &id[56<<1]));
}
d->ssize = ssize;
d->geo.start = 0;
--
Ed L. Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.6.14-rc2] aoe [3/3]: update to version 14
2005-09-29 16:45 [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [2/3]: use get_unaligned for accesses in ATA id buffer Ed L. Cashin
@ 2005-09-29 16:47 ` Ed L. Cashin
2005-09-29 22:21 ` [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Alan Cox
2 siblings, 0 replies; 7+ messages in thread
From: Ed L. Cashin @ 2005-09-29 16:47 UTC (permalink / raw)
To: linux-kernel; +Cc: ecashin, Greg K-H
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Update driver version number to 14.
Index: 2.6.14-rc2-aoe/drivers/block/aoe/aoe.h
===================================================================
--- 2.6.14-rc2-aoe.orig/drivers/block/aoe/aoe.h 2005-09-29 12:06:25.000000000 -0400
+++ 2.6.14-rc2-aoe/drivers/block/aoe/aoe.h 2005-09-29 12:06:41.000000000 -0400
@@ -1,5 +1,5 @@
/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
-#define VERSION "12"
+#define VERSION "14"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"
--
Ed L. Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN
2005-09-29 16:45 [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [2/3]: use get_unaligned for accesses in ATA id buffer Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [3/3]: update to version 14 Ed L. Cashin
@ 2005-09-29 22:21 ` Alan Cox
2005-09-29 22:31 ` Ed L Cashin
2 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2005-09-29 22:21 UTC (permalink / raw)
To: Ed L. Cashin; +Cc: linux-kernel, Greg K-H
On Iau, 2005-09-29 at 12:45 -0400, Ed L. Cashin wrote:
> Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
>
> Explicitly set the minimum packet length to ETH_ZLEN and zero the
> packet data.
You still haven't explained why this is neccessary. The drivers should
be doing it for you.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN
2005-09-29 22:21 ` [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Alan Cox
@ 2005-09-29 22:31 ` Ed L Cashin
2005-09-29 23:45 ` David S. Miller
0 siblings, 1 reply; 7+ messages in thread
From: Ed L Cashin @ 2005-09-29 22:31 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel, Greg K-H
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> On Iau, 2005-09-29 at 12:45 -0400, Ed L. Cashin wrote:
>> Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
>>
>> Explicitly set the minimum packet length to ETH_ZLEN and zero the
>> packet data.
>
> You still haven't explained why this is neccessary. The drivers should
> be doing it for you.
I did respond to your earlier request post, but I forgot to make sure
you were in the CC list, sorry. I've quoted my response below.
Ed L Cashin <ecashin@coraid.com> writes:
> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
...
>> The network driver is supposed to pad frames if the hardware cannot and
>> to blank the spare bits.
>
> Ah ha.
>
>> If it isn't occurring please try and trace down
>> the offender.
>
> My colleague Sam observed problems with the e1000 driver in the
> 2.6.11.4-21.9-smp kernel from Suse 9.3 and also the e1000 driver in
> 2.6.12-1.1398_FC4smp from Fedora Core 4.
>
> The problems aren't fully characterized, but AoE ATA read packets
> appeared to be getting dropped and/or corrupted.
>
> When using the tg3 driver instead of e1000 the problems went away, and
> making the aoe driver alloc_skb with a minimum length of ETH_ZLEN also
> made the problems go away.
We suspect that the e1000 driver is misbehaving when given short
packets, but we have not had time to pinpoint what part of the e1000
driver is involved or what the specific problem is.
--
Ed L Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN
2005-09-29 22:31 ` Ed L Cashin
@ 2005-09-29 23:45 ` David S. Miller
2005-09-30 16:58 ` Ed L Cashin
0 siblings, 1 reply; 7+ messages in thread
From: David S. Miller @ 2005-09-29 23:45 UTC (permalink / raw)
To: ecashin; +Cc: alan, linux-kernel, greg
From: Ed L Cashin <ecashin@coraid.com>
Date: Thu, 29 Sep 2005 18:31:02 -0400
> We suspect that the e1000 driver is misbehaving when given short
> packets, but we have not had time to pinpoint what part of the e1000
> driver is involved or what the specific problem is.
Then the e1000 driver is where the fix belongs, not the
aoe driver.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN
2005-09-29 23:45 ` David S. Miller
@ 2005-09-30 16:58 ` Ed L Cashin
0 siblings, 0 replies; 7+ messages in thread
From: Ed L Cashin @ 2005-09-30 16:58 UTC (permalink / raw)
To: David S. Miller; +Cc: alan, linux-kernel, greg
"David S. Miller" <davem@davemloft.net> writes:
> From: Ed L Cashin <ecashin@coraid.com>
> Date: Thu, 29 Sep 2005 18:31:02 -0400
>
>> We suspect that the e1000 driver is misbehaving when given short
>> packets, but we have not had time to pinpoint what part of the e1000
>> driver is involved or what the specific problem is.
>
> Then the e1000 driver is where the fix belongs, not the
> aoe driver.
OK, then I guess this one of the three patches can be dropped.
--
Ed L Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-09-30 17:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-29 16:45 [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [2/3]: use get_unaligned for accesses in ATA id buffer Ed L. Cashin
2005-09-29 16:47 ` [PATCH 2.6.14-rc2] aoe [3/3]: update to version 14 Ed L. Cashin
2005-09-29 22:21 ` [PATCH 2.6.14-rc2] aoe [1/3]: explicitly set minimum packet length to ETH_ZLEN Alan Cox
2005-09-29 22:31 ` Ed L Cashin
2005-09-29 23:45 ` David S. Miller
2005-09-30 16:58 ` Ed L Cashin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox