[v5,07/27] dev: hide debug messages in device iterator

Message ID 20220905083540.2506490-8-david.marchand@redhat.com (mailing list archive)
State Not Applicable, archived
Headers
Series Bus and device cleanup for 22.11 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Sept. 5, 2022, 8:35 a.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>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test-pmd/config.c           | 4 ----
 lib/eal/common/eal_common_dev.c | 7 +++----
 2 files changed, 3 insertions(+), 8 deletions(-)
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 3a53b616d8..bc73819183 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -641,10 +641,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;
 	}