WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] barriers before {req/rsp}_cons = cons?

To: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] barriers before {req/rsp}_cons = cons?
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 18 Jul 2008 20:31:13 +0100
Cc:
Delivery-date: Fri, 18 Jul 2008 12:31:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080718185240.GH4576@implementation>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjpDNajFWlLDFUAEd28dQAWy6hiGQ==
Thread-topic: [Xen-devel] barriers before {req/rsp}_cons = cons?
User-agent: Microsoft-Entourage/11.4.0.080122
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" <samuel.thibault@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel