eal/hotplug: suppress one error log on primary process

Message ID 1621406749-15536-1-git-send-email-changpeng.liu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series eal/hotplug: suppress one error log on primary process |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing fail Testing issues
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Liu, Changpeng May 19, 2021, 6:45 a.m. UTC
  This is a normal case that the primary process already
owned one PCI device while the secondary process try to
attach it, so suppress the error log here to exclude
this case.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
---
 lib/eal/common/hotplug_mp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon July 10, 2021, 8:12 a.m. UTC | #1
19/05/2021 08:45, Changpeng Liu:
> This is a normal case that the primary process already
> owned one PCI device while the secondary process try to
> attach it, so suppress the error log here to exclude
> this case.
> 
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/eal/common/hotplug_mp.c b/lib/eal/common/hotplug_mp.c
index ae6010e..bf55056 100644
--- a/lib/eal/common/hotplug_mp.c
+++ b/lib/eal/common/hotplug_mp.c
@@ -98,10 +98,9 @@  static int cmp_dev_name(const struct rte_device *dev, const void *_name)
 	memset(&da, 0, sizeof(da));
 	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) {