[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 12 Dec 2016 16:31:47 +0000
From: Måns Rullgård <mans@...sr.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: Felix Fietkau <nbd@....name>,
"Jason A. Donenfeld" <Jason@...c4.com>,
David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>,
"WireGuard mailing list" <wireguard@...ts.zx2c4.com>,
LKML <linux-kernel@...r.kernel.org>,
"linux-mips\@linux-mips.org" <linux-mips@...ux-mips.org>
Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version
David Laight <David.Laight@...LAB.COM> writes:
> From: Måns Rullgård
>> Sent: 10 December 2016 13:25
> ...
>> I solved this problem in an Ethernet driver by copying the initial part
>> of the packet to an aligned skb and appending the remainder using
>> skb_add_rx_frag(). The kernel network stack only cares about the
>> headers, so the alignment of the packet payload doesn't matter.
>
> That rather depends on where the packet payload ends up.
> It is likely that it will be copied to userspace (or maybe
> into some aligned kernel buffer).
> In which case you get an expensive misaligned copy.
There's not much to be done about that. The only other option is to
bypass DMA entirely, and that's sure to be even worse.
> What do the hardware engineers think the ethernet interface will
> be used for!
Ticking boxes in marketing material.
--
Måns Rullgård
Powered by blists - more mailing lists