mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Charlie Jenkins <charlie@rivosinc.com>
Cc: David Laight <David.Laight@aculab.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests
Date: Sun, 4 Feb 2024 09:41:56 -0800	[thread overview]
Message-ID: <ec44bf32-8b66-40c4-bc62-4deed3702f99@roeck-us.net> (raw)
In-Reply-To: <20240130-fix_sparse_errors_checksum_tests-v5-2-4d8a0a337e5e@rivosinc.com>

Hi,

On Tue, Jan 30, 2024 at 11:10:04AM -0800, Charlie Jenkins wrote:
> The test cases for ip_fast_csum and csum_ipv6_magic were using arbitrary
> alignment of data to iterate through random inputs. ip_fast_csum should
> have the data aligned along (14 + NET_IP_ALIGN) bytes and
> csum_ipv6_magic should have data aligned along 32-bit boundaries.
> 
> While this is being changed, fix up the awkward offset code in
> test_csum_ipv6_magic and use a struct instead.
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Tested-by: Guenter Roeck <linux@roeck-us.net>
> Fixes: 6f4c45cbcb00 ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum")

So this works on little endian systems. Unfortunately, I still get

[   18.447037]     # test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:463
[   18.447037]     Expected ( u64)csum_result == ( u64)expected, but
[   18.447037]         ( u64)csum_result == 33754 (0x83da)
[   18.447037]         ( u64)expected == 55939 (0xda83)
[   18.455565]     not ok 4 test_ip_fast_csum
[   18.463570]     # test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:487
[   18.463570]     Expected ( u64)csum_result == ( u64)expected, but
[   18.463570]         ( u64)csum_result == 12221 (0x2fbd)
[   18.463570]         ( u64)expected == 37721 (0x9359)
[   18.470679]     not ok 5 test_csum_ipv6_magic

when running the test on big endian systems such as hppa/parisc or sparc.

Guenter

  reply	other threads:[~2024-02-04 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 19:10 [PATCH v5 0/2] lib: checksum: Fix issues with checksum tests Charlie Jenkins
2024-01-30 19:10 ` [PATCH v5 1/2] lib: checksum: Fix type casting in checksum kunits Charlie Jenkins
2024-01-30 19:10 ` [PATCH v5 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Charlie Jenkins
2024-02-04 17:41   ` Guenter Roeck [this message]
2024-02-08  0:22     ` Charlie Jenkins
2024-02-08  9:54       ` David Laight
2024-02-08 20:09         ` Charlie Jenkins

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=ec44bf32-8b66-40c4-bc62-4deed3702f99@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=David.Laight@aculab.com \
    --cc=akpm@linux-foundation.org \
    --cc=charlie@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®