Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbbBUSJH (ORCPT ); Sat, 21 Feb 2015 13:09:07 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:54249 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbbBUSJE (ORCPT ); Sat, 21 Feb 2015 13:09:04 -0500 Message-ID: <1424542141.5565.46.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: 1e918876 breaks r8169 (linux-3.18+) From: Eric Dumazet To: Florian Westphal Cc: Tomas Szepe , Francois Romieu , Hayes Wang , Eric Dumazet , Tom Herbert , "David S. Miller" , Marco Berizzi , linux-kernel@vger.kernel.org, netdev Date: Sat, 21 Feb 2015 10:09:01 -0800 In-Reply-To: <20150221174625.GA29681@breakpoint.cc> References: <20150203100816.GA5807@louise.pinerecords.com> <20150203104214.GG24751@breakpoint.cc> <20150210154536.GB16264@breakpoint.cc> <20150221101512.GB17223@louise.pinerecords.com> <20150221103104.GA26574@breakpoint.cc> <1424535746.5565.42.camel@edumazet-glaptop2.roam.corp.google.com> <20150221174625.GA29681@breakpoint.cc> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 36 On Sat, 2015-02-21 at 18:46 +0100, Florian Westphal wrote: > Eric Dumazet wrote: > > Hold on. > > > > I believe there is one race in the way you access skb->xmit_more _after_ > > > > txd->opts1 = cpu_to_le32(status); > > > > After this point, TX might have completed and TX completion already have > > freed skb > > Hmm, I _thought_ HW would not start xmit of this descriptor/skb until after > > RTL_W8(TxPoll, NPQ); Note this 'kick' does not provide tail ptr. NIC basically looks at TX descriptors to find ones with the DescOwn bit set. It stops when if find one TX descriptor _without_ DescOwn. So what can happen here is the NIC was kicked earlier (prior transmit), but found your TX descriptor, before you got a chance to read skb->xmit_more This is why we have these wmb() everywhere. We want to do txd->opts1 = XXX Only when we are really ready. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/