[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] Checksum optimizations
From: |
Bill Auerbach |
Subject: |
RE: [lwip-devel] Checksum optimizations |
Date: |
Tue, 26 Feb 2008 13:52:25 -0500 |
> So the whole function can be effectively optimized away using:
> #define inet_chksum(x,y) ~LWIP_CHKSUM(x,y)
> ?
I tested this in inet_chksum.h:
#define inet_chksum(dataptr, len) ((u16_t) ~LWIP_CHKSUM(dataptr, len))
And before the function inet_chksum you need an #undef inet_chksum because
it's used by ipfrag.c. I also commented out the while loop.
It works fine. I didn't test for a speed improvement, but the code size has
to improve a little. I added the cast because an ISO C compiler might do
the ~ as an int operation.
Bill