From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [memnic PATCH 1/5] pmd: fix race condition Date: Wed, 26 Mar 2014 17:44:23 +0100 Message-ID: <533303E7.8050206@6wind.com> References: <7F861DC0615E0C47A872E6F3C5FCDDBD01073AD6@BPXM14GP.gisp.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: "dev-VfR2kkLFssw@public.gmane.org" , Hayato Momma To: Hiroshi Shimamoto Return-path: In-Reply-To: <7F861DC0615E0C47A872E6F3C5FCDDBD01073AD6-ZmjkEB1lVlLt6d3pZDjeaEtBU8KWyXPq@public.gmane.org> 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" Hi Hiroshi-san, Please see my comments below. On 03/11/2014 06:37 AM, Hiroshi Shimamoto wrote: > From: Hiroshi Shimamoto > > There is a race condition, on transmit to vSwitch. I think we should not talk specifically about vSwitch, as another implementation of host memnic is possible. Maybe using the term "host" is more appropriate? > + if (idx != ACCESS_ONCE(adapter->down_idx)) { > + /* > + * vSwitch freed this and got false positive, > + * need to recover the status and retry. > + */ > + p->status = MEMNIC_PKT_ST_FREE; > + goto retry; > + } > + The patch indeed looks to improve reliability, even if it's difficult to me to be sure that there is no other race condition. Again, I would replace "vSwitch" by "host". By the way, I guess the Linux code in linux/memnic_net.c should be modified in the same way. Regards, Olivier