lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] Misalignment problems on PowerPC (little endian mode)


From: Muhamad Ikhwan Ismail
Subject: RE: [lwip-users] Misalignment problems on PowerPC (little endian mode)
Date: Fri, 9 May 2008 14:14:08 +0000


Hi,

Thanks Bill and Simon. Simon is right, my payload is aligned. The problem arises when the Ethernet header
gets stripped, the IP addr field is not aligned when it gets accessed. And I didnt know structure packing is a must. Then I have to
find a way to make my port works. Meaning even if i fixed my ip addr processing macros and functions, Ill still get problems ?
I thought i woulnt since all e.g TCP header fields are 2 bytes aligned ?
Anyone else with any other solutions ?

greetings
Ikhwan




> Date: Fri, 9 May 2008 15:41:31 +0200
> From: address@hidden
> To: address@hidden
> Subject: Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)
>
> I think his problem is: when the payload is aligned, the IP address is
> _not_ aligned (since the ethernet header is 14 bytes until the MAC can
> insert alignment bytes after it).
>
> Packing the structs is a _requirement_, not a. option! I strongly
> suggest you fix your port to allow packing! There will be other problems
> with other protocols, too, if you don't pack the structs they refer to.
>
> Simon
>
>
> Bill Auerbach wrote:
> >
> > Allocate the pbuf large enough to handle worst case alignment and
> > align its payload after the allocation. I do this on the PPC (8349)
> > with Receive Buffers that must be 64 byte-aligned. I added an
> > LWIP_ASSERT on the payload & 0x3F being 0 to be sure I had it right.
> > I store the payload into the Rx BD and keep a pointer to the pbuf in a
> > static array whose index is the same as the Rx BD.
> >
> >
> >
> > Bill
> >
> >
> >
> > *From:* address@hidden
> > [mailto:address@hidden *On
> > Behalf Of *Muhamad Ikhwan Ismail
> > *Sent:* Friday, May 09, 2008 9:10 AM
> > *To:* address@hidden
> > *Subject:* [lwip-users] Misalignment problems on PowerPC (little
> > endian mode)
> >
> >
> >
> >
> > Hi,
> >
> > I am interested in knowing if there is any other user of lwip who has
> > managed to implement lwip in PowerPC (little endian mode)
> > and got rid of the lil endian misalignment exceptions ? As lwip strips
> > the Ethernet header (14 bytes) the IP addr fields (4 bytes) in the IP
> > header sits on
> > a non-aligned address.My FEC is setup in a way that all received
> > buffers are stored directly into the pbufs instead of a temporary
> > buffer to minimize latency,
> > so the ethernet padding option does not really work for me. The FEC
> > can only save frames into addresses multiple of 16 only.
> >
> > So for me (as far as my knowledge limits me :) ) there 2 other
> > possibilities left, one is packing the structure, or apply changes on
> > the ip address
> > functions and macros so that it works with the ip address as 2 16 bit
> > fields instead of 1 32 bits field. Unfortunately I couldnt make
> > structure packing
> > work with my compiler (Wind River Compiler). I am interested in
> > knowing if anyone has done the same thing and mind sharing experience
> > ? Any
> > thoughts,ideas and feedbacks would also be welcomed.
> >
> > ps: I have an alignment fixing subroutine, but then again we want to
> > minimize the latency.
> >
> > Greetings and thanks in advance
> > Ikhwan Ismail
> > ABB STOTZ-KONTAKT GmbH
> > Heidelberg
> > Germany
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > Stay in touch when you're away with Windows Live Messenger. IM anytime
> > you're online.
> > <http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_messenger_052008>
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > lwip-users mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users


Windows Live SkyDrive lets you share files with faraway friends. Start sharing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]