From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 926625961 for ; Fri, 11 Apr 2014 17:44:48 +0200 (CEST) Received: by mail-wi0-f170.google.com with SMTP id bs8so2730780wib.3 for ; Fri, 11 Apr 2014 08:46:26 -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=9zoPzsUaqsylZL0hVY1U9M9dImj9yOaIIwsYU+2vlmc=; b=VSEdRWrrhmYhSIo4vwBZGLObHUBvxRpedkQEBCJ/Ynnkxd26FoN08kcw74XUmTHe4A 7idPlGMHtPlpww7rKVBAIH+z29tGkLhrVSZVjDsMrMkZZNxJvtkT0GHqLxEgBHTf0cBF Xx/4JGhYgGiwBZs1j5VUBcZEDCaHCH5PHrsEs4AgIcDS+ZTuzVBxbadsJXSRXKEmqCTr gHL6eEseHst1B4sxeVEHO+rd/QlCysH2kzLDDC6yWRkIpvysvNJs0nCK64B8bHsQgweo o4jIAY3h/mcNMZktr9tXdASa+LT9p9RGyIbAq3MBwjM+/0jOAsgrnOvAU5/N0UskBAOu PlAQ== X-Gm-Message-State: ALoCoQnWzmvU0H32vx7/LptOutTa5d5Var5PL20vDgArCwWZugH8V1/GinpxTjPtycPyqbVZ/frj X-Received: by 10.180.104.161 with SMTP id gf1mr4196805wib.38.1397231186022; Fri, 11 Apr 2014 08:46:26 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id cu6sm11806400wjb.8.2014.04.11.08.46.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Apr 2014 08:46:25 -0700 (PDT) From: Thomas Monjalon To: Hiroshi Shimamoto Date: Fri, 11 Apr 2014 17:46:24 +0200 Message-ID: <1404995.PT3YR8Coxx@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.7-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <7724767.rVnlBRSiNS@platinum> References: <7F861DC0615E0C47A872E6F3C5FCDDBD0109D398@BPXM14GP.gisp.nec.co.jp> <7724767.rVnlBRSiNS@platinum> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, Hayato Momma Subject: Re: [dpdk-dev] [memnic PATCH v2] 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: Fri, 11 Apr 2014 15:44:48 -0000 2014-04-11 16:41, Olivier MATZ: > On Thursday, April 03, 2014 06:35:06 AM Hiroshi Shimamoto wrote: > > From: Hiroshi Shimamoto > > > > There is a race condition, on transmit to host. > > > > 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 > > > > That causes traffic stop. > > > > We have to take care about that race condition with checking > > whether current index is correct. > > > > Signed-off-by: Hiroshi Shimamoto > > Reviewed-by: Hayato Momma > > Reviewed-by: Olivier Matz Applied Thanks -- Thomas