DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH 3/6] net/sfc: remove use of EAL logtype
Date: Tue, 25 Jun 2024 14:24:11 +0200	[thread overview]
Message-ID: <20240625122414.1065829-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20240625122414.1065829-1-david.marchand@redhat.com>

When registering a common logtype for this driver, instead of
explicitly fall back to EAL, rely on the log registration macro to
achieve the same.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/sfc/sfc_ethdev.c | 12 +-----------
 drivers/net/sfc/sfc_log.h    |  2 +-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 92ca5e7a60..24686a1eaf 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -37,8 +37,6 @@
 #define SFC_XSTAT_ID_INVALID_VAL  UINT64_MAX
 #define SFC_XSTAT_ID_INVALID_NAME '\0'
 
-uint32_t sfc_logtype_driver;
-
 static struct sfc_dp_list sfc_dp_head =
 	TAILQ_HEAD_INITIALIZER(sfc_dp_head);
 
@@ -3618,12 +3616,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_sfc_efx,
 	SFC_KVARG_FW_VARIANT "=" SFC_KVARG_VALUES_FW_VARIANT " "
 	SFC_KVARG_RXD_WAIT_TIMEOUT_NS "=<long> "
 	SFC_KVARG_STATS_UPDATE_PERIOD_MS "=<long>");
-
-RTE_INIT(sfc_driver_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level(SFC_LOGTYPE_PREFIX "driver",
-						   RTE_LOG_NOTICE);
-	sfc_logtype_driver = (ret < 0) ? RTE_LOGTYPE_EAL : ret;
-}
+RTE_LOG_REGISTER_SUFFIX(sfc_logtype_driver, "driver", NOTICE);
diff --git a/drivers/net/sfc/sfc_log.h b/drivers/net/sfc/sfc_log.h
index d54277cb7a..10a9ce6ced 100644
--- a/drivers/net/sfc/sfc_log.h
+++ b/drivers/net/sfc/sfc_log.h
@@ -11,7 +11,7 @@
 #define _SFC_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_logtype_driver;
+extern int sfc_logtype_driver;
 
 /** Common log type name prefix */
 #define SFC_LOGTYPE_PREFIX	"pmd.net.sfc."
-- 
2.45.2


  parent reply	other threads:[~2024-06-25 12:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 12:24 [PATCH 0/6] Some drivers logging cleanups David Marchand
2024-06-25 12:24 ` [PATCH 1/6] vdpa/sfc: remove dead code David Marchand
2024-06-25 14:25   ` Andrew Rybchenko
2024-06-25 12:24 ` [PATCH 2/6] drivers: use dedicated log macros instead of EAL logtype David Marchand
2024-06-25 12:24 ` David Marchand [this message]
2024-06-25 14:26   ` [PATCH 3/6] net/sfc: remove use " Andrew Rybchenko
2024-06-25 12:24 ` [PATCH 4/6] vdpa/sfc: " David Marchand
2024-06-25 12:24 ` [PATCH 5/6] bus/pci: use a dynamic logtype David Marchand
2024-06-26  2:05   ` Chenbo Xia
2024-06-25 12:24 ` [PATCH 6/6] crypto/ccp: " David Marchand
2024-06-28 11:57   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240625122414.1065829-4-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).