[05/11] drivers: reuse default logtype for SFC drivers
Checks
Commit Message
Nothing is fixed here, just reuse the value coming from the build
framework rather than use a fixed string that may get wrong in the
future.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/sfc/sfc_log.h | 7 ++-----
drivers/vdpa/sfc/sfc_vdpa_log.h | 7 ++-----
2 files changed, 4 insertions(+), 10 deletions(-)
Comments
On 9/7/24 17:54, David Marchand wrote:
> Nothing is fixed here, just reuse the value coming from the build
> framework rather than use a fixed string that may get wrong in the
> future.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
@@ -13,9 +13,6 @@
/** Generic driver log type */
extern int sfc_logtype_driver;
-/** Common log type name prefix */
-#define SFC_LOGTYPE_PREFIX "pmd.net.sfc."
-
/** Log PMD generic message, add a prefix and a line break */
#define SFC_GENERIC_LOG(level, ...) \
rte_log(RTE_LOG_ ## level, sfc_logtype_driver, \
@@ -23,10 +20,10 @@ extern int sfc_logtype_driver;
RTE_FMT_TAIL(__VA_ARGS__ ,)))
/** Name prefix for the per-device log type used to report basic information */
-#define SFC_LOGTYPE_MAIN_STR SFC_LOGTYPE_PREFIX "main"
+#define SFC_LOGTYPE_MAIN_STR RTE_STR(RTE_LOG_DEFAULT_LOGTYPE) ".main"
/** Device MCDI log type name prefix */
-#define SFC_LOGTYPE_MCDI_STR SFC_LOGTYPE_PREFIX "mcdi"
+#define SFC_LOGTYPE_MCDI_STR RTE_STR(RTE_LOG_DEFAULT_LOGTYPE) ".mcdi"
#define SFC_LOG_PREFIX_MAX 32
@@ -8,9 +8,6 @@
/** Generic driver log type */
extern int sfc_vdpa_logtype_driver;
-/** Common log type name prefix */
-#define SFC_VDPA_LOGTYPE_PREFIX "pmd.vdpa.sfc."
-
/** Log PMD generic message, add a prefix and a line break */
#define SFC_VDPA_GENERIC_LOG(level, ...) \
rte_log(RTE_LOG_ ## level, sfc_vdpa_logtype_driver, \
@@ -18,10 +15,10 @@ extern int sfc_vdpa_logtype_driver;
RTE_FMT_TAIL(__VA_ARGS__ ,)))
/** Name prefix for the per-device log type used to report basic information */
-#define SFC_VDPA_LOGTYPE_MAIN_STR SFC_VDPA_LOGTYPE_PREFIX "main"
+#define SFC_VDPA_LOGTYPE_MAIN_STR RTE_STR(RTE_LOG_DEFAULT_LOGTYPE) ".main"
/** Device MCDI log type name prefix */
-#define SFC_VDPA_LOGTYPE_MCDI_STR SFC_VDPA_LOGTYPE_PREFIX "mcdi"
+#define SFC_VDPA_LOGTYPE_MCDI_STR RTE_STR(RTE_LOG_DEFAULT_LOGTYPE) ".mcdi"
#define SFC_VDPA_LOG_PREFIX_MAX 32