From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 4B9A837A2; Sat, 2 Mar 2019 03:43:31 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EC03D21DA6; Fri, 1 Mar 2019 21:43:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 01 Mar 2019 21:43:30 -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; s=mesmtp; bh=BCUIcygcUV Pn/ftLMUSKmC2oPLjSnToBEORvOESJcB4=; b=Y83sgLs4eTJn3j3Kh3marcr4fl pbh9xLMK1WhDMu+snNixA3Azj6bsWDzXIoBc32L5avQb7svAfFMbTArkXRlxGeqJ CcA9QS7YfsW39af7QiEX131BVmceFKZuGQp0/FI0LfZq0Xn0HW6AZ/or7L378Eu5 e0yAx8/IhvjI4PBAo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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= fm2; bh=BCUIcygcUVPn/ftLMUSKmC2oPLjSnToBEORvOESJcB4=; b=qYMqVYCy ZiDGVYqzYNFhNnJbPsIYXLJfYcsHlAhHVsIgfFOU4OX8wxt8wG94ULKceo4WzE4n pveLhwhjshcCIpUB6zmClevYwt5Pa2BuOXJ1T79DTWyDqePcOsZxpWYPsQaEXnBW AGOnOyu1roChEWh2HTGQm7k58puhwlvlOz/LMad27Wedffctg3Yono8HE/lkubtO HYU2CO2ZJpIPWuwuX1m/s9wL68423wWjJrJQn5r5v3CLzfSp+ZkeEBtCb7UVfH5M BU4q55PXWk1IkicMAvjauyaffvkvNM3qoG50r+DU2g6S4lZ3ffVKLx6c89N6pr5f COusakWlwg/qFA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvdeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehm ohhnjhgrlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrg hrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D1DC0E40C1; Fri, 1 Mar 2019 21:43:29 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: dariusz.stojaczyk@intel.com, qi.z.zhang@intel.com, stable@dpdk.org Date: Sat, 2 Mar 2019 03:42:51 +0100 Message-Id: <20190302024253.15594-2-thomas@monjalon.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190302024253.15594-1-thomas@monjalon.net> References: <20190302024253.15594-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/3] eal: remove useless checks for already probed device 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: Sat, 02 Mar 2019 02:43:31 -0000 The function eal_dev_hotplug_request_to_secondary() never returns -EEXIST result. The case of already probed device is filtered out. The test in __handle_secondary_request() was always true. The test in rte_dev_probe() was never true, and that's fine not returning -EEXIST if device is already attached in secondary processes. Fixes: 494db286f37d ("eal: fix multi-process hotplug if attached in secondary") Cc: dariusz.stojaczyk@intel.com Cc: qi.z.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_eal/common/eal_common_dev.c | 9 +-------- lib/librte_eal/common/hotplug_mp.c | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index fd7f5ca7d5..048c0b025f 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -247,18 +247,11 @@ rte_dev_probe(const char *devargs) goto rollback; } - /** - * if any secondary failed to attach, we need to consider if rollback - * is necessary. - */ + /* if any secondary failed to attach, need to rollback. */ if (req.result != 0) { RTE_LOG(ERR, EAL, "Failed to attach device on secondary process\n"); ret = req.result; - - /* for -EEXIST, we don't need to rollback. */ - if (ret == -EEXIST) - return ret; goto rollback; } diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c index 4052a5c7fb..94bd1d896e 100644 --- a/lib/librte_eal/common/hotplug_mp.c +++ b/lib/librte_eal/common/hotplug_mp.c @@ -110,8 +110,7 @@ __handle_secondary_request(void *param) if (tmp_req.result != 0) { ret = tmp_req.result; RTE_LOG(ERR, EAL, "Failed to hotplug add device on secondary\n"); - if (ret != -EEXIST) - goto rollback; + goto rollback; } } else if (req->t == EAL_DEV_REQ_TYPE_DETACH) { ret = rte_devargs_parse(&da, req->devargs); -- 2.20.1