From patchwork Tue Jun 28 14:46:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113516 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB3CFA056B; Tue, 28 Jun 2022 16:47:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B6104282F; Tue, 28 Jun 2022 16:47:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id DB72A40042 for ; Tue, 28 Jun 2022 16:47:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656427625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TvL2FvONbGdRl6xF+cEyaeGAHWCIrxMbeJhp9MTRuKg=; b=MCFtqUwdvKPs3pKzkFimcC4Jooa68QoqTEstkaI5iG0KpldJoHHC6hoXimLiWWy3BrSwie /C/O/+8Nex4WNgZFaxB6A6hW7mZeDNSP4np/83Pl/SoVbRall8GeXVIqALtQDLCci+t6w2 N9jhNwCo9tWSROXo1dCErr/MZl8WP7M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-536-4QhI-ViAMsSFyLOrwfX3dw-1; Tue, 28 Jun 2022 10:47:01 -0400 X-MC-Unique: 4QhI-ViAMsSFyLOrwfX3dw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7EFD41019C86; Tue, 28 Jun 2022 14:47:01 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.194.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 479682166B26; Tue, 28 Jun 2022 14:47:00 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, kevin.laatz@intel.com, Aman Singh , Yuying Zhang Subject: [RFC PATCH 03/11] dev: hide debug messages in device iterator Date: Tue, 28 Jun 2022 16:46:35 +0200 Message-Id: <20220628144643.1213026-4-david.marchand@redhat.com> In-Reply-To: <20220628144643.1213026-1-david.marchand@redhat.com> References: <20220628144643.1213026-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- app/test-pmd/config.c | 4 ---- lib/eal/common/eal_common_dev.c | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) 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; }