From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergio Gonzalez Monroy Subject: Re: [PATCH v8 1/2] eal: fix race-condition in pri/sec proc startup Date: Wed, 9 Mar 2016 13:23:19 +0000 Message-ID: <56E023C7.9020401@intel.com> References: <1457456825-28667-1-git-send-email-harry.van.haaren@intel.com> <1457518362-32762-1-git-send-email-harry.van.haaren@intel.com> <1457518362-32762-2-git-send-email-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Harry van Haaren , david.marchand@6wind.com Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7ED9F2B98 for ; Wed, 9 Mar 2016 14:23:22 +0100 (CET) In-Reply-To: <1457518362-32762-2-git-send-email-harry.van.haaren@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 09/03/2016 10:12, 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 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 > --- > lib/librte_eal/bsdapp/eal/eal.c | 6 +++--- > lib/librte_eal/linuxapp/eal/eal.c | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) Fix is good, I think a bit more detail on the commit message about the race condition would help for future reference. So just adding some info pointing out that the mapping of the PCI devices by the secondary *must* happen after the primary has finished doing the mapping as it relies on information filled up by the primary. Other than that, Acked-by: Sergio Gonzalez Monroy Sergio