lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] IP Address Display Functions


From: Mandeep Sandhu
Subject: Re: [lwip-users] IP Address Display Functions
Date: Tue, 25 Aug 2009 11:57:29 +0530

> I'd like to add that the packing around struct ip_addr is also unnecessary.
> Although it seems benign, it's not.  My version of GCC (NIOS) treats this
> packed struct as char array and does 4 byte loads, ANDs, shifts, and ORs
> everywhere this stuct was used.  I simply use:
>
> struct ip_addr {
>  u32_t addr;
> };

I second it.

I get whole bunch of warnings for etharp.h as well (I'm using it with
ecos, using
their gcc "i386-elf". I get warnings for the "struct etharp_hdr" as well.

One has to painfully sift through all these warnings to find out if
your own code is
responsible for any one of them.

Why can't we have a single "packed" attribute at the end of the struct instead
of using it each time at the field level?

I'm using an older version of lwIP - 1.1.1.  Please ignore my rant if
this is already
fixed.

Thanks,
-mandeep

>
> If there was a reason for the packing, I don't see it.  If it's used within
> another struct, the packing of the outer struct defines the behavior.  On
> the NIOS GCC build, this was one of the 3 non-code-changing optimizations I
> made that had a noticeable effect on bandwidth and codesize of both UDP and
> TCP.  I think this has to be because the ip_addr struct is so heavily used.
> I recommend the patch above.  If there's an argument that packing is
> required for a single member struct, I'm interesting seeing the reason or
> proof that it's required.
>
> Bill
>
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

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