From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 73E9F1B018 for ; Thu, 18 Jan 2018 22:17:45 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 04F8020DB8; Thu, 18 Jan 2018 16:17:45 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 18 Jan 2018 16:17:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=sgkTAvQG1FfCK4yLXKFm08ghsc +6CH/J8oCDVe79L5I=; b=CCIwvOuy5kmey8ddqjoPlSIBHFYS5Zdrddl2lcGrmA jnVrZMmZ26qOzzeQifEk2woUQxG6m0V4+/ipFlc4tm/wngD1QyAyEjuctr8DJbht XlLjScSK8lgmF1LOEgUqqJej0kbE2MqvF3GHbRrvibdFqnSNaMFwDC2Mx9WcX/ZB k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=sgkTAv QG1FfCK4yLXKFm08ghsc+6CH/J8oCDVe79L5I=; b=ct6fFr2SScqee8K50GA+ZU qIKIEp2wXPAPkifoaVvbJULeaZ2zdE1BZbQTgC2SeNAe4LSXO/iYqI76RNocWxPl oN0hcF29a6OXam3Kz30vUAImqAtrlT4xIxcd5JqHWuA8uKayqY3Frb/9N6sB5STH Ps7PiFfVDK3i3y4pFNPWBen0WSxnAmwomftAYkihWtSB0dv1U6Xyk0VqACWi7fEo EZDM/YG7FwBgdPts5wxLTVElzSUc4SHfdOpN0/EbzZh0UXnoUgq+LB45IaJXNlkQ 89infzFsKXKaRLqpTKAi/zVluY1vXvKxV5ryzcvNLcUmprC3waCvmlKLs071nPoA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A9AA57E34D; Thu, 18 Jan 2018 16:17:44 -0500 (EST) From: Thomas Monjalon To: Matan Azrad Cc: Gaetan Rivet , Jingjing Wu , dev@dpdk.org, Neil Horman , Bruce Richardson , Konstantin Ananyev Date: Thu, 18 Jan 2018 22:17:10 +0100 Message-ID: <3055444.2jcgdIzk6q@xps> In-Reply-To: References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1777810.s1WQivID2Y@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 4/7] ethdev: synchronize port allocation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:17:45 -0000 18/01/2018 21:52, Matan Azrad: > From: Thomas Monjalon, Thursday, January 18, 2018 10:44 PM > > 18/01/2018 17:35, Matan Azrad: > > > rte_eth_dev_allocate(const char *name) { > > > uint16_t port_id; > > > - struct rte_eth_dev *eth_dev; > > > + struct rte_eth_dev *eth_dev = NULL; > > > + > > > + /* Synchronize share data one time allocation between local > > > + threads. */ > > > > I don't understand the "one time" part of this comment. > > Please could you try to rephrase it? > > One-time means this allocation will run only 1 time. > > After the first allocation the pointer is not null, so no calling anymore to this function. Suggestion: Synchronize local threads to allocate shared data only once.