From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <sergio.gonzalez.monroy@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 8AC392BF4
 for <dev@dpdk.org>; Wed,  9 Mar 2016 15:28:10 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by orsmga101.jf.intel.com with ESMTP; 09 Mar 2016 06:27:46 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.24,311,1455004800"; d="scan'208";a="930176775"
Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.37])
 ([10.237.220.37])
 by orsmga002.jf.intel.com with ESMTP; 09 Mar 2016 06:27:46 -0800
To: Harry van Haaren <harry.van.haaren@intel.com>, david.marchand@6wind.com
References: <1457518362-32762-1-git-send-email-harry.van.haaren@intel.com>
 <1457530645-14776-1-git-send-email-harry.van.haaren@intel.com>
 <1457530645-14776-2-git-send-email-harry.van.haaren@intel.com>
From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Message-ID: <56E032E0.8050206@intel.com>
Date: Wed, 9 Mar 2016 14:27:44 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1457530645-14776-2-git-send-email-harry.van.haaren@intel.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v9 1/2] eal: fix race-condition in pri/sec
	proc startup
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 09 Mar 2016 14:28:11 -0000

On 09/03/2016 13:37, Harry van Haaren wrote:
> This patch fixes a race-condition when a primary and
> secondary process simultaneously probe PCI devices.
>
> This is implemented by moving the rte_eal_mcfg_complete()
> function call in rte_eal_init() until after rte_eal_pci_probe().
> The memory mapping of PCI device in the secondary process *must*
> happen after the primary has finished doing the mapping as it
> relies on information written by the primary.
>
> The end result is that the secondary process waits longer,
> until the primary has completed its PCI probing, and then
> notifies the secondary process.
>
> This race-condition became visible during the development of
> a function that allows a secondary process to be polling until
> a primary process exists. The secondary would then probe PCI
> devices at the same time, causing an error during rte_eal_init()
>
> Linux EAL:
> Fixes: 916e4f4f4e45 ("memory: fix for multi process support")
>
> BSD EAL:
> Fixes: 764bf26873b9 ("add FreeBSD support")
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>

Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>