From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH 2/3] eal: remove error logs for already probed device Date: Sat, 2 Mar 2019 03:42:52 +0100 Message-ID: <20190302024253.15594-3-thomas@monjalon.net> References: <20190302024253.15594-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit To: dev@dpdk.org Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 85A5E4C8E for ; Sat, 2 Mar 2019 03:43:35 +0100 (CET) Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 42D62E4339 for ; Fri, 1 Mar 2019 21:43:34 -0500 (EST) In-Reply-To: <20190302024253.15594-1-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In functions rte_dev_probe() and __handle_secondary_request(), an error message was logged as a failure if the probe returns -EEXIST. Anyway this error code is not returned by rte_dev_probe() as it is not considered as an error. For instance, in multi-process case, some synchronizations may request to probe a device which was already probed before by the process. Signed-off-by: Thomas Monjalon --- lib/librte_eal/common/eal_common_dev.c | 12 ++---------- lib/librte_eal/common/hotplug_mp.c | 5 ++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 048c0b025f..deaaea9345 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -222,18 +222,10 @@ rte_dev_probe(const char *devargs) /* primary attach the new device itself. */ ret = local_dev_probe(devargs, &dev); - if (ret != 0) { + if (ret != 0 && ret != -EEXIST) { RTE_LOG(ERR, EAL, "Failed to attach device on primary process\n"); - - /** - * it is possible that secondary process failed to attached a - * device that primary process have during initialization, - * so for -EEXIST case, we still need to sync with secondary - * process. - */ - if (ret != -EEXIST) - return ret; + return ret; } /* primary send attach sync request to secondary. */ diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c index 94bd1d896e..69e9a16d6a 100644 --- a/lib/librte_eal/common/hotplug_mp.c +++ b/lib/librte_eal/common/hotplug_mp.c @@ -96,10 +96,9 @@ __handle_secondary_request(void *param) if (req->t == EAL_DEV_REQ_TYPE_ATTACH) { ret = local_dev_probe(req->devargs, &dev); - if (ret != 0) { + if (ret != 0 && ret != -EEXIST) { RTE_LOG(ERR, EAL, "Failed to hotplug add device on primary\n"); - if (ret != -EEXIST) - goto finish; + goto finish; } ret = eal_dev_hotplug_request_to_secondary(&tmp_req); if (ret != 0) { -- 2.20.1