From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] dev: fix attach rollback of a device that was already attached Date: Sun, 25 Nov 2018 13:25:18 +0100 Message-ID: <3765214.xbXYVEzYJZ@xps> References: <20181123144506.95367-1-dariusz.stojaczyk@intel.com> <20181123212640.111642-1-dariusz.stojaczyk@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, qi.z.zhang@intel.com To: Darek Stojaczyk Return-path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 97E941B453 for ; Sun, 25 Nov 2018 13:25:21 +0100 (CET) In-Reply-To: <20181123212640.111642-1-dariusz.stojaczyk@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 23/11/2018 22:26, Darek Stojaczyk: > When primary process receives an IPC attach request > of a device that's already locally-attached, it > doesn't setup its variables properly and is prone to > segfaulting on a subsequent rollback. > > `ret = local_dev_probe(req->devargs, &dev)` > > The above function will set `dev` pointer to the > proper device *unless* it returns with error. One of > those errors is -EEXIST, which the hotplug function > explicitly ignores. For -EEXIST, it proceeds with > attaching the device and expects the dev pointer to > be valid. > > This patch makes `local_dev_probe` set the dev pointer > even if it returns -EEXIST. > > Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary") > Cc: qi.z.zhang@intel.com > > Signed-off-by: Darek Stojaczyk Applied, thanks