From: Karl Beldan Subject: Re: [PATCH] net: mv643xx_eth: reclaim TX skbs only when released by the HW Date: Wed, 5 Nov 2014 19:31:45 +0100 Message-ID: <20141105183145.GA9043@magnum.frso.rivierawaves.com> References: <1415197979-1702-1-git-send-email-karl.beldan@gmail.com> <545A3838.3090606@free-electrons.com> <20141105150521.GA25354@magnum.frso.rivierawaves.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: David Miller , Ian Campbell , Karl Beldan , netdev@vger.kernel.org, Eric Dumazet , Sebastian Hesselbarth To: Ezequiel Garcia Return-path: Received: from mail-wi0-f174.google.com ([209.85.212.174]:37557 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751171AbaKESby (ORCPT ); Wed, 5 Nov 2014 13:31:54 -0500 Received: by mail-wi0-f174.google.com with SMTP id d1so13278401wiv.1 for ; Wed, 05 Nov 2014 10:31:51 -0800 (PST) Content-Disposition: inline In-Reply-To: <20141105150521.GA25354@magnum.frso.rivierawaves.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Nov 05, 2014 at 04:05:21PM +0100, Karl Beldan wrote: > On Wed, Nov 05, 2014 at 11:46:16AM -0300, Ezequiel Garcia wrote: > > Hi Karl, > > > > On 11/05/2014 11:32 AM, Karl Beldan wrote:> From: Karl Beldan > > > > > > ATM, txq_reclaim will dequeue and free an skb for each tx desc released > > > by the hw that has TX_LAST_DESC set. However, in case of TSO, each > > > hw desc embedding the last part of a segment has TX_LAST_DESC set, > > > losing the one-to-one 'last skb frag'/'TX_LAST_DESC set' correspondance, > > > which causes data corruption. > > > > > > Fix this by checking TX_ENABLE_INTERRUPT instead of TX_LAST_DESC, and > > > warn when trying to dequeue from an empty txq (which can be symptomatic > > > of releasing skbs prematurely). > > > > > > Fixes: 3ae8f4e0b98 ('net: mv643xx_eth: Implement software TSO') > > > > Although your change makes sense, this isn't fixing the issue for me, > > neither did the previous one. > > > This change fixes a serious issue. > On my side I can now trigger misc NFS and md5sums errors very easily, > which I haven't detected so far with it applied. > Are you running little endian ? Do you have the tso alignment fix > a63ba13e (I don't expect it to be required but I don't know what SoC you > are using) ? I suppose you are running with all 3 fixes applied. > Also, I haven't checked SMP issues and I only have one core, if you are using SMP it might be worth looking into that, maybe try running on one core only (I only have an MV78200). Karl