baseband/acc: fix logtypes register
PATCH 1/2 baseband/acc: fix logtypes register
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.
--- drivers/baseband/acc/rte_acc100_pmd.c | 4 ++-- drivers/baseband/acc/rte_vrb_pmd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +2 -2
@@ -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 */
drivers/baseband/acc/rte_vrb_pmd.c +2 -2
@@ -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. */
Signature · 1 line
2.43.0
PATCH 2/2 baseband/acc: fix common logs
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.
--- 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
drivers/baseband/acc/acc_common.c new file +7 -0
@@ -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 );
drivers/baseband/acc/acc_common.h +3 -1
@@ -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 */
drivers/baseband/acc/meson.build +1 -1
@@ -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')
Signature · 1 line
2.43.0
Re: [PATCH 2/2] baseband/acc: fix common logs
Quoted 7 lines · On Mon, 18 Dec 2023 16:43:07 +0100 David Marchand <[email protected]>…
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
Re: [PATCH 2/2] baseband/acc: fix common logs
In reply to David MarchandQuoted 49 lines · David Marchand
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 <[email protected]>--- 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.cdrivers/baseband/acc/acc_common.c new file +7
-0@@ -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 );drivers/baseband/acc/acc_common.h +3
-1@@ -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 */ drivers/baseband/acc/meson.build +0
-0
drivers/baseband/acc/meson.build endif · line 29
Quoted 7 lines
drivers/baseband/acc/meson.build +1
-1@@ -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')
Thanks,
Maxime
Maxime Coquelin
AppliedRe: [PATCH 2/2] baseband/acc: fix common logs
In reply to David MarchandQuoted 6 lines · David Marchand
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")
Quoted 8 lines
Signed-off-by David Marchand <[email protected]>--- 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
Quoted 10 lines · On Mon, 18 Dec 2023 16:43:06 +0100 David Marchand <[email protected]>…
This library was calling
RTE_LOG_REGISTER_DEFAULTtwice, 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 <[email protected]>
Quoted 37 lines · David Marchand
This library was calling
RTE_LOG_REGISTER_DEFAULTtwice, 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 <[email protected]>--- drivers/baseband/acc/rte_acc100_pmd.c | 4 ++-- drivers/baseband/acc/rte_vrb_pmd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/baseband/acc/rte_acc100_pmd.c +2
-2@@ -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 */ drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -22,9 +22,9 @@#include "vrb_pmd.h"
drivers/baseband/acc/rte_vrb_pmd.c line 30
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-2#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. */
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 7 lines · David Marchand
This library was calling
RTE_LOG_REGISTER_DEFAULTtwice, 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.
Quoted 8 lines
Fixes c2d93488c7c3 ("baseband/acc200: introduce ACC200")Signed-off-by David Marchand <[email protected]>--- 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