lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Change ip_addr from struct to typedef (u32_t)


From: Bill Auerbach
Subject: RE: [lwip-users] Change ip_addr from struct to typedef (u32_t)
Date: Fri, 5 Feb 2010 15:34:42 -0500

>Behalf Of address@hidden
>Sent: Friday, February 05, 2010 9:43 AM
>
>Yes, but aside from etharp (needs struct ip_addr2),  IP frag/reass and
>netbios, wouldn't packing by 4 work for you as well? As long as the IP
>header of TX- and RX-packets is aligned, it *should* work, I think. My
>problem is I currently cannot test it - I'd have to dig out my last
>embedded platform that doesn't support unaligned pointers as Intel
>unfortunately does...

I think it would work since I have ETH_PAD_SIZE = 2.  But I think it would not 
work generally.  Packing by 2 should work on all platforms and it does help, 
because the compiler has the option to load 2 16-bit words with one shift 
instead of 4 byte loads with 3 shifts and ORs.  GCC is pretty darn good and 
does do the former with packing of 2.

Bill






reply via email to

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