From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version Date: Mon, 12 Dec 2016 16:31:47 +0000 Message-ID: References: <20161207.135127.789629809982860453.davem@davemloft.net> <040bcdb2-2725-c8de-11d9-a4f77b75d9d8@nbd.name> <063D6719AE5E284EB5DD2968C1650D6DB023BF78@AcuExch.aculab.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "linux-mips@linux-mips.org" , Netdev , LKML , David Miller , WireGuard mailing list , Felix Fietkau To: David Laight Return-path: In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB023BF78@AcuExch.aculab.com> (David Laight's message of "Mon, 12 Dec 2016 16:19:17 +0000") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: wireguard-bounces@lists.zx2c4.com Sender: "WireGuard" List-Id: netdev.vger.kernel.org David Laight writes: > From: M=E5ns Rullg=E5rd >> 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=E5ns Rullg=E5rd