From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Subject: Re: Alignment issues with freescale FEC driver Date: Fri, 23 Sep 2016 11:35:17 -0700 Message-ID: References: <02afb707-65de-5101-a79b-355929c4e00b@nelint.com> <5ee28ee0-cf0c-bdab-1271-f17755365c13@nelint.com> <0fe7a310-2d2f-4fca-d698-85d66122d91c@nelint.com> <20160923181301.GD22965@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Eric Dumazet , Fugang Duan , Otavio Salvador , "netdev@vger.kernel.org" , Troy Kisky , rmk+kernel@arm.linux.org.uk, Simone , "linux-arm-kernel@lists.infradead.org" To: Andrew Lunn Return-path: Received: from mail-pf0-f181.google.com ([209.85.192.181]:33431 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1035314AbcIWSfT (ORCPT ); Fri, 23 Sep 2016 14:35:19 -0400 Received: by mail-pf0-f181.google.com with SMTP id 21so44486551pfy.0 for ; Fri, 23 Sep 2016 11:35:19 -0700 (PDT) In-Reply-To: <20160923181301.GD22965@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: Thanks Andrew. On 09/23/2016 11:13 AM, Andrew Lunn wrote: >> Since the hardware requires longword alignment for its' DMA transfers, >> aligning the IP header will require a memcpy, right? > > The vf610 FEC has an SHIFT16 bit in register ENETx_TACC, which inserts > two padding bits on transmit. ENETx_RACC has the same. > > What about your hardware? > You got me with the RTFM! >>From the i.MX6DQ reference manual, bit 7 of ENET_RACC says this: "RX FIFO Shift-16 When this field is set, the actual frame data starts at bit 16 of the first word read from the RX FIFO aligning the Ethernet payload on a 32-bit boundary." Same for the i.MX6UL. I'm not sure what it will take to use this, but it seems to be exactly what we're looking for. From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric@nelint.com (Eric Nelson) Date: Fri, 23 Sep 2016 11:35:17 -0700 Subject: Alignment issues with freescale FEC driver In-Reply-To: <20160923181301.GD22965@lunn.ch> References: <02afb707-65de-5101-a79b-355929c4e00b@nelint.com> <5ee28ee0-cf0c-bdab-1271-f17755365c13@nelint.com> <0fe7a310-2d2f-4fca-d698-85d66122d91c@nelint.com> <20160923181301.GD22965@lunn.ch> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Thanks Andrew. On 09/23/2016 11:13 AM, Andrew Lunn wrote: >> Since the hardware requires longword alignment for its' DMA transfers, >> aligning the IP header will require a memcpy, right? > > The vf610 FEC has an SHIFT16 bit in register ENETx_TACC, which inserts > two padding bits on transmit. ENETx_RACC has the same. > > What about your hardware? > You got me with the RTFM! >>From the i.MX6DQ reference manual, bit 7 of ENET_RACC says this: "RX FIFO Shift-16 When this field is set, the actual frame data starts at bit 16 of the first word read from the RX FIFO aligning the Ethernet payload on a 32-bit boundary." Same for the i.MX6UL. I'm not sure what it will take to use this, but it seems to be exactly what we're looking for.