diff mbox series

[RFC,03/11] dev: hide debug messages in device iterator

Message ID 20220628144643.1213026-4-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series Bus cleanup for 22.11 | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand June 28, 2022, 2:46 p.m. UTC
For any bus that does not support device iteration, rte_dev_iterator_init
both returned an error code and logged an error message.
An application (like testpmd) that only wants to list devices, would have
no choice but to inspect a bus object to avoid spewing error logs.

Make those log messages debug level, and remove the check in testpmd.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test-pmd/config.c           | 4 ----
 lib/eal/common/eal_common_dev.c | 7 +++----
 2 files changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 62833fe97c..82db14f3a6 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -612,10 +612,6 @@  device_infos_display(const char *identifier)
 		if (identifier && da.bus != next)
 			continue;
 
-		/* Skip buses that don't have iterate method */
-		if (!next->dev_iterate)
-			continue;
-
 		snprintf(devstr, sizeof(devstr), "bus=%s", next->name);
 		RTE_DEV_FOREACH(dev, devstr, &dev_iter) {
 
diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 9d913e5478..b6f0392f30 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -592,18 +592,17 @@  rte_dev_iterator_init(struct rte_dev_iterator *it,
 	 * one layer specified.
 	 */
 	if (bus == NULL && cls == NULL) {
-		RTE_LOG(ERR, EAL,
-			"Either bus or class must be specified.\n");
+		RTE_LOG(DEBUG, EAL, "Either bus or class must be specified.\n");
 		rte_errno = EINVAL;
 		goto get_out;
 	}
 	if (bus != NULL && bus->dev_iterate == NULL) {
-		RTE_LOG(ERR, EAL, "Bus %s not supported\n", bus->name);
+		RTE_LOG(DEBUG, EAL, "Bus %s not supported\n", bus->name);
 		rte_errno = ENOTSUP;
 		goto get_out;
 	}
 	if (cls != NULL && cls->dev_iterate == NULL) {
-		RTE_LOG(ERR, EAL, "Class %s not supported\n", cls->name);
+		RTE_LOG(DEBUG, EAL, "Class %s not supported\n", cls->name);
 		rte_errno = ENOTSUP;
 		goto get_out;
 	}