From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753535AbcLLQby convert rfc822-to-8bit (ORCPT ); Mon, 12 Dec 2016 11:31:54 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:56766 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbcLLQbx (ORCPT ); Mon, 12 Dec 2016 11:31:53 -0500 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: David Laight Cc: Felix Fietkau , "Jason A. Donenfeld" , David Miller , Netdev , "WireGuard mailing list" , LKML , "linux-mips\@linux-mips.org" 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: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Laight 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