From patchwork Mon Dec 18 15:43:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 135282 X-Patchwork-Delegate: maxime.coquelin@redhat.com 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 25AAE4373C; Mon, 18 Dec 2023 16:43:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4DDC41132; Mon, 18 Dec 2023 16:43:17 +0100 (CET) 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 498C5402ED for ; Mon, 18 Dec 2023 16:43:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702914195; 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; bh=bzGeIUb73K4G3V+WM02ZVLmwfL/wweKG4maTMLLf1gM=; b=W2LIAGp+HQPDlR4B2DHHhZ+yceM6bSL0M1laS8BKNqtelhgMRtm0wSxN4U4I5UF5jN2KtJ pE3+q9/EBVS0lkfgoiaq8wu8G1Au9wXt7nyYlNPETRpfrrv9VmbAqAQUF197aUX7A6cx6Y 5tyvHdCvzVJVOQvvCDvD+/NjCksNTn0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-PHZ9YV0MPQeJMG57zaDFvw-1; Mon, 18 Dec 2023 10:43:12 -0500 X-MC-Unique: PHZ9YV0MPQeJMG57zaDFvw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DDD3F8493EC; Mon, 18 Dec 2023 15:43:11 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2683A2026D66; Mon, 18 Dec 2023 15:43:11 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Nicolas Chautru , Maxime Coquelin Subject: [PATCH 1/2] baseband/acc: fix logtypes register Date: Mon, 18 Dec 2023 16:43:06 +0100 Message-ID: <20231218154307.1507322-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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 This library was calling RTE_LOG_REGISTER_DEFAULT twice, which means that all logs for both acc100 and vrb drivers would be emitted for pmd.baseband.acc logtype. It seems the intent was to have dedicated logtypes per driver, so register one for each with a suffix. Fixes: c2d93488c7c3 ("baseband/acc200: introduce ACC200") Signed-off-by: David Marchand Acked-by: Stephen Hemminger Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/rte_acc100_pmd.c | 4 ++-- drivers/baseband/acc/rte_vrb_pmd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 292537e24d..b837f7d7cd 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -27,9 +27,9 @@ #endif #ifdef RTE_LIBRTE_BBDEV_DEBUG -RTE_LOG_REGISTER_DEFAULT(acc100_logtype, DEBUG); +RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, DEBUG); #else -RTE_LOG_REGISTER_DEFAULT(acc100_logtype, NOTICE); +RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, NOTICE); #endif /* Calculate the offset of the enqueue register */ diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c index 686e086a5c..6a89f9d4b3 100644 --- a/drivers/baseband/acc/rte_vrb_pmd.c +++ b/drivers/baseband/acc/rte_vrb_pmd.c @@ -22,9 +22,9 @@ #include "vrb_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG -RTE_LOG_REGISTER_DEFAULT(vrb_logtype, DEBUG); +RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, DEBUG); #else -RTE_LOG_REGISTER_DEFAULT(vrb_logtype, NOTICE); +RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, NOTICE); #endif /* Calculate the offset of the enqueue register. */ From patchwork Mon Dec 18 15:43:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 135283 X-Patchwork-Delegate: maxime.coquelin@redhat.com 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 325714373C; Mon, 18 Dec 2023 16:43:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D2BD42D28; Mon, 18 Dec 2023 16:43:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B2A1542D28 for ; Mon, 18 Dec 2023 16:43:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702914199; 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=S3VgREhS2jQH/u3mn+LmeOglUIpRWrEBw8WKxgzFWj4=; b=ZUyBdIQUuyYMJWdDgiY7+q/LyOnGWZKjWMxefHEb0FZQrvvP+mlCJmb1kvmNgML0YpYIaI RkaMDIf21bOdnv7Pny9RuiS4+W14V9jR8+b23nTpeLNOvvFS9I/+ggldrcB9TlUZ3s0hVB jscpaGZ7W7rxR4KtGO6xIH+zZMOGsyo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-aal9FNFjOSG5ruEk0yOlKA-1; Mon, 18 Dec 2023 10:43:16 -0500 X-MC-Unique: aal9FNFjOSG5ruEk0yOlKA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA887101AA57; Mon, 18 Dec 2023 15:43:14 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9B3F492BC6; Mon, 18 Dec 2023 15:43:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Nicolas Chautru , Maxime Coquelin , Bruce Richardson Subject: [PATCH 2/2] baseband/acc: fix common logs Date: Mon, 18 Dec 2023 16:43:07 +0100 Message-ID: <20231218154307.1507322-2-david.marchand@redhat.com> In-Reply-To: <20231218154307.1507322-1-david.marchand@redhat.com> References: <20231218154307.1507322-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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 Logs generated by helpers common to acc100 and vrb drivers were emitted with a RTE_LOG_NOTICE == 6 == RTE_LOGTYPE_HASH. Register a dedicated logtype for this. Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code") Signed-off-by: David Marchand Acked-by: Stephen Hemminger Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/acc_common.c | 7 +++++++ drivers/baseband/acc/acc_common.h | 4 +++- drivers/baseband/acc/meson.build | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 drivers/baseband/acc/acc_common.c diff --git a/drivers/baseband/acc/acc_common.c b/drivers/baseband/acc/acc_common.c new file mode 100644 index 0000000000..f8d2b19570 --- /dev/null +++ b/drivers/baseband/acc/acc_common.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Red Hat, Inc. + */ + +#include + +RTE_LOG_REGISTER_SUFFIX(acc_common_logtype, common, INFO); diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h index bda2ad2f7a..fddeb0737b 100644 --- a/drivers/baseband/acc/acc_common.h +++ b/drivers/baseband/acc/acc_common.h @@ -150,9 +150,11 @@ #define ACC_MAX_FFT_WIN 16 +extern int acc_common_logtype; + /* Helper macro for logging */ #define rte_acc_log(level, fmt, ...) \ - rte_log(RTE_LOG_ ## level, RTE_LOG_NOTICE, fmt "\n", \ + rte_log(RTE_LOG_ ## level, acc_common_logtype, fmt "\n", \ ##__VA_ARGS__) /* ACC100 DMA Descriptor triplet */ diff --git a/drivers/baseband/acc/meson.build b/drivers/baseband/acc/meson.build index 449d1e176c..64fcf1537a 100644 --- a/drivers/baseband/acc/meson.build +++ b/drivers/baseband/acc/meson.build @@ -24,6 +24,6 @@ endif deps += ['bus_pci'] -sources = files('rte_acc100_pmd.c', 'rte_vrb_pmd.c') +sources = files('acc_common.c', 'rte_acc100_pmd.c', 'rte_vrb_pmd.c') headers = files('rte_acc_cfg.h')