[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b13b8847977d4cfa99b6a0c9a0fcbbcf@AcuMS.aculab.com>
Date: Mon, 26 Feb 2024 22:33:56 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Russell King' <linux@...linux.org.uk>, Charlie Jenkins
<charlie@...osinc.com>
CC: Guenter Roeck <linux@...ck-us.net>, Christophe Leroy
<christophe.leroy@...roup.eu>, Palmer Dabbelt <palmer@...belt.com>, "Andrew
Morton" <akpm@...ux-foundation.org>, Helge Deller <deller@....de>, "James
E.J. Bottomley" <James.Bottomley@...senpartnership.com>, Parisc List
<linux-parisc@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Palmer Dabbelt
<palmer@...osinc.com>, Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum
and csum_ipv6_magic tests
..
> I think you misunderstand. "NET_IP_ALIGN offset is what the kernel
> defines to be supported" is a gross misinterpretation. It is not
> "defined to be supported" at all. It is the _preferred_ alignment
> nothing more, nothing less.
I'm sure I've seen code that would realign IP headers to a 4 byte
boundary before processing them - but that might not have been in
Linux.
I'm also sure there are cpu which will fault double length misaligned
memory transfers - which might be used to marginally speed up code.
Assuming more than 4 byte alignment for the IP header is likely
'wishful thinking'.
There is plenty of ethernet hardware that can only write frames
to even boundaries and plenty of cpu that fault misaligned accesses.
There are even cases of both on the same silicon die.
You also pretty much never want a fault handler to fixup misaligned
ethernet frames (or really anything else for that matter).
It is always going to be better to check in the code itself.
x86 has just made people 'sloppy' :-)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists