From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] devargs: do not replace already inserted devargs Date: Thu, 08 Nov 2018 13:53:19 +0100 Message-ID: <3095983.aBgvmuOXeg@xps> References: <20181107232105.19187-1-thomas@monjalon.net> <7262839.kmssWOtaOX@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "dev@dpdk.org" , "gaetan.rivet@6wind.com" , "Zhang, Qi Z" , "Guo, Jia" To: "Stojaczyk, Dariusz" Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 817214CAB for ; Thu, 8 Nov 2018 13:53:22 +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" 08/11/2018 13:35, Stojaczyk, Dariusz: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 08/11/2018 12:25, Stojaczyk, Dariusz: > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > > > > > The devargs of a device can be replaced by a newly allocated one > > > > when trying to probe again the same device (multi-process or > > > > multi-ports scenarios). This is breaking some pointer references. > > > > > > > > It can be avoided by copying the new content, freeing the new devargs, > > > > and returning the already inserted pointer. > > > > > > > > Signed-off-by: Thomas Monjalon > > > > > > Tested-by: Darek Stojaczyk > > > > Is it fixing any use case? > > Of course it is. I was previously seeing a regression with the following scenario: > 1. hotplug device in the primary process > 2. start a secodary process > 3. hotplug device in secondary -> primary segfaults > > And now it's working. Good to know! Thank you