public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charlie Jenkins <charlie@rivosinc.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: David Laight <David.Laight@aculab.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v6 0/2] lib: checksum: Fix issues with checksum tests
Date: Mon, 12 Feb 2024 00:26:08 -0500	[thread overview]
Message-ID: <Zcmr8C1dTuaPvXqJ@ghost> (raw)
In-Reply-To: <8dedf370-47e1-405d-85cf-53f3acfa16a0@roeck-us.net>

On Sun, Feb 11, 2024 at 11:18:36AM -0800, Guenter Roeck wrote:
> Hi,
> 
> On 2/7/24 16:22, Charlie Jenkins wrote:
> > The ip_fast_csum and csum_ipv6_magic tests did not have the data
> > types properly casted, and improperly misaligned data.
> > 
> > Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> 
> I sorted out most of the problems with this version, but I still get:
> 
>     # test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:513
>     Expected ( u64)csum_result == ( u64)expected, but
>         ( u64)csum_result == 16630 (0x40f6)
>         ( u64)expected == 65535 (0xffff)
>     not ok 5 test_csum_ipv6_magic
> 
> on m68k:q800. This is suspicious because there is no 0xffff in
> expected_csum_ipv6_magic[]. With some debugging information:
> 
> ####### num_tests=86 i=84 expect array size=84
> ####### MAX_LEN=512 WORD_ALIGNMENT=4 magic data size=42
> 
> That means the loop
> 
> 	for (int i = 0; i < num_tests; i++) {
> 		...
> 		expected = (__force __sum16)expected_csum_ipv6_magic[i];
> 		...
> 	}
> 
> will access data beyond the end of the expected_csum_ipv6_magic[] array,
> possibly because m68k doesn't pad struct csum_ipv6_magic_data to 44 bytes.

Okay I will check that out.

> 
> In this context, is the comment about proto having to be 0 really true ?
> It seems to me that the calculated checksum must be identical on both
> little and big endian systems. After all, they need to be able to talk
> to each other.

I agree, but I couldn't find a solution other than setting it to zero.
Maybe I am missing something simple...

- Charlie

> 
> Thanks,
> Guenter
> 

  reply	other threads:[~2024-02-12  5:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  0:22 [PATCH v6 0/2] lib: checksum: Fix issues with checksum tests Charlie Jenkins
2024-02-08  0:22 ` [PATCH v6 1/2] lib: checksum: Fix type casting in checksum kunits Charlie Jenkins
2024-02-08  0:22 ` [PATCH v6 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Charlie Jenkins
2024-02-08  2:45   ` Guenter Roeck
2024-02-12  6:26   ` Al Viro
2024-02-12 17:18     ` Guenter Roeck
2024-02-12 18:09       ` Charlie Jenkins
2024-02-12 18:26         ` Guenter Roeck
2024-02-12 18:12       ` Al Viro
2024-02-12 18:34         ` Guenter Roeck
2024-02-12 18:41           ` Charlie Jenkins
2024-02-12 18:43         ` Al Viro
2024-02-08  1:45 ` [PATCH v6 0/2] lib: checksum: Fix issues with checksum tests Andrew Morton
2024-02-08  2:09   ` Charlie Jenkins
2024-02-08  2:44     ` Guenter Roeck
2024-02-08  2:47       ` Palmer Dabbelt
2024-02-08  4:15 ` Guenter Roeck
2024-02-11 19:18 ` Guenter Roeck
2024-02-12  5:26   ` Charlie Jenkins [this message]
2024-02-12 17:10     ` Guenter Roeck
2024-02-16  9:01       ` Geert Uytterhoeven
2024-02-12 12:46   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zcmr8C1dTuaPvXqJ@ghost \
    --to=charlie@rivosinc.com \
    --cc=David.Laight@aculab.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lkp@intel.com \
    --cc=palmer@dabbelt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox