From: Guenter Roeck <linux@roeck-us.net>
To: Charlie Jenkins <charlie@rivosinc.com>,
David Laight <David.Laight@aculab.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: 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: Sun, 11 Feb 2024 11:18:36 -0800 [thread overview]
Message-ID: <8dedf370-47e1-405d-85cf-53f3acfa16a0@roeck-us.net> (raw)
In-Reply-To: <20240207-fix_sparse_errors_checksum_tests-v6-0-4caa9629705b@rivosinc.com>
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.
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.
Thanks,
Guenter
next prev parent reply other threads:[~2024-02-11 19:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 0:22 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 [this message]
2024-02-12 5:26 ` Charlie Jenkins
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=8dedf370-47e1-405d-85cf-53f3acfa16a0@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=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
all inboxes | Powered by JetHome®