From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1849921711; Sun, 25 Nov 2018 07:25:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 25 Nov 2018 07:25:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=fuMnSOzH3hyqWdxPgrW1sE3+CmkDM8Q4t5q8GXq8MJc=; b=EG63vKDxKIvQ qWZalzw8CczJhavr8orDhD06C1pMaRyTcDxCswrKiuHWQbYF7FJwR/JIHT2mjvL7 qeYiyOnje493oucUT7ZM+TNQGwvYq93JvcbpEnErU0YB3RK+Y0MzMqUZt8SElnQj Nf/XqEQqHGuSE449E3nN4uEZL6Uz4RE= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=fuMnSOzH3hyqWdxPgrW1sE3+CmkDM8Q4t5q8GXq8M Jc=; b=uH8m23JJCACNCedWC4QzwSYAP2fn4eh6ocYhN9DaWNWMzDFRmbEGceYwT V3elDjETmCQ++7X1yo/7cIT2tYkVSDxtcRD+qugzTeIQq+iiQwffarxWK5cxxeB+ 3Nuy9rLHmrvTLTIvE0STxXEvXa60RVsGlCHev3nn0VohMNSxYHh1XeaCIvs+6MsR DFUUg6+o5P93xLBqn6VjMLhhp2l1RmWuin6Co4kR5UHxmJxaUCRkbuh5jV8w1PM+ i2BvMXxqOsRia+5fiAVSVYB2O8VNCMYgrcY/pM+vc5uDNnJhD6Lz7v5xRTgZhIK8 IhWs2bFhocANbqafbPDgYtaywkwYA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 900A7E4750; Sun, 25 Nov 2018 07:25:19 -0500 (EST) From: Thomas Monjalon To: Darek Stojaczyk Cc: dev@dpdk.org, qi.z.zhang@intel.com Date: Sun, 25 Nov 2018 13:25:18 +0100 Message-ID: <3765214.xbXYVEzYJZ@xps> In-Reply-To: <20181123212640.111642-1-dariusz.stojaczyk@intel.com> References: <20181123144506.95367-1-dariusz.stojaczyk@intel.com> <20181123212640.111642-1-dariusz.stojaczyk@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] dev: fix attach rollback of a device that was already attached 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: Sun, 25 Nov 2018 12:25:21 -0000 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