From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: mans@mansr.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 855a85a6 for ; Mon, 12 Dec 2016 16:25:46 +0000 (UTC) Received: from unicorn.mansr.com (unicorn.mansr.com [81.2.72.234]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 811db2bb for ; Mon, 12 Dec 2016 16:25:46 +0000 (UTC) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: David Laight Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version References: <20161207.135127.789629809982860453.davem@davemloft.net> <040bcdb2-2725-c8de-11d9-a4f77b75d9d8@nbd.name> <063D6719AE5E284EB5DD2968C1650D6DB023BF78@AcuExch.aculab.com> Date: Mon, 12 Dec 2016 16:31:47 +0000 In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB023BF78@AcuExch.aculab.com> (David Laight's message of "Mon, 12 Dec 2016 16:19:17 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Cc: "linux-mips@linux-mips.org" , Netdev , LKML , David Miller , WireGuard mailing list , Felix Fietkau List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. --=20 M=E5ns Rullg=E5rd