From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 4/7] ethdev: synchronize port allocation Date: Thu, 18 Jan 2018 22:17:10 +0100 Message-ID: <3055444.2jcgdIzk6q@xps> References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1777810.s1WQivID2Y@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Gaetan Rivet , Jingjing Wu , dev@dpdk.org, Neil Horman , Bruce Richardson , Konstantin Ananyev To: Matan Azrad 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) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.