[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <faa17d09-15de-48e5-ad25-c43a69d0df49@roeck-us.net>
Date: Tue, 27 Feb 2024 12:31:38 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Helge Deller <deller@....de>
Cc: "James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
Charlie Jenkins <charlie@...osinc.com>, linux-parisc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] parisc: More csum_ipv6_magic fixes
On 2/27/24 12:14, Helge Deller wrote:
> On 2/27/24 19:53, Guenter Roeck wrote:
>> IPv6 checksum tests with unaligned addresses resulted in unexpected
>> failures.
>>
>> Expected expected == csum_result, but
>> expected == 46591 (0xb5ff)
>> csum_result == 46381 (0xb52d)
>> with alignment offset 1
>>
>> Oddly enough, the problem disappeared after adding test code into
>> the beginning of csum_ipv6_magic().
>>
>> As it turns out, the 'sum' parameter of csum_ipv6_magic() is declared as
>> __wsum, which is a 32-bit variable type. However, it is treated as 64-bit
>> variable in the assembler code.
>
> Nice catch!
> That kind of bugs is actually the reason why I start to prefer
> C-code over inline assembly, even if C might perform slower.
>
> I've applied that patch to the parisc git tree, but do you think
> you can come up with a better patch title, e.g.
> "strip upper 32bits of sum in csum_ipv6_magic()" ?
>
Sure. My initial fix was way more complicated, and I didn't update
the description after I figured out what was actually going on and
found the simpler fix. I'll resend.
Thanks,
Guenter
Powered by blists - more mailing lists