lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] parisc: More csum_ipv6_magic fixes
From
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


\
 
 \ /
  Last update: 2024-05-27 15:25    [W:0.046 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site