* [PATCH 2/2] baseband/acc: fix common logs
2023-12-18 15:43 [PATCH 1/2] baseband/acc: fix logtypes register David Marchand
@ 2023-12-18 15:43 ` David Marchand
2023-12-18 16:36 ` Stephen Hemminger
` (2 more replies)
2023-12-18 16:36 ` [PATCH 1/2] baseband/acc: fix logtypes register Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 3 replies; 8+ messages in thread
From: David Marchand @ 2023-12-18 15:43 UTC (permalink / raw)
To: dev; +Cc: Nicolas Chautru, Maxime Coquelin, Bruce Richardson
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 <david.marchand@redhat.com>
---
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.h>
+
+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')
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] baseband/acc: fix common logs
2023-12-18 15:43 ` [PATCH 2/2] baseband/acc: fix common logs David Marchand
@ 2023-12-18 16:36 ` Stephen Hemminger
2024-01-12 14:07 ` Maxime Coquelin
2024-02-07 9:19 ` Maxime Coquelin
2 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2023-12-18 16:36 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Nicolas Chautru, Maxime Coquelin, Bruce Richardson
On Mon, 18 Dec 2023 16:43:07 +0100
David Marchand <david.marchand@redhat.com> wrote:
> 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")
>
> Signe
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] baseband/acc: fix common logs
2023-12-18 15:43 ` [PATCH 2/2] baseband/acc: fix common logs David Marchand
2023-12-18 16:36 ` Stephen Hemminger
@ 2024-01-12 14:07 ` Maxime Coquelin
2024-02-07 9:19 ` Maxime Coquelin
2 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2024-01-12 14:07 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Nicolas Chautru, Bruce Richardson
On 12/18/23 16:43, David Marchand wrote:
> 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 <david.marchand@redhat.com>
> ---
> 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.h>
> +
> +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')
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] baseband/acc: fix common logs
2023-12-18 15:43 ` [PATCH 2/2] baseband/acc: fix common logs David Marchand
2023-12-18 16:36 ` Stephen Hemminger
2024-01-12 14:07 ` Maxime Coquelin
@ 2024-02-07 9:19 ` Maxime Coquelin
2 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2024-02-07 9:19 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Nicolas Chautru, Bruce Richardson
On 12/18/23 16:43, David Marchand wrote:
> 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 <david.marchand@redhat.com>
> ---
> 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
>
Applied to next-baseband.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] baseband/acc: fix logtypes register
2023-12-18 15:43 [PATCH 1/2] baseband/acc: fix logtypes register David Marchand
2023-12-18 15:43 ` [PATCH 2/2] baseband/acc: fix common logs David Marchand
@ 2023-12-18 16:36 ` Stephen Hemminger
2024-01-12 14:05 ` Maxime Coquelin
2024-02-07 9:18 ` Maxime Coquelin
3 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2023-12-18 16:36 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Nicolas Chautru, Maxime Coquelin
On Mon, 18 Dec 2023 16:43:06 +0100
David Marchand <david.marchand@redhat.com> wrote:
> 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 <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] baseband/acc: fix logtypes register
2023-12-18 15:43 [PATCH 1/2] baseband/acc: fix logtypes register David Marchand
2023-12-18 15:43 ` [PATCH 2/2] baseband/acc: fix common logs David Marchand
2023-12-18 16:36 ` [PATCH 1/2] baseband/acc: fix logtypes register Stephen Hemminger
@ 2024-01-12 14:05 ` Maxime Coquelin
2024-02-07 9:18 ` Maxime Coquelin
3 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2024-01-12 14:05 UTC (permalink / raw)
To: David Marchand, dev, Nicolas Chautru
On 12/18/23 16:43, David Marchand wrote:
> 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 <david.marchand@redhat.com>
> ---
> 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. */
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] baseband/acc: fix logtypes register
2023-12-18 15:43 [PATCH 1/2] baseband/acc: fix logtypes register David Marchand
` (2 preceding siblings ...)
2024-01-12 14:05 ` Maxime Coquelin
@ 2024-02-07 9:18 ` Maxime Coquelin
3 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2024-02-07 9:18 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Nicolas Chautru
On 12/18/23 16:43, David Marchand wrote:
> 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 <david.marchand@redhat.com>
> ---
> drivers/baseband/acc/rte_acc100_pmd.c | 4 ++--
> drivers/baseband/acc/rte_vrb_pmd.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
Applied to next-baseband.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread