From: Charlie Jenkins <charlie@rivosinc.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Erhard Furtner <erhard_f@mailbox.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Palmer Dabbelt <palmer@rivosinc.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: "test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589" at boot with CONFIG_CHECKSUM_KUNIT=y enabled on a Talos II, kernel 6.8-rc5
Date: Thu, 22 Feb 2024 23:00:46 -0800 [thread overview]
Message-ID: <ZdhCnoRu3i1Cnwks@ghost> (raw)
In-Reply-To: <6c37ffa2-8642-46c0-89ba-1f1e29b094d9@csgroup.eu>
On Fri, Feb 23, 2024 at 06:58:14AM +0000, Christophe Leroy wrote:
>
>
> Le 23/02/2024 à 07:12, Charlie Jenkins a écrit :
> > On Fri, Feb 23, 2024 at 05:59:07AM +0000, Christophe Leroy wrote:
> >> Hi Erhard, hi Charlie,
> >>
> >> Le 23/02/2024 à 02:26, Erhard Furtner a écrit :
> >>> Greetings!
> >>>
> >>> Looks like my Talos II (running a BE kernel+system) fails some of the kernels internal unit tests. One of the failing tests is checksum_kunit, enabled via CONFIG_CHECKSUM_KUNIT=y:
> >>>
> >>> [...]
> >>> KTAP version 1
> >>> # Subtest: checksum
> >>> # module: checksum_kunit
> >>> 1..5
> >>> entry-flush: disabled on command line.
> >>> ok 1 test_csum_fixed_random_inputs
> >>> ok 2 test_csum_all_carry_inputs
> >>> ok 3 test_csum_no_carry_inputs
> >>> # test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589
> >>> Expected ( u64)expected == ( u64)csum_result, but
> >>> ( u64)expected == 55939 (0xda83)
> >>> ( u64)csum_result == 33754 (0x83da)
> >>> not ok 4 test_ip_fast_csum
> >>> # test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:617
> >>> Expected ( u64)expected_csum_ipv6_magic[i] == ( u64)csum_ipv6_magic(saddr, daddr, len, proto, csum), but
> >>> ( u64)expected_csum_ipv6_magic[i] == 6356 (0x18d4)
> >>> ( u64)csum_ipv6_magic(saddr, daddr, len, proto, csum) == 43586 (0xaa42)
> >>> not ok 5 test_csum_ipv6_magic
> >>> # checksum: pass:3 fail:2 skip:0 total:5
> >>> # Totals: pass:3 fail:2 skip:0 total:5
> >>> not ok 4 checksum
> >>> [...]
> >>>
> >>> Full dmesg + kernel .config attached.
> >>
> >> Looks like the same problem as the one I fixed with commit b38460bc463c
> >> ("kunit: Fix checksum tests on big endian CPUs")
> >>
> >> The new tests implemented through commit 6f4c45cbcb00 ("kunit: Add tests
> >> for csum_ipv6_magic and ip_fast_csum") create a lot of type issues as
> >> reported by sparse when built with C=2 (see below).
> >>
> >> Once those issues are fixed, it should work.
> >>
> >> Charlie, can you provide a fix ?
> >>
> >> Thanks,
> >> Christophe
> >
> > The "lib: checksum: Fix issues with checksum tests" patch should fix all of these issues [1].
> >
> > [1] https://lore.kernel.org/all/20240221-fix_sparse_errors_checksum_tests-v9-1-bff4d73ab9d1@rivosinc.com/T/#m189783a9b2a7d12e3c34c4a412e65408658db2c9
>
> It doesn't fix the issues, I still get the following with your patch 1/2
> applied:
>
> [ 6.893141] KTAP version 1
> [ 6.896118] 1..1
> [ 6.897764] KTAP version 1
> [ 6.900800] # Subtest: checksum
> [ 6.904518] # module: checksum_kunit
> [ 6.904601] 1..5
> [ 7.139784] ok 1 test_csum_fixed_random_inputs
> [ 7.590056] ok 2 test_csum_all_carry_inputs
> [ 8.064415] ok 3 test_csum_no_carry_inputs
> [ 8.070065] # test_ip_fast_csum: ASSERTION FAILED at
> lib/checksum_kunit.c:589
> [ 8.070065] Expected ( u64)expected == ( u64)csum_result, but
> [ 8.070065] ( u64)expected == 55939 (0xda83)
> [ 8.070065] ( u64)csum_result == 33754 (0x83da)
> [ 8.075836] not ok 4 test_ip_fast_csum
> [ 8.101039] # test_csum_ipv6_magic: ASSERTION FAILED at
> lib/checksum_kunit.c:617
> [ 8.101039] Expected ( u64)( __sum16)expected_csum_ipv6_magic[i]
> == ( u64)csum_ipv6_magic(saddr, daddr, len, proto, ( __wsum)csum), but
> [ 8.101039] ( u64)( __sum16)expected_csum_ipv6_magic[i] ==
> 6356 (0x18d4)
> [ 8.101039] ( u64)csum_ipv6_magic(saddr, daddr, len, proto, (
> __wsum)csum) == 43586 (0xaa42)
> [ 8.106446] not ok 5 test_csum_ipv6_magic
> [ 8.143829] # checksum: pass:3 fail:2 skip:0 total:5
> [ 8.148334] # Totals: pass:3 fail:2 skip:0 total:5
> [ 8.153173] not ok 1 checksum
>
> All your patch does is to hide the sparse warnings. But forcing a cast
> doesn't fix byte orders.
>
> Please have a look at commit b38460bc463c ("kunit: Fix checksum tests on
> big endian CPUs"), there are helpers to put checksums in the correct
> byte order.
>
> Christophe
Well that's what the second patch is for. Is it failing with the second
patch applied?
- Charlie
next prev parent reply other threads:[~2024-02-24 11:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 1:26 "test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589" at boot with CONFIG_CHECKSUM_KUNIT=y enabled on a Talos II, kernel 6.8-rc5 Erhard Furtner
2024-02-23 5:59 ` Christophe Leroy
2024-02-23 6:12 ` Charlie Jenkins
2024-02-23 6:58 ` Christophe Leroy
2024-02-23 7:00 ` Charlie Jenkins [this message]
2024-02-23 9:06 ` Christophe Leroy
2024-02-23 11:37 ` Erhard Furtner
2024-02-23 17:35 ` 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=ZdhCnoRu3i1Cnwks@ghost \
--to=charlie@rivosinc.com \
--cc=christophe.leroy@csgroup.eu \
--cc=erhard_f@mailbox.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=palmer@rivosinc.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;
as well as URLs for NNTP newsgroup(s).