From: Keir Fraser Subject: Re: barriers before {req/rsp}_cons = cons? Date: Fri, 18 Jul 2008 20:31:13 +0100 Message-ID: References: <20080718185240.GH4576@implementation> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080718185240.GH4576@implementation> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Could you describe the race you believe is made possible by the absence of the barrier? -- Keir On 18/7/08 19:52, "Samuel Thibault" wrote: > Hello, > > In a bunch of places, one can read code like > > cons = netif->tx.req_cons; > rmb(); /* Ensure that we see the request before we copy it. */ > memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq)); > some checks > netif->tx.req_cons = ++cons; > > Shouldn't there be a full barrier just before the req_cons assignation? > I guess we are currently not seeing bugs at least because the req will > not be overwriten until we loop in the ring, but it seems to me there > may be a bug here. > > Samuel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel