From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [memnic PATCH] linux: fix race condition Date: Fri, 11 Apr 2014 08:47:01 -0700 (PDT) Message-ID: <21832480.IqanGZ8f4h@xps13> References: <7F861DC0615E0C47A872E6F3C5FCDDBD0109D69F@BPXM14GP.gisp.nec.co.jp> <2469493.IGjSGz2PDr@platinum> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Olivier MATZ Return-path: In-Reply-To: <2469493.IGjSGz2PDr@platinum> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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