From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E45945936; Wed, 18 Sep 2024 11:28:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 022B242DDC; Wed, 18 Sep 2024 11:28:19 +0200 (CEST) Received: from lf-2-39.ptr.blmpb.com (lf-2-39.ptr.blmpb.com [101.36.218.39]) by mails.dpdk.org (Postfix) with ESMTP id 27298427E9 for ; Wed, 18 Sep 2024 11:28:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1726651689; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=RkNGGRS+eKupLLuR4Y+WtJcKq3LmzGKT2cobmOBLAwo=; b=TQvrPuEwwhDPzGa+KsrwGVH7hid5VjJmjtebengBzHQkrUphA5d86R9CLfYmx6qG1kf75j 34E+gZZfyDFLXcfFpKgv95wEOo6rQGfnfgDDSCOSDZbFgJGXMGjATy51tw0SSrj5eJswSN HFWx/eAbu3ZRjY0VXIWyUBcHlKtT3F3F1W6kuw6WsSbpyWWlOOTFoekalKYuf6nxjk0yq6 s7eZ/d3KUVmmZZ1N/fcwoSAJaMlrRHLiaWeznfUhP6HUJ2zJqHc9dx5yYu42+bgcrv/Y6/ a8HUtAT2sBtckTP3LxqncSFDbb5AEekfYsQwYYYJ4EDcFEHSeIj03CCQda/FWQ== Cc: , References: <20240918060936.1231758-3-wanry@yunsilicon.com> User-Agent: Mozilla Thunderbird X-Lms-Return-Path: Subject: Re: [PATCH v3 02/19] net/xsc: add log macro Date: Wed, 18 Sep 2024 17:28:07 +0800 Message-Id: <449034ef-41ec-4e17-98c6-a968bdd95d3c@yunsilicon.com> Mime-Version: 1.0 To: "David Marchand" From: "WanRenyong" Content-Transfer-Encoding: quoted-printable X-Original-From: WanRenyong Content-Type: text/plain; charset=UTF-8 In-Reply-To: Received: from [127.0.0.1] ([222.64.242.227]) by smtp.feishu.cn with ESMTPS; Wed, 18 Sep 2024 17:28:07 +0800 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 On 2024/9/18 16:56, David Marchand wrote: > On Wed, Sep 18, 2024 at 8:10=E2=80=AFAM WanRenyong = wrote: >> Add log macro to print runtime messages and trace functions. >> >> Signed-off-by: WanRenyong >> >> --- >> >> v3: >> * use RTE_LOG_LINE_PREFIX instead of rte_log >> --- >> drivers/net/xsc/xsc_ethdev.c | 11 +++++++++ >> drivers/net/xsc/xsc_log.h | 46 ++++++++++++++++++++++++++++++++++++ >> 2 files changed, 57 insertions(+) >> create mode 100644 drivers/net/xsc/xsc_log.h >> >> diff --git a/drivers/net/xsc/xsc_ethdev.c b/drivers/net/xsc/xsc_ethdev.c >> index 0e48cb76fa..58ceaa3940 100644 >> --- a/drivers/net/xsc/xsc_ethdev.c >> +++ b/drivers/net/xsc/xsc_ethdev.c >> @@ -1,3 +1,14 @@ >> /* SPDX-License-Identifier: BSD-3-Clause >> * Copyright 2024 Yunsilicon Technology Co., Ltd. >> */ >> + >> +#include "xsc_log.h" >> + >> +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_init, init, NOTICE); >> +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_driver, driver, NOTICE); >> +#ifdef RTE_ETHDEV_DEBUG_RX >> +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_rx, rx, DEBUG); >> +#endif >> +#ifdef RTE_ETHDEV_DEBUG_TX >> +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_tx, tx, DEBUG); >> +#endif >> diff --git a/drivers/net/xsc/xsc_log.h b/drivers/net/xsc/xsc_log.h >> new file mode 100644 >> index 0000000000..99a88fcd1b >> --- /dev/null >> +++ b/drivers/net/xsc/xsc_log.h >> @@ -0,0 +1,46 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright 2024 Yunsilicon Technology Co., Ltd. >> + */ >> + >> +#ifndef _XSC_LOG_H_ >> +#define _XSC_LOG_H_ >> + >> +#include >> + >> +extern int xsc_logtype_init; >> +extern int xsc_logtype_driver; >> +#define RTE_LOGTYPE_XSC_INIT xsc_logtype_init >> +#define RTE_LOGTYPE_XSC_DRV xsc_logtype_driver >> + >> + >> +#define PMD_INIT_LOG(level, ...) \ >> + RTE_LOG_LINE_PREFIX(level, XSC_INIT, "%s(): ", __func__, __VA_AR= GS__) > Thank you for converting to RTE_LOG_LINE! > >> + >> + >> +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") >> + >> +#ifdef RTE_ETHDEV_DEBUG_RX >> +extern int xsc_logtype_rx; >> +#define RTE_LOGTYPE_XSC_RX xsc_logtype_rx >> +#define PMD_RX_LOG(level, ...) \ >> + RTE_LOG_LINE_PREFIX(level, XSC_RX, "%s(): ", __func__, __VA_ARGS= __) >> +#else >> +#define PMD_RX_LOG(level, ...) do { } while (0) >> +#endif >> + >> +#ifdef RTE_ETHDEV_DEBUG_TX >> +extern int xsc_logtype_tx; >> +#define RTE_LOGTYPE_XSC_TX xsc_logtype_tx >> +#define PMD_TX_LOG(level, ...) \ >> + RTE_LOG_LINE_PREFIX(level, XSC_TX, "%s(): ", __func__, __VA_ARGS= __) >> +#else >> +#define PMD_TX_LOG(level, ...) do { } while (0) >> +#endif > I don't see any code calling those macros in the series, so I would > remove them for now. > You can introduce them in the future when needed. > > >> + >> +#define PMD_DRV_LOG_RAW(level, ...) \ >> + RTE_LOG_LINE_PREFIX(level, XSC_DRV, "%s(): ", __func__, __VA_ARG= S__) >> + >> +#define PMD_DRV_LOG(level, ...) \ >> + PMD_DRV_LOG_RAW(level, __VA_ARGS__) > The PMD_DRV_LOG_RAW macro seems unused and can be removed =3D> > PMD_DRV_LOG() directly calls RTE_LOG_LINE_PREFIX(). > > Hello, David, Thanks for review, all you mentioned above will be fixed in the next=20 version. --=20 Thanks, WanRenyong