eal: suppress error log on multi-process hotplug
authorChangpeng Liu <changpeng.liu@intel.com>
Wed, 19 May 2021 06:45:48 +0000 (14:45 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 10 Jul 2021 08:07:07 +0000 (10:07 +0200)
This is a normal case that the primary process already
owned one 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

index ae6010e..bf55056 100644 (file)
@@ -98,10 +98,9 @@ __handle_secondary_request(void *param)
        memset(&da, 0, sizeof(da));
        if (req->t == EAL_DEV_REQ_TYPE_ATTACH) {
                ret = local_dev_probe(req->devargs, &dev);
        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");
                        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) {
                }
                ret = eal_dev_hotplug_request_to_secondary(&tmp_req);
                if (ret != 0) {