lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Is there any interest in an inlined IP checksum compile


From: address@hidden
Subject: Re: [lwip-devel] Is there any interest in an inlined IP checksum compile-time option?
Date: Sat, 31 Jan 2009 10:52:50 +0100
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

bill wrote:

I’ve found (on just one target) that inlining the IP checksum yields from 1.25 to 1.5% more throughput transmitting packets. Since the compiler already touches the 16 (u16_t) words and can sum in a register variable, the additional code isn’t much more compared to the function call plus htons that is used currently (the inline sum works out to be in network order which may be true only on a little endian processor). The offset word is always 0 and can be skipped. I did this inlining is only in the ip_output_if function. I know it’s not much, but it’s wasted processor time nonetheless.


Did you mean inlining inet_chksum_pseudo()? Because LWIP_CHKSUM() can already be aligned as it is a define. Of course, the IP code could use that define instead of using the function that directly calls this (inet_chksum())! The problem with inlining inet_chksum_pseudo() would be that it has to be in a header file to do that. And after all, I think creating an optimized LWIP_CHKSUM routine in assembly has more impact than inlining this code...

Simon




reply via email to

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