From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id D55E53F9 for ; Wed, 26 Mar 2014 17:42:53 +0100 (CET) Received: by mail-wg0-f45.google.com with SMTP id l18so1461230wgh.4 for ; Wed, 26 Mar 2014 09:44:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=gGR7kOhE+RgaebQu1wiyJpSQOrc14SyhNiJx30nAjeU=; b=HIM0pc+D8VYR3eEkSBQUYafKeOdfNa4JhkMrzHbRw0SYaid56vEIzG9NP7/rsl6G0t PSWhW7K3Dm8whzYrdI9HP2E1TocGtbxonp1QF84myRQJSF3YNazbQQNfkehiY5Nrhp4Z u8ootXnc+4A/EmEOoxONfcrRes8FcduaSu2Dt+diWvLJPdXKGpH4twHUqcvYk6Mx+jHt hKUmCMNVlR1ljTbb7IVBQdmUlYHtA7FseGmWCeWxR/PjXjezKOeCborYd/uXFbF8ZaSx qIbVPRW65MdSeo3cq4pVkQsX9uAFZ6mOFlO39714DIe8pagW2chlo1TXscNi8pUSXRC0 JHQQ== X-Gm-Message-State: ALoCoQlQQoUjLqc4OExppkBnEQmLtEN7zLMvvwa2AJZav0vAJ5uUyFJtFK13T4vYvWz0IgPY/N2A X-Received: by 10.180.85.234 with SMTP id k10mr33024767wiz.32.1395852266947; Wed, 26 Mar 2014 09:44:26 -0700 (PDT) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ff9sm3941062wib.11.2014.03.26.09.44.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 09:44:25 -0700 (PDT) Message-ID: <533303E7.8050206@6wind.com> Date: Wed, 26 Mar 2014 17:44:23 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Hiroshi Shimamoto References: <7F861DC0615E0C47A872E6F3C5FCDDBD01073AD6@BPXM14GP.gisp.nec.co.jp> In-Reply-To: <7F861DC0615E0C47A872E6F3C5FCDDBD01073AD6@BPXM14GP.gisp.nec.co.jp> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" , Hayato Momma Subject: Re: [dpdk-dev] [memnic PATCH 1/5] pmd: 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: Wed, 26 Mar 2014 16:42:54 -0000 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