Messages in this thread Patch in this message | | | Subject | RE: [RFC] csum experts, csum_replace2() is too expensive | From | Eric Dumazet <> | Date | Mon, 24 Mar 2014 07:13:42 -0700 |
| |
On Mon, 2014-03-24 at 06:17 -0700, Eric Dumazet wrote: > On Mon, 2014-03-24 at 10:30 +0000, David Laight wrote:
> > ip_fast_csum() either needs an explicit "m" constraint for the actual > > buffer (and target) bytes, or the stronger "memory" constraint. > > The 'volatile' is then not needed.
I am testing the following :
diff --git a/arch/x86/include/asm/checksum_64.h b/arch/x86/include/asm/checksum_64.h index e6fd8a026c7b..89d7fa8837b5 100644 --- a/arch/x86/include/asm/checksum_64.h +++ b/arch/x86/include/asm/checksum_64.h @@ -45,6 +45,9 @@ static inline __sum16 csum_fold(__wsum sum) static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) { unsigned int sum; + struct full_ip_header { + unsigned int w[ihl]; + }; asm(" movl (%1), %0\n" " subl $4, %2\n" @@ -67,8 +70,9 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) are modified, we must also specify them as outputs, or gcc will assume they contain their original values. */ : "=r" (sum), "=r" (iph), "=r" (ihl) - : "1" (iph), "2" (ihl) - : "memory"); + : "1" (iph), "2" (ihl), + "m" (*(struct full_ip_header *) iph) + ); return (__force __sum16)sum; }
| |