From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 99B385961 for ; Fri, 11 Apr 2014 17:45:24 +0200 (CEST) Received: by mail-wg0-f41.google.com with SMTP id n12so5621037wgh.12 for ; Fri, 11 Apr 2014 08:47:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=qNUXXhu0gK8cm2KqjAAbNvJqBv6EP3CptXXRDQCkrwA=; b=lFZchy/gWIlzgcd3J8Ycd0pWWUpC2ylucQLASEPu4CCiMyKJLD4hI3E8d9eSul49ed EIUK/Ck/7Qn8da8VxeMk3nGf+inMEKoC6vkrUAVVSGkyzoC65ugZo70oN/NMHf7e+kD8 00HvOVlp7DrkOykZH1leJJ/kx3PIz79bbQlTiSiJJdQg+IDHrlBDzAYyXOQV1CIVrY2d S32/YWbl1EXZBMkBpjvKrPGnQDioYWYIsM3qWdqMK8ZU6MgjzX09szQRbzaNKvQ4mlsB ZwmpqZNtIclXJI2SfL9zhbI7s9kFdHKoeD+he7o0yeqkvlDV4BcmqwbX/MpwXsOpymO8 ps8Q== X-Gm-Message-State: ALoCoQndleRf10EsiZUVYGOsXJITX8XR55ldJT7pbsQHcEn1D4nqhYIt5p9FrKoWl7ExGBax33RW X-Received: by 10.180.24.72 with SMTP id s8mr4153423wif.20.1397231221793; Fri, 11 Apr 2014 08:47:01 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id vh3sm11801085wjc.18.2014.04.11.08.47.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Apr 2014 08:47:01 -0700 (PDT) From: Thomas Monjalon To: Olivier MATZ Date: Fri, 11 Apr 2014 08:47:01 -0700 (PDT) Message-ID: <21832480.IqanGZ8f4h@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.7-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <2469493.IGjSGz2PDr@platinum> References: <7F861DC0615E0C47A872E6F3C5FCDDBD0109D69F@BPXM14GP.gisp.nec.co.jp> <2469493.IGjSGz2PDr@platinum> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [memnic PATCH] linux: fix race condition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 15:45:24 -0000 2014-04-11 11:41, Olivier MATZ: > On Thursday, April 03, 2014 07:35:50 AM Hiroshi Shimamoto wrote: > > From: Hiroshi Shimamoto > > > > Same as PMD, there is a race condition between host and guest > > in the guest MEMNIC kernel driver. > > > > Guest PMD Host > > Thread-A Thread-B vSwitch > > > > |idx=0 |idx=0 |p[0] st!=2 > > |cmpxchg | | > > |p[0] st->1 | | > > |idx=1 | | > > |fill data | | > > |p[0] st->2 | |p[0] st==2 > > | > > | | |receive data > > | | |p[0] st->0 > > | | > > | |cmpxchg | > > | |success |p[1] st!=2 > > | |p[0] st->1 | > > | | > > This is BAD > > > > Signed-off-by: Hiroshi Shimamoto > > --- > > > > linux/memnic_net.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > Reviewed-by: Olivier Matz Applied Thanks -- Thomas