Re: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests
From: Christophe Leroy <hidden>
Date: 2024-02-26 11:57:27
Also in:
lkml
Le 26/02/2024 à 12:47, Russell King (Oracle) a écrit :
On Mon, Feb 26, 2024 at 11:34:51AM +0000, Christophe Leroy wrote:quoted
Le 23/02/2024 à 23:11, Charlie Jenkins a écrit :quoted
The test cases for ip_fast_csum and csum_ipv6_magic were not properly aligning the IP header, which were causing failures on architectures that do not support misaligned accesses like some ARM platforms. To solve this, align the data along (14 + NET_IP_ALIGN) bytes which is the standard alignment of an IP header and must be supported by the architecture.I'm still wondering what we are really trying to fix here. All other tests are explicitely testing that it works with any alignment. Shouldn't ip_fast_csum() and csum_ipv6_magic() work for any alignment as well ? I would expect it, I see no comment in arm code which explicits that assumption around those functions.No, these functions are explicitly *not* designed to be used with any alignment. They are for 16-bit alignment only. I'm not sure where the idea that "any alignment" has come from, but it's never been the case AFAIK that we've supported that - or if we do now, that's something which has crept in under the radar.
Ok, 16-bit is fine for me, then there is no need to require a (14 + NET_IP_ALIGN) ie a 16-bytes (128-bit) alignment as this patch is doing. Christophe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel