From patchwork Sat Mar 2 02:42:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 50744 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88C234C74; Sat, 2 Mar 2019 03:43:37 +0100 (CET) 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 compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E168021DA6; Fri, 1 Mar 2019 21:43:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 01 Mar 2019 21:43:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=2xYbIfXn+p dzKMTNBYwvtCa2K6NMfGXnlYmW2v0wxLE=; b=gpZSYcjFGXRCYpS5an1uipjXtz 0ANZN/x2XE/gGDfyNmHDaEzcHALJdxGNOkUVUyahPmcs221hIaeh22QAGGx9uAII F+cJQE2bvXb+7KysIKO79Cu27qAMwPp9lwWqzEF2FoNpp9fggrgNeo6yzOKLeDa5 hmlh9ioJqmIGzkT5g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=2xYbIfXn+pdzKMTNBYwvtCa2K6NMfGXnlYmW2v0wxLE=; b=kI+BioX3 878aULhOwGY6t/BLSBE4ED21sAiaBRPQRVXIwObCf8VBqdLM7dkIRLujeLKx7PYz A2avQpZ97hifNppyLdJJlBL318ww4M6xcD1CaUrnJojQwtz6ZO3mpp/ShvTKk+bx eO9A05YoNBuyz9IKDEOYC0WKRqLo9dBtZGks79Xsz12m8xQ584kjoW8nDe01af3e 8XOUcyRE+QGtXTLjmN0rRRbAmy5ImHO0qY2EVo+1+P3wI11t8/Ma8bjgQl9gBfmQ yy+7qg3cKDSeC0PGlqHIL4RswFvOv8BDfGiDtbS3TRM5jxMTvxAv4Y1U7CB7/J1m aAD96YnUmjsL3A== 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 42D62E4339 for ; Fri, 1 Mar 2019 21:43:34 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Date: Sat, 2 Mar 2019 03:42:52 +0100 Message-Id: <20190302024253.15594-3-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 Subject: [dpdk-dev] [PATCH 2/3] eal: remove error logs 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: , 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) {