DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] eal: remove error logs for already probed device
Date: Sat,  2 Mar 2019 03:42:52 +0100	[thread overview]
Message-ID: <20190302024253.15594-3-thomas@monjalon.net> (raw)
In-Reply-To: <20190302024253.15594-1-thomas@monjalon.net>

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 <thomas@monjalon.net>
---
 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

  parent reply	other threads:[~2019-03-02  2:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  2:42 [dpdk-dev] [PATCH 0/3] fix error path of multi-process probe Thomas Monjalon
2019-03-02  2:42 ` [dpdk-dev] [PATCH 1/3] eal: remove useless checks for already probed device Thomas Monjalon
2019-03-13 13:46   ` Zhang, Qi Z
2023-06-11  2:52     ` Stephen Hemminger
2019-03-02  2:42 ` Thomas Monjalon [this message]
2019-03-02  2:42 ` [dpdk-dev] [PATCH 3/3] eal: fix multi-process probe failure handling Thomas Monjalon
2019-03-14  7:15   ` Zhang, Qi Z
2019-03-14  7:15     ` Zhang, Qi Z
2023-06-14 19:39 ` [dpdk-dev] [PATCH 0/3] fix error path of multi-process probe Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190302024253.15594-3-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).