[1/1] eal: fix error log in rte_dev_probe

Message ID a18b51355c3c07c9b76b6c2d868851b73b01abf7.1669973539.git.wangyunjian@huawei.com (mailing list archive)
State New
Delegated to: David Marchand
Headers
Series [1/1] eal: fix error log in rte_dev_probe |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS

Commit Message

Yunjian Wang Dec. 5, 2022, 8:02 a.m. UTC
  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@dpdk.org

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

Comments

David Marchand Jan. 5, 2023, 8:34 a.m. UTC | #1
Hi Yunjian, Thomas,

On Mon, Dec 5, 2022 at 9:02 AM Yunjian Wang <wangyunjian@huawei.com> wrote:
>
> 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@dpdk.org
>
> Signed-off-by: Lipei Liang <lianglipei@huawei.com>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

It seems it is a partial fix and a duplicate work for:
https://patchwork.dpdk.org/project/dpdk/patch/20190302024253.15594-3-thomas@monjalon.net/

This patch is part of a series:
https://patchwork.dpdk.org/project/dpdk/list/?series=3612
I see no activity on it, but there were some comments.

Thomas, do you intend to work on this series of yours?
  
Yunjian Wang May 24, 2023, 7:11 a.m. UTC | #2
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Thursday, January 5, 2023 4:34 PM
> To: wangyunjian <wangyunjian@huawei.com>; Thomas Monjalon
> <thomas@monjalon.net>
> Cc: dev@dpdk.org; qi.z.zhang@intel.com; anatoly.burakov@intel.com;
> Huangshaozhang <huangshaozhang@huawei.com>; stable@dpdk.org;
> lianglipei <lianglipei@huawei.com>
> Subject: Re: [dpdk-dev] [PATCH 1/1] eal: fix error log in rte_dev_probe
> 
> Hi Yunjian, Thomas,
> 
> On Mon, Dec 5, 2022 at 9:02 AM Yunjian Wang <wangyunjian@huawei.com>
> wrote:
> >
> > 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@dpdk.org
> >
> > Signed-off-by: Lipei Liang <lianglipei@huawei.com>
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> 
> It seems it is a partial fix and a duplicate work for:
> https://patchwork.dpdk.org/project/dpdk/patch/20190302024253.15594-3-tho
> mas@monjalon.net/

I agree with Thomas's patch. Can we consider merging this patch first?
Because this err log can easily mislead problem troubleshooting.

> 
> This patch is part of a series:
> https://patchwork.dpdk.org/project/dpdk/list/?series=3612
> I see no activity on it, but there were some comments.
> 
> Thomas, do you intend to work on this series of yours?
> 
> 
> --
> David Marchand
  

Patch

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. */