[dpdk-dev] [PATCH 1/1] eal: fix error log in rte_dev_probe

Yunjian Wang wangyunjian at huawei.com
Mon Dec 5 09:02:29 CET 2022


In the device probing, there is no need to log the error message in the
case, that device has been already probed and return with -EEXIST.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: stable at dpdk.org

Signed-off-by: Lipei Liang <lianglipei at huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
---
 lib/eal/common/eal_common_dev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 614ef6c9fc..4650216c78 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -264,17 +264,17 @@ rte_dev_probe(const char *devargs)
 	ret = local_dev_probe(devargs, &dev);
 
 	if (ret != 0) {
-		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)
+		if (ret != -EEXIST) {
+			RTE_LOG(ERR, EAL,
+				"Failed to attach device on primary process\n");
 			return ret;
+		}
 	}
 
 	/* primary send attach sync request to secondary. */
-- 
2.27.0



More information about the dev mailing list