From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Hartmann Subject: Re: Memory corruption with r8169 across several device revisions and kernels Date: Wed, 24 Jan 2018 06:31:41 +0100 Message-ID: <531457fe-373c-0590-a50d-bf8f96d02195@01019freenet.de> References: <8ac81034-008b-7ad0-619c-b80bb0843c14@googlemail.com> <20180122000922.GA3020@electric-eye.fr.zoreil.com> <3ceebc43-6baf-2b4c-af10-70522e97385e@googlemail.com> <20180123.102823.1267642153979326760.davem@davemloft.net> <22a1f2d1-4ae8-d941-ab8e-00deac41d4ef@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: romieu@fr.zoreil.com, netdev@vger.kernel.org To: Oliver Freyermuth , David Miller Return-path: Received: from mx1.mailbox.org ([80.241.60.212]:51072 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbeAXFcl (ORCPT ); Wed, 24 Jan 2018 00:32:41 -0500 In-Reply-To: <22a1f2d1-4ae8-d941-ab8e-00deac41d4ef@googlemail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/23/2018 at 04:47 PM Oliver Freyermuth wrote: > Am 23.01.2018 um 16:28 schrieb David Miller: >> Looking at how these DMA counters are handled, there appears to be a >> requirement that the memory buffer is 64-byte aligned. >> >> [...] >> >> Therefore the driver needs to allocate "size + (64 - 1)" bytes and do >> the 64-byte alignment of the CPU pointer and the DMA address by hand. > > This is also what I wondered about as a non-expert in hardware drivers; > alignment should surely be enforced here. > > However, for the memory corruption I observed, I used an x86_64 system > (which I believe always has PAGE_SIZE aligned buffers). > So there should be another bug, unless I am mistaken about x86_64. > > I checked the deprecated r8168 driver by Realtek (I am not sure if this one is also affected by the issue, though) I'm using since years this driver because r8169 is broken (it is slow and it misses packages - which is extremely bad for real time applications like asterisk, if they appear 50s later ...). r8168-8.045.08 is an actual version which is provided by realtek on their homepage and which even compiles fine w/ 4.14.x. Regards, Andreas