mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rich Felker <dalias@libc.org>
To: "D. Jeff Dionne" <djeffdionne@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Problems with csum_partial with misaligned buffers on sh4 platform
Date: Sun, 11 Feb 2024 11:12:13 -0500	[thread overview]
Message-ID: <20240211161212.GL22081@brightrain.aerifal.cx> (raw)
In-Reply-To: <8C704EE6-7B5E-4569-B9C3-84B2CBADA102@gmail.com>

On Sun, Feb 11, 2024 at 12:41:16PM +0900, D. Jeff Dionne wrote:
> I remember there being problems with alignment on SH targets in the
> network stack. IIRC, wireguard triggered it in actual use, seems to
> me it had to do with skb alignment.
> 
> Rich Felker may remember more, but I don’t think we implemented a
> (complete) solution.

What I recall was that some of the tunneling encapsulation code
ultimately did its zerocopy by arranging for either the inner or outer
headers to be misaligned (due to the historical badness of ethernet),
and thereby blowing up on archs without misaligned access support
(ours read/wrote bogus data, probably ignoring the low address bits or
something, on misaligned addresses). We never solved it; the code that
later worked was doing the encapsulatio in userspace without the
kernel's misaligned zerocopy stuff.

The right solution would be to make the affected accesses happen
through custom int16/int32 types with attribute packed applied to
them, so that on archs with misaligned access, the code would not
change at all, but on archs without it, the codegen would do
everything byte-by-byte and reassemble. But this would probably be an
invasive change that would make the maintainers of the network stack
unhappy...

Rich

  reply	other threads:[~2024-02-11 16:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-10 15:12 Guenter Roeck
2024-02-10 20:12 ` John Paul Adrian Glaubitz
2024-02-10 21:54   ` Guenter Roeck
2024-02-11  3:41     ` D. Jeff Dionne
2024-02-11 16:12       ` Rich Felker [this message]
2024-02-11  9:53     ` Geert Uytterhoeven
2024-02-11 14:35 ` Yoshinori Sato
2024-03-11 17:04 ` Guenter Roeck
2024-03-18 15:04   ` Linux regression tracking (Thorsten Leemhuis)
2024-03-18 15:32     ` Guenter Roeck
2024-03-18 15:58       ` Linux regression tracking (Thorsten Leemhuis)

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=20240211161212.GL22081@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=djeffdionne@gmail.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ysato@users.sourceforge.jp \
    /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®