lkml.org 
[lkml]   [2006]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: [Bug 6421] New: kernel 2.6.10-2.6.16 on alpha: arch/alpha/kernel/io.c, iowrite16_rep() BUG_ON((unsigned long)src & 0x1) triggered
Ingo Oeser <netdev@axxeo.de> wrote:
>
> Stephen Hemminger wrote:
> > Looks like PIO at unaligned addresses doesn't work on alpha...
>
> Maybe this should be fixed similiar to ioread32_rep in arch/alpha/kernel/io.c?
>

I think so, but Ivan thinks networking is bust:


Ivan Kokshaysky <ink@jurassic.park.msu.ru> wrote:
>
> On Fri, Apr 21, 2006 at 04:28:30AM -0700, Andrew Morton wrote:
> > Why is it "silently corrupted"? It's just misaligned, isn't it? Networking
> > does that sometimes.
>
> Because networking does read/write "short" fields in various packet
> header structures. Results are illustrated in a following example:
>
> char foo[] __attribute__((aligned(8))) = "0123456701234567";
>
> int main()
> {
> short *bar = (short *)&foo[7];
> printf("%04x\n", *bar); /* 3037 */
> *bar = 0x4241; /* "AB" */
> printf("%s\n", foo);
> return 0;
> }
> --------
> 0037
> ^^
> 0123456A01234567
> ^
> Misalignment by two bytes for ints and longs is often unavoidable in
> networking and we can cope with it, but there is no excuse of 1-byte
> misalignment.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-22 01:12    [W:0.048 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site