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 7587F4592F; Sat, 7 Sep 2024 16:55:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D32C40656; Sat, 7 Sep 2024 16:55:09 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 409014064C for ; Sat, 7 Sep 2024 16:55:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725720907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KTbM4Y0rAAXo+t7V/5PXnJPAAk8yBHkalZRayDnFV8o=; b=PhfwLpNUvApHzx5UjvRRf9/aFwHyDKx3It0E9Ilq903f49v+KkJSfA8CB48lsiO3xZGSRv dSdKMolbuf4NlVgyqkUM/QsACj9/HzGHFiaH6T4sRIAtxwO42gjtpHxtOI3kjW78x0Bg4H dT/wHW1ejJ7aYGqdzWYEwyvHaXFpQVE= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-580-pbUYBLWNO5u-6p5k2HsWnQ-1; Sat, 07 Sep 2024 10:55:06 -0400 X-MC-Unique: pbUYBLWNO5u-6p5k2HsWnQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9AEA11956096; Sat, 7 Sep 2024 14:55:05 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.226.65]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 353E83000236; Sat, 7 Sep 2024 14:55:03 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Jingjing Wu Subject: [PATCH 06/11] drivers: move log wrappers to Intel base drivers Date: Sat, 7 Sep 2024 16:54:26 +0200 Message-ID: <20240907145433.1479091-7-david.marchand@redhat.com> In-Reply-To: <20240907145433.1479091-1-david.marchand@redhat.com> References: <20240907145433.1479091-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Remove _RAW macros and directly call RTE_LOG() where needed in headers providing wrappers for base drivers code. This will help later when adding a check on RTE_LOG() use in drivers/. Signed-off-by: David Marchand --- drivers/common/iavf/iavf_osdep.h | 8 ++++---- drivers/common/idpf/base/idpf_osdep.h | 10 +++++----- drivers/net/e1000/base/e1000_osdep.h | 2 +- drivers/net/e1000/e1000_logs.h | 8 ++------ drivers/net/fm10k/base/fm10k_osdep.h | 2 +- drivers/net/fm10k/fm10k_logs.h | 7 ++----- drivers/net/i40e/base/i40e_osdep.h | 6 +++--- drivers/net/i40e/i40e_logs.h | 7 ++----- drivers/net/ice/base/ice_osdep.h | 2 +- drivers/net/ice/ice_logs.h | 7 ++----- drivers/net/igc/base/igc_osdep.h | 2 +- drivers/net/igc/igc_logs.h | 6 +----- drivers/net/ixgbe/base/ixgbe_osdep.h | 2 +- drivers/net/ixgbe/ixgbe_logs.h | 7 ++----- 14 files changed, 28 insertions(+), 48 deletions(-) diff --git a/drivers/common/iavf/iavf_osdep.h b/drivers/common/iavf/iavf_osdep.h index 263d92400c..1f2b7889cb 100644 --- a/drivers/common/iavf/iavf_osdep.h +++ b/drivers/common/iavf/iavf_osdep.h @@ -143,16 +143,16 @@ writeq(uint64_t value, volatile void *addr) #define IAVF_WRITE_FLUSH(a) IAVF_READ_REG(a, IAVF_VFGEN_RSTAT) extern int iavf_common_logger; +#define RTE_LOGTYPE_IAVF_COMMON iavf_common_logger -#define DEBUGOUT(S) rte_log(RTE_LOG_DEBUG, iavf_common_logger, S) -#define DEBUGOUT2(S, A...) rte_log(RTE_LOG_DEBUG, iavf_common_logger, S, ##A) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, IAVF_COMMON, S, ## __VA_ARGS__) +#define DEBUGOUT2(S, ...) DEBUGOUT(S, ## __VA_ARGS__) #define DEBUGFUNC(F) DEBUGOUT(F "\n") #define iavf_debug(h, m, s, ...) \ do { \ if (((m) & (h)->debug_mask)) \ - rte_log(RTE_LOG_DEBUG, iavf_common_logger, \ - "iavf %02x.%x " s, \ + DEBUGOUT("iavf %02x.%x " s, \ (h)->bus.device, (h)->bus.func, \ ##__VA_ARGS__); \ } while (0) diff --git a/drivers/common/idpf/base/idpf_osdep.h b/drivers/common/idpf/base/idpf_osdep.h index b2af8f443d..e042ef871c 100644 --- a/drivers/common/idpf/base/idpf_osdep.h +++ b/drivers/common/idpf/base/idpf_osdep.h @@ -25,6 +25,8 @@ #include #include +#include "../idpf_common_logs.h" + #define INLINE inline #define STATIC static @@ -108,16 +110,14 @@ typedef struct idpf_lock idpf_lock; #define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->(f))) #define MAKEMASK(m, s) ((m) << (s)) -extern int idpf_common_logger; - -#define DEBUGOUT(S) rte_log(RTE_LOG_DEBUG, idpf_common_logger, S) -#define DEBUGOUT2(S, A...) rte_log(RTE_LOG_DEBUG, idpf_common_logger, S, ##A) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, IDPF_COMMON, S, ## __VA_ARGS__) +#define DEBUGOUT2(S, ...) DEBUGOUT(S, ## __VA_ARGS__) #define DEBUGFUNC(F) DEBUGOUT(F "\n") #define idpf_debug(h, m, s, ...) \ do { \ if (((m) & (h)->debug_mask)) \ - PMD_DRV_LOG_RAW(DEBUG, "idpf %02x.%x " s, \ + DEBUGOUT("idpf %02x.%x " s "\n", \ (h)->bus.device, (h)->bus.func, \ ##__VA_ARGS__); \ } while (0) diff --git a/drivers/net/e1000/base/e1000_osdep.h b/drivers/net/e1000/base/e1000_osdep.h index cd90228cef..6b5d58950f 100644 --- a/drivers/net/e1000/base/e1000_osdep.h +++ b/drivers/net/e1000/base/e1000_osdep.h @@ -27,7 +27,7 @@ #define msec_delay_irq(x) DELAY(1000*(x)) #define DEBUGFUNC(F) DEBUGOUT(F "\n"); -#define DEBUGOUT(S, args...) PMD_DRV_LOG_RAW(DEBUG, S, ##args) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, E1000_DRIVER, "%s(): " S, __func__, ## __VA_ARGS__) #define DEBUGOUT1(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT2(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT3(S, args...) DEBUGOUT(S, ##args) diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h index 86f546b0f9..30b5531069 100644 --- a/drivers/net/e1000/e1000_logs.h +++ b/drivers/net/e1000/e1000_logs.h @@ -34,13 +34,9 @@ extern int e1000_logtype_tx; #endif extern int e1000_logtype_driver; -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, e1000_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - +#define RTE_LOGTYPE_E1000_DRIVER e1000_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) - + RTE_LOG(level, E1000_DRIVER, "%s(): " fmt "\n", __func__, ## args) /* log init function shared by e1000 and igb drivers */ void e1000_igb_init_log(void); diff --git a/drivers/net/fm10k/base/fm10k_osdep.h b/drivers/net/fm10k/base/fm10k_osdep.h index 25f46c3908..d3e5528575 100644 --- a/drivers/net/fm10k/base/fm10k_osdep.h +++ b/drivers/net/fm10k/base/fm10k_osdep.h @@ -24,7 +24,7 @@ #define STATIC static #define DEBUGFUNC(F) DEBUGOUT(F "\n"); -#define DEBUGOUT(S, args...) PMD_DRV_LOG_RAW(DEBUG, S, ##args) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, FM10K_DRIVER, "%s(): " S, __func__, ## __VA_ARGS__) #define DEBUGOUT1(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT2(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT3(S, args...) DEBUGOUT(S, ##args) diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h index 4f039f8beb..c4c7c977d9 100644 --- a/drivers/net/fm10k/fm10k_logs.h +++ b/drivers/net/fm10k/fm10k_logs.h @@ -33,11 +33,8 @@ extern int fm10k_logtype_tx; #endif extern int fm10k_logtype_driver; -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, fm10k_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - +#define RTE_LOGTYPE_FM10K_DRIVER fm10k_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + RTE_LOG(level, FM10K_DRIVER, "%s(): " fmt "\n", __func__, ## args) #endif /* _FM10K_LOGS_H_ */ diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index aa5dc61841..8960206d8b 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -82,8 +82,8 @@ typedef enum i40e_status_code i40e_status; #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) -#define DEBUGOUT(S) PMD_DRV_LOG_RAW(DEBUG, S) -#define DEBUGOUT1(S, A...) PMD_DRV_LOG_RAW(DEBUG, S, ##A) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, I40E_DRIVER, "%s(): " S, __func__, ## __VA_ARGS__) +#define DEBUGOUT1 DEBUGOUT #define DEBUGFUNC(F) DEBUGOUT(F "\n") #define DEBUGOUT2 DEBUGOUT1 @@ -94,7 +94,7 @@ typedef enum i40e_status_code i40e_status; #define i40e_debug(h, m, s, ...) \ do { \ if (((m) & (h)->debug_mask)) \ - PMD_DRV_LOG_RAW(DEBUG, "i40e %02x.%x " s, \ + DEBUGOUT("i40e %02x.%x " s, \ (h)->bus.device, (h)->bus.func, \ ##__VA_ARGS__); \ } while (0) diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h index eebe6c5559..fb1f3a4096 100644 --- a/drivers/net/i40e/i40e_logs.h +++ b/drivers/net/i40e/i40e_logs.h @@ -30,11 +30,8 @@ extern int i40e_logtype_tx; #endif extern int i40e_logtype_driver; -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - +#define RTE_LOGTYPE_I40E_DRIVER i40e_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + RTE_LOG(level, I40E_DRIVER, "%s(): " fmt "\n", __func__, ## args) #endif /* _I40E_LOGS_H_ */ diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h index c17f1bf09f..5f7347023f 100644 --- a/drivers/net/ice/base/ice_osdep.h +++ b/drivers/net/ice/base/ice_osdep.h @@ -149,7 +149,7 @@ writeq(uint64_t value, volatile void *addr) #define ice_debug(h, m, s, ...) \ do { \ if (((m) & (h)->debug_mask)) \ - PMD_DRV_LOG_RAW(DEBUG, "ice %02x.%x " s, \ + RTE_LOG(DEBUG, ICE_DRIVER, "ice %02x.%x " s, \ (h)->bus.device, (h)->bus.func, \ ##__VA_ARGS__); \ } while (0) diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h index e79980fb63..a54e9d8b59 100644 --- a/drivers/net/ice/ice_logs.h +++ b/drivers/net/ice/ice_logs.h @@ -7,6 +7,7 @@ extern int ice_logtype_init; extern int ice_logtype_driver; +#define RTE_LOGTYPE_ICE_DRIVER ice_logtype_driver #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ice_logtype_init, "%s(): " fmt "\n", \ @@ -32,11 +33,7 @@ extern int ice_logtype_tx; #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, ice_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + RTE_LOG(level, ICE_DRIVER, "%s(): " fmt "\n", __func__, ## args) #endif /* _ICE_LOGS_H_ */ diff --git a/drivers/net/igc/base/igc_osdep.h b/drivers/net/igc/base/igc_osdep.h index 25090d65ea..4e479eb500 100644 --- a/drivers/net/igc/base/igc_osdep.h +++ b/drivers/net/igc/base/igc_osdep.h @@ -27,7 +27,7 @@ #define msec_delay_irq(x) DELAY(1000 * (x)) #define DEBUGFUNC(F) DEBUGOUT(F "\n") -#define DEBUGOUT(S, args...) PMD_DRV_LOG_RAW(DEBUG, S, ##args) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, IGC_DRIVER, "%s(): " S, __func__, ## __VA_ARGS__) #define DEBUGOUT1(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT2(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT3(S, args...) DEBUGOUT(S, ##args) diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h index cca5389eff..4a574f10cb 100644 --- a/drivers/net/igc/igc_logs.h +++ b/drivers/net/igc/igc_logs.h @@ -35,12 +35,8 @@ extern int igc_logtype_driver; #define PMD_TX_LOG(level, fmt, args...) do { } while (0) #endif -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, igc_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args) #ifdef __cplusplus } diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h index e832a7bec8..502f386b56 100644 --- a/drivers/net/ixgbe/base/ixgbe_osdep.h +++ b/drivers/net/ixgbe/base/ixgbe_osdep.h @@ -33,7 +33,7 @@ #define msec_delay(x) DELAY(1000*(x)) #define DEBUGFUNC(F) DEBUGOUT(F "\n"); -#define DEBUGOUT(S, args...) PMD_DRV_LOG_RAW(DEBUG, S, ##args) +#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, IXGBE_DRIVER, "%s(): " S, __func__, ## __VA_ARGS__) #define DEBUGOUT1(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT2(S, args...) DEBUGOUT(S, ##args) #define DEBUGOUT3(S, args...) DEBUGOUT(S, ##args) diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h index 00ef797ca1..5a2c5ccde0 100644 --- a/drivers/net/ixgbe/ixgbe_logs.h +++ b/drivers/net/ixgbe/ixgbe_logs.h @@ -31,11 +31,8 @@ extern int ixgbe_logtype_tx; #endif extern int ixgbe_logtype_driver; -#define PMD_DRV_LOG_RAW(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \ - __func__, ## args) - +#define RTE_LOGTYPE_IXGBE_DRIVER ixgbe_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + RTE_LOG(level, IXGBE_DRIVER, "%s(): " fmt "\n", __func__, ## args) #endif /* _IXGBE_LOGS_H_ */ -- 2.46.0