netdev
[Top] [All Lists]

Re: alignment issues on netif_rx

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: alignment issues on netif_rx
From: Johannes Erdfelt <johannes@xxxxxxxxxxx>
Date: Sat, 16 Dec 2000 13:51:25 -0500
Cc: kai@xxxxxxxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <200012151606.IAA20579@xxxxxxxxxxxxxxx>; from David S. Miller on Fri, Dec 15, 2000 at 08:06:21AM -0800
References: <Pine.LNX.4.10.10012151332190.32035-100000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200012151606.IAA20579@xxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Fri, Dec 15, 2000, David S. Miller <davem@xxxxxxxxxx> wrote:
>    Date:   Fri, 15 Dec 2000 13:41:32 +0100 (CET)
>    From: Kai Germaschewski <kai@xxxxxxxxxxxxxxxxxxxxxxxx>
> 
>    Without the above fix of aligning skb->data on a 4-byte boundary, the
>    packet would get dropped later on.
> 
>    Question is: Is this the right way to handle this problem, or should
>    netif_rx be smarter and take unalignment skbs?
>    BTW: Would the above realigning make sense on other archs, too
>    (for performance reasons)?
> 
> No, the MIPS port must handle unaligned memory accesses traps
> in kernel mode and fix them up.  Every port is required to
> do this, these can happen anywhere in the networking.

The ia64 port cannot handle unaligned memory accesses in kernel mode:

arch/ia64/kernel/unaligned.c:

        /*
         * Unaligned references in the kernel could come from unaligned
         *   arguments to system calls.  We fault the user process in
         *   these cases and panic the kernel otherwise (the kernel should
         *   be fixed to not make unaligned accesses).
         */

[...]

                die_if_kernel("Unaligned reference while in kernel\n",
regs, 30)

However, I can't imagine we've made it this long without this being a
problem so there must be something I'm missing.

JE


<Prev in Thread] Current Thread [Next in Thread>