Replace uses of RTE_LOGTYPE_PMD
Subsystems (6)
cover Replace uses of RTE_LOGTYPE_PMD
The generic RTE_LOGTYPE_PMD is a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for the RTE_LOG_DP().
Most of this patchset is boiler plate but there were some places where use of PMD type snuck in with changes to original driver and get fixed here.
Stephen Hemminger (26):
log: fix doc comment for RTE_LOG_DP()
log: add rte_log_dp()
net/atlantic: replace RTE_LOG_DP with rte_log_dp net/avp: replace RTE_LOG_DP with rte_log_dp net/bnxt: replace RTE_LOG_DP with rte_log_dp net/dpaa: replace RTE_LOG_DP with rte_log_dp net/dpaa2: replace RTE_LOG_DP with rte_log_dp net/enetc: replace RTE_LOG_DP with rte_log_dp net/enetfec: replace RTE_LOG_DP with rte_log_dp net/igc: replace RTE_LOG_DP with rte_log_dp net/mana: replace RTE_LOG_DP with rte_log_dp net/mvpp2: do not use PMD logtype net/octeon_ep: replace RTE_LOG_DP with rte_log_dp net/pfe: replace RTE_LOG_DP with rte_log_dp net/qede: replace RTE_LOG_DP with rte_log_dp net/virtio: replace RTE_LOG_DP with rte_log_dp net/vmxnet3: do not use PMD logtype common/cnxk: replace RTE_LOG_DP with rte_log_dp common/cpt: replace RTE_LOG_DP with rte_log_dp common/sfc_efx: remove use of PMD logtype common/dpaax: do not use PMD logtype basband/la12xx: replace RTE_LOG_DP with rte_log_dp bus/cdx: replace RTE_LOG_DP with rte_log_dp bus/fslmc: replace RTE_LOG_DP with rte_log_dp dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp mempool/dpaa, mempool/dpaa2: do not use logtype PMD
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- drivers/bus/cdx/cdx_logs.h | 2 +- drivers/bus/fslmc/fslmc_logs.h | 2 +- drivers/common/cnxk/roc_platform.h | 28 ++++++++++--------- drivers/common/cpt/cpt_pmd_logs.h | 2 +- drivers/common/dpaax/caamflib/compat.h | 5 +++- drivers/common/dpaax/version.map | 1 + drivers/common/sfc_efx/sfc_efx.c | 11 ++------ drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 ++-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 +- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- drivers/net/atlantic/atl_logs.h | 15 +++++----- drivers/net/avp/avp_logs.h | 20 +++++++------ drivers/net/bnxt/bnxt.h | 5 ++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +- drivers/net/bnxt/bnxt_txr.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +-- drivers/net/enetc/enetc_logs.h | 2 +- drivers/net/enetfec/enet_pmd_logs.h | 2 +- drivers/net/igc/igc_logs.h | 10 ++++--- drivers/net/mana/mana.h | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +-- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++-- drivers/net/octeontx/octeontx_logs.h | 3 +- drivers/net/pfe/pfe_logs.h | 2 +- drivers/net/qede/qede_logs.h | 10 ++++--- drivers/net/virtio/virtio_logs.h | 16 ++++++----- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 +++++--- lib/log/rte_log.h | 26 +++++++++++++++-- 39 files changed, 139 insertions(+), 99 deletions(-)
Signature · 1 line
2.42.0
PATCH 1/26 log: fix doc comment for RTE_LOG_DP()
The macro does not return a numeric status, only void.
--- lib/log/rte_log.h | 3 --- 1 file changed, 3 deletions(-)
lib/log/rte_log.h +0 -3
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)* @param ... * The fmt string, as in printf(3), followed by the variable arguments * required by the format. -* @return -* - 0: Success. -* - Negative on error. */ #define RTE_LOG_DP (l, t, ...) \ (void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ? \
Signature · 1 line
2.42.0
PATCH 2/26 log: add rte_log_dp()
In reply to Stephen HemmingerAdd a new macro for logging in datapath using a logtype. The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD) like RTE_LOG(). This macro allows using a dynamic type.
Ideally, rte_log_dp() could be an always_inline function but GCC and Clang will not inline a function with variable number of arguments. Therefore it has to be a macro.
--- lib/log/rte_log.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
lib/log/rte_log.h +23 -0
@@ -355,6 +355,29 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \ 0) +/** +* Generates a log message for data path. +* +* Similar to rte_log(), except that it gets optimized away +* if the RTE_LOG_DP_LEVEL configuration option is lower than the log +* level argument. +* +* @param level +* Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8). +* @param logtype +* The log type, for example, RTE_LOGTYPE_EAL. +* @param format +* The format string, as in printf(3), followed by the variable arguments +* required by the format. +* @param ap +* The va_list of the variable arguments required by the format. +*/ +#define rte_log_dp (lev, t, ...) \ + do { \ + if (lev <= RTE_LOG_DP_LEVEL) \ + rte_log(lev, t, __VA_ARGS__); \ + } while(0) +#define RTE_LOG_REGISTER_IMPL (type, name, level) \ int type; \ RTE_INIT(__##type) \
Signature · 1 line
2.42.0
PATCH 3/26 net/atlantic: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/atlantic/atl_logs.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/atlantic/atl_logs.h +8 -7
@@ -14,18 +14,19 @@ extern int atl_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) - -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) -extern int atl_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \ __func__, ## args) #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \ + ## args) + +#define PMD_RX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args) + +#define PMD_TX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args)#endif
Signature · 1 line
2.42.0
PATCH 4/26 net/avp: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/avp/avp_logs.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/avp/avp_logs.h +11 -9
@@ -7,24 +7,26 @@#include <rte_log.h> + +extern int avp_logtype_driver; + +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s(): " fmt, __func__, ## args) +#ifdef RTE_LIBRTE_AVP_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() rx: " fmt, __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_AVP_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() tx: " fmt, __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif - -extern int avp_logtype_driver; - -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ - "%s(): " fmt, __func__, ## args) -#endif /* _AVP_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH 5/26 net/bnxt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +-- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +-- drivers/net/bnxt/bnxt_txr.c | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/bnxt/bnxt.h +5 -0
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt, ## args) +#define PMD_DRV_LOG_DP(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver, \ + fmt, ## args) + +extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;int32_t bnxt_ulp_port_init (struct bnxt *bp);void bnxt_ulp_port_deinit (struct bnxt *bp);
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +1 -2
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1 -2
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_txr.c +1 -3
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)if (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 ) nb_tx_pkts += opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , -CMP_TYPE (txcmp)); +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
Signature · 1 line
2.42.0
Re: [PATCH 05/26] net/bnxt: replace RTE_LOG_DP with rte_log_dp
Quoted 71 lines · Stephen Hemminger
Want datapath logs to use own logtype.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +-- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +-- drivers/net/bnxt/bnxt_txr.c | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-)drivers/net/bnxt/bnxt.h +5
-0@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt, ## args) +#define PMD_DRV_LOG_DP(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver, \ + fmt, ## args) + +extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;int32_t bnxt_ulp_port_init (struct bnxt *bp);void bnxt_ulp_port_deinit (struct bnxt *bp);drivers/net/bnxt/bnxt_rxtx_vec_neon.c +1
-2@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1
-2@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);drivers/net/bnxt/bnxt_txr.c +1
-4@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)if (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 ) nb_tx_pkts += opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , -CMP_TYPE (txcmp)); +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask); --
Quoted 2 lines
2.42.0
PATCH 6/26 net/dpaa: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa/dpaa_ethdev.c | 4 ++-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +2 -2
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* copy the primary mac address */ rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); -RTE_LOG (INFO ,PMD ,"net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n" , +DPAA_PMD_INFO ("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT , dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr));if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, ret =dpaa_dev_init_secondary (eth_dev);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"secondary dev init failed\n" ); +DPAA_PMD_ERR ("secondary dev init failed" );return ret; }
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)#endif
Signature · 1 line
2.42.0
PATCH 7/26 net/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)return ret; } } -RTE_LOG (INFO ,PMD ,"%s: netdev created, connected to %s\n" , +DPAA2_PMD_INFO ("%s: netdev created, connected to %s\n" , eth_dev->data->name, dpaa2_dev->ep_name);return 0 ;
drivers/net/dpaa2/dpaa2_pmd_logs.h +1 -1
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args) #define DPAA2_PMD_DP_DEBUG(fmt, args...) \ DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/dpaa2/dpaa2_sparser.c +2 -2
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv, priv->ss_iova = (uint64_t )(DPAA2_VADDR_TO_IOVA (addr)); priv->ss_offset += sp_param.size; -RTE_LOG (INFO ,PMD ,"Soft parser loaded for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser loaded for dpni@%d\n" , priv->hw_id);rte_free (addr);return 0 ;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv, }rte_free (param_addr); -RTE_LOG (INFO ,PMD ,"Soft parser enabled for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser enabled for dpni@%d\n" , priv->hw_id);return 0 ; }
Signature · 1 line
2.42.0
PATCH 8/26 net/enetc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/enetc/enetc_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/enetc/enetc_logs.h +1 -1
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETC_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args) #define ENETC_PMD_DP_DEBUG(fmt, args...) \ ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH 9/26 net/enetfec: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/enetfec/enet_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/enetfec/enet_pmd_logs.h +1 -1
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETFEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)#endif /* _ENETFEC_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH 10/26 net/igc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/igc/igc_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/igc/igc_logs.h +6 -4
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>")#ifdef RTE_ETHDEV_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_ETHDEV_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif
Signature · 1 line
2.42.0
RE: [PATCH 10/26] net/igc: replace RTE_LOG_DP with rte_log_dp
Quoted 10 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, December 13, 2023 09:42
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Guo, Junfeng <[email protected]>; Su, Simei <[email protected]>
Subject: [PATCH 10/26] net/igc: replaceRTE_LOG_DPwithrte_log_dp
Quoted 3 lines
Want datapath logs to use own logtype.
Signed-off-by Stephen Hemminger <[email protected]>
Looks good to me, thanks for improving the code!
Maybe better also cc to the stable?
Regards,
Junfeng Guo
Quoted 6 lines
--- drivers/net/igc/igc_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)--
2.42.0
PATCH 11/26 net/mana: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/mana/mana.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mana/mana.h +1 -1
@@ -467,7 +467,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
Signature · 1 line
2.42.0
PATCH 12/26 net/mvpp2: do not use PMD logtype
In reply to Stephen HemmingerThe driver already has a logtype but it was not being used in one place.
--- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +2 -2
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)/* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (priv->multiseg) { -RTE_LOG (INFO ,PMD ,"Using multi-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using multi-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst; }else { -RTE_LOG (INFO ,PMD ,"Using single-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using single-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_pkt_burst; } }
Signature · 1 line
2.42.0
PATCH 13/26 net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/octeon_ep/otx_ep_common.h +7 -0
@@ -81,6 +81,13 @@ "%s():%u " fmt "\n", \ __func__, __LINE__, ##args) +#define otx_ep_log_dp(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype, \ + "%s():%u " fmt "\n", \ + __func__, __LINE__, ##args) + + +/* IO Access */ #define oct_ep_read64 (addr) rte_read64_relaxed((void *)(addr))#define oct_ep_write64 (val, addr) rte_write64_relaxed((val), (void *)(addr))
drivers/net/octeon_ep/otx_ep_rxtx.c +2 -3
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) next_fetch = (pkts == new_pkts -1 ) ?0 :1 ; oq_pkt =otx_ep_droq_read_packet (otx_ep, droq, next_fetch);if (!oq_pkt) { -RTE_LOG_DP (ERR ,PMD , -"DROQ read pkt failed pending %" PRIu64 -"last_pkt_count %" PRIu64"new_pkts %d.\n" , +otx_ep_log_dp (ERR ,"DROQ read pkt failed pending %" PRIu64 +"last_pkt_count %" PRIu64"new_pkts %d." , droq->pkts_pending, droq->last_pkt_count, new_pkts); droq->stats.rx_err++;
Signature · 1 line
2.42.0
PATCH 14/26 net/pfe: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeontx/octeontx_logs.h | 3 +-- drivers/net/pfe/pfe_logs.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/octeontx/octeontx_logs.h +1 -2
@@ -19,11 +19,10 @@ rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \ "%s(): " fmt "\n", __func__, ## args) -#define octeontx_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, fmt "\n", ## args)#define octeontx_log_err (s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)#define octeontx_log_dbg (s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__) +#define octeontx_log_info (s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)#define octeontx_mbox_log (s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)#define PMD_RX_LOG PMD_DRV_LOG
drivers/net/pfe/pfe_logs.h +1 -1
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define PFE_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)#endif /* _PFE_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH 15/26 net/qede: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/qede/qede_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/qede/qede_logs.h +6 -4
@@ -58,16 +58,18 @@ extern int qede_logtype_init;#define PMD_INIT_FUNC_TRACE (edev) PMD_INIT_LOG(DEBUG, edev, " >>")#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -#define PMD_TX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_TX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qded_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_QEDE_DEBUG_RX -#define PMD_RX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_RX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qded_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
Signature · 1 line
2.42.0
PATCH 16/26 net/virtio: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/virtio/virtio_logs.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/virtio/virtio_logs.h +9 -7
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int virtio_logtype_driver; +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args) +#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() rx: " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() tx: " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif -extern int virtio_logtype_driver; -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ - "%s(): " fmt "\n", __func__, ## args) -#endif /* _VIRTIO_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH 17/26 net/vmxnet3: do not use PMD logtype
In reply to Stephen HemmingerThe driver used a slightly different (and older) format for datapath logs. Remove PMD logtype here.
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)if (events ==0 ) goto done; -RTE_LOG (DEBUG ,PMD ,"Reading events: 0x%X" , events); +PMD_DRV_LOG (DEBUG ,"Reading events: 0x%X" , events);vmxnet3_process_events (dev); done:vmxnet3_enable_intr (hw, *eventIntrIdx);
drivers/net/vmxnet3/vmxnet3_logs.h +8 -4
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init; "%s(): " fmt "\n", __func__, ## args)#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int vmxnet3_logtype_driver; +#ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE #define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)#endif -extern int vmxnet3_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ "%s(): " fmt "\n", __func__, ## args)
Signature · 1 line
2.42.0
PATCH 18/26 common/cnxk: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/common/cnxk/roc_platform.h +15 -13
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;extern int cnxk_logtype_ree;extern int cnxk_logtype_dpi; -#define plt_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) -#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args) -#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) +#define plt_log(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_err (fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__) +#define plt_info (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__) +#define plt_warn (fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__) +#define plt_print (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)#define plt_dump (fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)#define plt_dump_no_nl (fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;*/ #define plt_dbg(subsystem, fmt, args...) \ rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem, \ - "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, \ -##args) + "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)#define plt_base_dbg (fmt, ...) plt_dbg(base, fmt, ##__VA_ARGS__)#define plt_cpt_dbg (fmt, ...) plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;#define plt_dpi_dbg (fmt, ...) plt_dbg(dpi, fmt, ##__VA_ARGS__)/* Datapath logs */ -#define plt_dp_err(fmt, args...) \ - RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_info(fmt, args...) \ - RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_dbg(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_dp_log(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ## args) + +#define plt_dp_err (fmt, ...) plt_dp_log(ERR, fmt, ##__VA_ARGS__) +#define plt_dp_info (fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__) +#define plt_dp_dbg (fmt, ...) plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)#ifdef __cplusplus#define CNXK_PCI_ID (subsystem_dev, dev) \
Signature · 1 line
2.42.0
PATCH 19/26 common/cpt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cpt/cpt_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cpt/cpt_pmd_logs.h +1 -1
@@ -34,7 +34,7 @@* level of 'pmd' has to be used. */ #define CPT_LOG_DP(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args) #define CPT_LOG_DP_DEBUG(fmt, args...) \ CPT_LOG_DP(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH 20/26 common/sfc_efx: remove use of PMD logtype
In reply to Stephen HemmingerThis code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers.
--- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/common/sfc_efx/sfc_efx.c +2 -9
@@ -15,7 +15,7 @@#include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,return rc; } -RTE_INIT (sfc_efx_register_logtype) -{ -int ret; - - ret =rte_log_register_type_and_pick_level ("pmd.common.sfc_efx" , -RTE_LOG_NOTICE ); - sfc_efx_logtype = (ret <0 ) ?RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT (sfc_efx_logtype,NOTICE );
drivers/common/sfc_efx/sfc_efx_log.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_EFX_LOG_H_/** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype;/** Log message, add a prefix and a line break */ #define SFC_EFX_LOG (level, ...) \
Signature · 1 line
2.42.0
PATCH 21/26 common/dpaax: do not use PMD logtype
In reply to Stephen HemmingerUse existing dpaax_logger log type instead of PMD.
--- drivers/common/dpaax/caamflib/compat.h | 5 ++++- drivers/common/dpaax/version.map | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/common/dpaax/caamflib/compat.h +4 -1
@@ -40,11 +40,14 @@#define __maybe_unused __rte_unused#endif +extern int dpaax_logger; +#if defined(SUPPRESS_PRINTS )#define pr_msg (l, fmt, ...) do { } while (0)#else #define pr_msg (l, fmt, ...) \ - RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) + rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \ + __func__, ##__VA_ARGS__)#endif #if !defined(pr_debug)
drivers/common/dpaax/version.map +1 -0
@@ -6,6 +6,7 @@ INTERNAL { dpaax_iova_table_p; dpaax_iova_table_populate; dpaax_iova_table_update; + dpaax_logger; of_device_is_available; of_device_is_compatible; of_find_compatible_node;
Signature · 1 line
2.42.0
PATCH 22/26 basband/la12xx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h +1 -1
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define rte_bbdev_dp_log(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH 23/26 bus/cdx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/cdx/cdx_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/cdx/cdx_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define CDX_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args) #define CDX_BUS_DP_DEBUG(fmt, args...) \ CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH 24/26 bus/fslmc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/fslmc/fslmc_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/fslmc/fslmc_logs.h +1 -1
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args) #define DPAA2_BUS_DP_DEBUG(fmt, args...) \ DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH 25/26 dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 +++-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/dma/dpaa/dpaa_qdma_logs.h +3 -2
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype; DPAA_QDMA_LOG(WARNING, fmt, ## args) /* DP Logs, toggled out at compile time if level lower than current level */ -#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) +#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype, \ + "dpaa_qdma: " fmt "\n", ## args) #define DPAA_QDMA_DP_DEBUG(fmt, args...) \ DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
drivers/dma/dpaa2/dpaa2_qdma_logs.h +2 -1
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \ + "dpaa2_qdma: " fmt "\n", ## args) #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \ DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH 26/26 mempool/dpaa, mempool/dpaa2: do not use logtype PMD
In reply to Stephen HemmingerThe driver already has a logtype, just not consistently used.
--- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/mempool/dpaa/dpaa_mempool.h +1 -1
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;#define MEMPOOL_INIT_FUNC_TRACE () DPAA_MEMPOOL_LOG(DEBUG, " >>") #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args) #define DPAA_MEMPOOL_DEBUG(fmt, args...) \ DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args) #define DPAA_MEMPOOL_ERR(fmt, args...) \
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured\n" );return -ENOMEM ; }
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured" );return NULL ; }
drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args) #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \ DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
v2 cover Replace use of RTE_LOGTYPE_PMD
In reply to Stephen HemmingerThe generic RTE_LOGTYPE_PMD is a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for the RTE_LOG_DP().
Most of this patchset is boiler plate but there were some places where use of PMD type snuck in with changes to original driver and get fixed here.
More work is needed before PMD logtype can be retired.
v2 - fix some typos from v1 from CI
Stephen Hemminger (25):
log: fix doc comment for RTE_LOG_DP()
log: add rte_log_dp()
net/atlantic: replace RTE_LOG_DP with rte_log_dp net/avp: replace RTE_LOG_DP with rte_log_dp net/bnxt: replace RTE_LOG_DP with rte_log_dp net/dpaa: replace RTE_LOG_DP with rte_log_dp net/dpaa2: replace RTE_LOG_DP with rte_log_dp net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp net/igc: replace RTE_LOG_DP with rte_log_dp net/mana: replace RTE_LOG_DP with rte_log_dp net/mvpp2: do not use PMD logtype
net/octeon_ep: replace RTE_LOG_DP with rte_log_dp net/pfe: replace RTE_LOG_DP with rte_log_dp net/qede: replace RTE_LOG_DP with rte_log_dp net/virtio: replace RTE_LOG_DP with rte_log_dp net/vmxnet3: do not use PMD logtype
common/cnxk: replace RTE_LOG_DP with rte_log_dp common/cpt: replace RTE_LOG_DP with rte_log_dp common/sfc_efx: remove use of PMD logtype common/dpaax: do not use PMD logtype basband/la12xx: replace RTE_LOG_DP with rte_log_dp bus/cdx: replace RTE_LOG_DP with rte_log_dp bus/fslmc: replace RTE_LOG_DP with rte_log_dp dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp mempool/dpaa, mempool/dpaa2: do not use logtype PMD
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- drivers/bus/cdx/cdx_logs.h | 2 +- drivers/bus/fslmc/fslmc_logs.h | 2 +- drivers/common/cnxk/roc_platform.h | 28 ++++++++++--------- drivers/common/cpt/cpt_pmd_logs.h | 2 +- drivers/common/dpaax/caamflib/compat.h | 5 +++- drivers/common/dpaax/dpaax_logs.h | 2 +- drivers/common/dpaax/version.map | 1 + drivers/common/sfc_efx/sfc_efx.c | 11 ++------ drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 ++-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 +- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- drivers/net/atlantic/atl_logs.h | 15 +++++----- drivers/net/avp/avp_logs.h | 20 +++++++------ drivers/net/bnxt/bnxt.h | 5 ++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +- drivers/net/bnxt/bnxt_txr.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +-- drivers/net/enetc/enetc_logs.h | 2 +- drivers/net/enetfec/enet_pmd_logs.h | 2 +- drivers/net/igc/igc_logs.h | 10 ++++--- drivers/net/mana/mana.h | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +-- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++-- drivers/net/octeontx/octeontx_logs.h | 3 +- drivers/net/pfe/pfe_logs.h | 2 +- drivers/net/qede/qede_logs.h | 10 ++++--- drivers/net/virtio/virtio_logs.h | 16 ++++++----- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 +++++--- lib/log/rte_log.h | 26 +++++++++++++++-- 40 files changed, 140 insertions(+), 100 deletions(-)
Signature · 1 line
2.42.0
PATCH v2 1/25 log: fix doc comment for RTE_LOG_DP()
The macro does not return a numeric status, only void.
--- lib/log/rte_log.h | 3 --- 1 file changed, 3 deletions(-)
lib/log/rte_log.h +0 -3
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)* @param ... * The fmt string, as in printf(3), followed by the variable arguments * required by the format. -* @return -* - 0: Success. -* - Negative on error. */ #define RTE_LOG_DP (l, t, ...) \ (void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ? \
Signature · 1 line
2.42.0
PATCH v2 2/25 log: add rte_log_dp()
In reply to Stephen HemmingerAdd a new macro for logging in datapath using a logtype. The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD) like RTE_LOG(). This macro allows using a dynamic type.
Ideally, rte_log_dp() could be an always_inline function but GCC and Clang will not inline a function with variable number of arguments. Therefore it has to be a macro.
--- lib/log/rte_log.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
lib/log/rte_log.h +23 -0
@@ -355,6 +355,29 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \ 0) +/** +* Generates a log message for data path. +* +* Similar to rte_log(), except that it gets optimized away +* if the RTE_LOG_DP_LEVEL configuration option is lower than the log +* level argument. +* +* @param level +* Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8). +* @param logtype +* The log type, for example, RTE_LOGTYPE_EAL. +* @param format +* The format string, as in printf(3), followed by the variable arguments +* required by the format. +* @param ap +* The va_list of the variable arguments required by the format. +*/ +#define rte_log_dp (lev, t, ...) \ + do { \ + if (lev <= RTE_LOG_DP_LEVEL) \ + rte_log(lev, t, __VA_ARGS__); \ + } while(0) +#define RTE_LOG_REGISTER_IMPL (type, name, level) \ int type; \ RTE_INIT(__##type) \
Signature · 1 line
2.42.0
PATCH v2 3/25 net/atlantic: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/atlantic/atl_logs.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/atlantic/atl_logs.h +8 -7
@@ -14,18 +14,19 @@ extern int atl_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) - -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) -extern int atl_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \ __func__, ## args) #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \ + ## args) + +#define PMD_RX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args) + +#define PMD_TX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args)#endif
Signature · 1 line
2.42.0
PATCH v2 4/25 net/avp: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/avp/avp_logs.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/avp/avp_logs.h +11 -9
@@ -7,24 +7,26 @@#include <rte_log.h> + +extern int avp_logtype_driver; + +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s(): " fmt, __func__, ## args) +#ifdef RTE_LIBRTE_AVP_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() rx: " fmt, __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_AVP_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() tx: " fmt, __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif - -extern int avp_logtype_driver; - -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ - "%s(): " fmt, __func__, ## args) -#endif /* _AVP_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH v2 5/25 net/bnxt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +-- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +-- drivers/net/bnxt/bnxt_txr.c | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/bnxt/bnxt.h +5 -0
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt, ## args) +#define PMD_DRV_LOG_DP(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver, \ + fmt, ## args) + +extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;int32_t bnxt_ulp_port_init (struct bnxt *bp);void bnxt_ulp_port_deinit (struct bnxt *bp);
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +1 -2
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1 -2
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_txr.c +1 -3
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)if (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 ) nb_tx_pkts += opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , -CMP_TYPE (txcmp)); +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
Signature · 1 line
2.42.0
PATCH v2 6/25 net/dpaa: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa/dpaa_ethdev.c | 4 ++-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +2 -2
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* copy the primary mac address */ rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); -RTE_LOG (INFO ,PMD ,"net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n" , +DPAA_PMD_INFO ("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT , dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr));if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, ret =dpaa_dev_init_secondary (eth_dev);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"secondary dev init failed\n" ); +DPAA_PMD_ERR ("secondary dev init failed" );return ret; }
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)#endif
Signature · 1 line
2.42.0
PATCH v2 7/25 net/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)return ret; } } -RTE_LOG (INFO ,PMD ,"%s: netdev created, connected to %s\n" , +DPAA2_PMD_INFO ("%s: netdev created, connected to %s\n" , eth_dev->data->name, dpaa2_dev->ep_name);return 0 ;
drivers/net/dpaa2/dpaa2_pmd_logs.h +1 -1
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args) #define DPAA2_PMD_DP_DEBUG(fmt, args...) \ DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/dpaa2/dpaa2_sparser.c +2 -2
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv, priv->ss_iova = (uint64_t )(DPAA2_VADDR_TO_IOVA (addr)); priv->ss_offset += sp_param.size; -RTE_LOG (INFO ,PMD ,"Soft parser loaded for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser loaded for dpni@%d\n" , priv->hw_id);rte_free (addr);return 0 ;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv, }rte_free (param_addr); -RTE_LOG (INFO ,PMD ,"Soft parser enabled for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser enabled for dpni@%d\n" , priv->hw_id);return 0 ; }
Signature · 1 line
2.42.0
PATCH v2 8/25 net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/enetc/enetc_logs.h | 2 +- drivers/net/enetfec/enet_pmd_logs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/enetc/enetc_logs.h +1 -1
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETC_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args) #define ENETC_PMD_DP_DEBUG(fmt, args...) \ ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/enetfec/enet_pmd_logs.h +1 -1
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETFEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)#endif /* _ENETFEC_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH v2 9/25 net/igc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/igc/igc_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/igc/igc_logs.h +6 -4
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>")#ifdef RTE_ETHDEV_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_ETHDEV_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif
Signature · 1 line
2.42.0
PATCH v2 10/25 net/mana: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/mana/mana.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mana/mana.h +1 -1
@@ -467,7 +467,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
Signature · 1 line
2.42.0
RE: [PATCH v2 10/25] net/mana: replace RTE_LOG_DP with rte_log_dp
Quoted 5 lines
Subject: [PATCH v2 10/25] net/mana: replace
RTE_LOG_DPwithrte_log_dpWant datapath logs to use own logtype.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 19 lines
--- drivers/net/mana/mana.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/mana/mana.h index renamed from drivers/net/mana/mana.h +0
-0
6836872dc257..8d60f9172d44100644drivers/net/mana/mana.h +1
-2@@ -467,7 +467,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\ --2.42.0
PATCH v2 11/25 net/mvpp2: do not use PMD logtype
In reply to Stephen HemmingerThe driver already has a logtype but it was not being used in one place.
--- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +2 -2
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)/* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (priv->multiseg) { -RTE_LOG (INFO ,PMD ,"Using multi-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using multi-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst; }else { -RTE_LOG (INFO ,PMD ,"Using single-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using single-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_pkt_burst; } }
Signature · 1 line
2.42.0
PATCH v2 12/25 net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/octeon_ep/otx_ep_common.h +7 -0
@@ -81,6 +81,13 @@ "%s():%u " fmt "\n", \ __func__, __LINE__, ##args) +#define otx_ep_log_dp(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype, \ + "%s():%u " fmt "\n", \ + __func__, __LINE__, ##args) + + +/* IO Access */ #define oct_ep_read64 (addr) rte_read64_relaxed((void *)(addr))#define oct_ep_write64 (val, addr) rte_write64_relaxed((val), (void *)(addr))
drivers/net/octeon_ep/otx_ep_rxtx.c +2 -3
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) next_fetch = (pkts == new_pkts -1 ) ?0 :1 ; oq_pkt =otx_ep_droq_read_packet (otx_ep, droq, next_fetch);if (!oq_pkt) { -RTE_LOG_DP (ERR ,PMD , -"DROQ read pkt failed pending %" PRIu64 -"last_pkt_count %" PRIu64"new_pkts %d.\n" , +otx_ep_log_dp (ERR ,"DROQ read pkt failed pending %" PRIu64 +"last_pkt_count %" PRIu64"new_pkts %d." , droq->pkts_pending, droq->last_pkt_count, new_pkts); droq->stats.rx_err++;
Signature · 1 line
2.42.0
PATCH v2 13/25 net/pfe: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeontx/octeontx_logs.h | 3 +-- drivers/net/pfe/pfe_logs.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/octeontx/octeontx_logs.h +1 -2
@@ -19,11 +19,10 @@ rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \ "%s(): " fmt "\n", __func__, ## args) -#define octeontx_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, fmt "\n", ## args)#define octeontx_log_err (s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)#define octeontx_log_dbg (s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__) +#define octeontx_log_info (s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)#define octeontx_mbox_log (s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)#define PMD_RX_LOG PMD_DRV_LOG
drivers/net/pfe/pfe_logs.h +1 -1
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define PFE_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)#endif /* _PFE_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH v2 14/25 net/qede: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/qede/qede_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/qede/qede_logs.h +6 -4
@@ -58,16 +58,18 @@ extern int qede_logtype_init;#define PMD_INIT_FUNC_TRACE (edev) PMD_INIT_LOG(DEBUG, edev, " >>")#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -#define PMD_TX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_TX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_QEDE_DEBUG_RX -#define PMD_RX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_RX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
Signature · 1 line
2.42.0
PATCH v2 15/25 net/virtio: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/virtio/virtio_logs.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/virtio/virtio_logs.h +9 -7
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int virtio_logtype_driver; +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args) +#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() rx: " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() tx: " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif -extern int virtio_logtype_driver; -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ - "%s(): " fmt "\n", __func__, ## args) -#endif /* _VIRTIO_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH v2 16/25 net/vmxnet3: do not use PMD logtype
In reply to Stephen HemmingerThe driver used a slightly different (and older) format for datapath logs. Remove PMD logtype here.
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)if (events ==0 ) goto done; -RTE_LOG (DEBUG ,PMD ,"Reading events: 0x%X" , events); +PMD_DRV_LOG (DEBUG ,"Reading events: 0x%X" , events);vmxnet3_process_events (dev); done:vmxnet3_enable_intr (hw, *eventIntrIdx);
drivers/net/vmxnet3/vmxnet3_logs.h +8 -4
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init; "%s(): " fmt "\n", __func__, ## args)#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int vmxnet3_logtype_driver; +#ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE #define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)#endif -extern int vmxnet3_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ "%s(): " fmt "\n", __func__, ## args)
Signature · 1 line
2.42.0
PATCH v2 17/25 common/cnxk: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/common/cnxk/roc_platform.h +15 -13
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;extern int cnxk_logtype_ree;extern int cnxk_logtype_dpi; -#define plt_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) -#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args) -#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) +#define plt_log(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_err (fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__) +#define plt_info (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__) +#define plt_warn (fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__) +#define plt_print (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)#define plt_dump (fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)#define plt_dump_no_nl (fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;*/ #define plt_dbg(subsystem, fmt, args...) \ rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem, \ - "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, \ -##args) + "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)#define plt_base_dbg (fmt, ...) plt_dbg(base, fmt, ##__VA_ARGS__)#define plt_cpt_dbg (fmt, ...) plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;#define plt_dpi_dbg (fmt, ...) plt_dbg(dpi, fmt, ##__VA_ARGS__)/* Datapath logs */ -#define plt_dp_err(fmt, args...) \ - RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_info(fmt, args...) \ - RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_dbg(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_dp_log(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ## args) + +#define plt_dp_err (fmt, ...) plt_dp_log(ERR, fmt, ##__VA_ARGS__) +#define plt_dp_info (fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__) +#define plt_dp_dbg (fmt, ...) plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)#ifdef __cplusplus#define CNXK_PCI_ID (subsystem_dev, dev) \
Signature · 1 line
2.42.0
PATCH v2 18/25 common/cpt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cpt/cpt_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cpt/cpt_pmd_logs.h +1 -1
@@ -34,7 +34,7 @@* level of 'pmd' has to be used. */ #define CPT_LOG_DP(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args) #define CPT_LOG_DP_DEBUG(fmt, args...) \ CPT_LOG_DP(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH v2 19/25 common/sfc_efx: remove use of PMD logtype
In reply to Stephen HemmingerThis code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers.
--- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/common/sfc_efx/sfc_efx.c +2 -9
@@ -15,7 +15,7 @@#include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,return rc; } -RTE_INIT (sfc_efx_register_logtype) -{ -int ret; - - ret =rte_log_register_type_and_pick_level ("pmd.common.sfc_efx" , -RTE_LOG_NOTICE ); - sfc_efx_logtype = (ret <0 ) ?RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT (sfc_efx_logtype,NOTICE );
drivers/common/sfc_efx/sfc_efx_log.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_EFX_LOG_H_/** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype;/** Log message, add a prefix and a line break */ #define SFC_EFX_LOG (level, ...) \
Signature · 1 line
2.42.0
PATCH v2 20/25 common/dpaax: do not use PMD logtype
In reply to Stephen HemmingerUse existing dpaax_logger log type instead of PMD.
--- drivers/common/dpaax/caamflib/compat.h | 5 ++++- drivers/common/dpaax/dpaax_logs.h | 2 +- drivers/common/dpaax/version.map | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/common/dpaax/caamflib/compat.h +4 -1
@@ -40,11 +40,14 @@#define __maybe_unused __rte_unused#endif +extern int dpaax_logger; +#if defined(SUPPRESS_PRINTS )#define pr_msg (l, fmt, ...) do { } while (0)#else #define pr_msg (l, fmt, ...) \ - RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) + rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \ + __func__, ##__VA_ARGS__)#endif #if !defined(pr_debug)
drivers/common/dpaax/dpaax_logs.h +1 -1
@@ -37,7 +37,7 @@ extern int dpaax_logger;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAAX_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaax_logger, fmt, ## args) #define DPAAX_DP_DEBUG(fmt, args...) \ DPAAX_DP_LOG(DEBUG, fmt, ## args)
drivers/common/dpaax/version.map +1 -0
@@ -6,6 +6,7 @@ INTERNAL { dpaax_iova_table_p; dpaax_iova_table_populate; dpaax_iova_table_update; + dpaax_logger; of_device_is_available; of_device_is_compatible; of_find_compatible_node;
Signature · 1 line
2.42.0
PATCH v2 21/25 basband/la12xx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h +1 -1
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define rte_bbdev_dp_log(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
Signature · 1 line
2.42.0
PATCH v2 22/25 bus/cdx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/cdx/cdx_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/cdx/cdx_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define CDX_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args) #define CDX_BUS_DP_DEBUG(fmt, args...) \ CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH v2 23/25 bus/fslmc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/fslmc/fslmc_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/fslmc/fslmc_logs.h +1 -1
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args) #define DPAA2_BUS_DP_DEBUG(fmt, args...) \ DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH v2 24/25 dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 +++-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/dma/dpaa/dpaa_qdma_logs.h +3 -2
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype; DPAA_QDMA_LOG(WARNING, fmt, ## args) /* DP Logs, toggled out at compile time if level lower than current level */ -#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) +#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype, \ + "dpaa_qdma: " fmt "\n", ## args) #define DPAA_QDMA_DP_DEBUG(fmt, args...) \ DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
drivers/dma/dpaa2/dpaa2_qdma_logs.h +2 -1
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \ + "dpaa2_qdma: " fmt "\n", ## args) #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \ DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
PATCH v2 25/25 mempool/dpaa, mempool/dpaa2: do not use logtype PMD
In reply to Stephen HemmingerThe driver already has a logtype, just not consistently used.
--- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/mempool/dpaa/dpaa_mempool.h +1 -1
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;#define MEMPOOL_INIT_FUNC_TRACE () DPAA_MEMPOOL_LOG(DEBUG, " >>") #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args) #define DPAA_MEMPOOL_DEBUG(fmt, args...) \ DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args) #define DPAA_MEMPOOL_ERR(fmt, args...) \
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured\n" );return -ENOMEM ; }
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured" );return NULL ; }
drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args) #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \ DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.42.0
Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
In reply to Stephen HemmingerQuoted 4 lines · Stephen Hemminger
The generic
RTE_LOGTYPE_PMDis a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for theRTE_LOG_DP().
I don't see why we need a new rte_log_dp helper.
The #define RTE_LOGTYPE_XXX trick should work fine with RTE_LOG_DP(). What else is missing?
Quoted 4 lines
Most of this patchset is boiler plate but there were some places where use of PMD type snuck in with changes to original driver and get fixed here.
I see odd changes, like a change in PMD_DRV_LOG meaning in the first patch:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
A lot of drivers use this macro to log "driver"/configuration level errors (see below).
Switching this macro to the DP version looks wrong to me.
$ git grep PMD_DRV_LOG drivers/net/atlantic/ drivers/net/atlantic/atl_ethdev.c: PMD_DRV_LOG(ERR, "rte_eal_alarm_set fail"); drivers/net/atlantic/atl_ethdev.c: PMD_DRV_LOG(INFO, "Port %d: Link Up - speed %u Mbps - %s", drivers/net/atlantic/atl_ethdev.c: PMD_DRV_LOG(INFO, " Port %d: Link Down", drivers/net/atlantic/atl_ethdev.c: PMD_DRV_LOG(DEBUG, "PCI Address: " PCI_PRI_FMT, ...
--
David Marchand
Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
Quoted 10 lines · On Wed, 13 Dec 2023 09:00:48 +0100 David Marchand <[email protected]>…
Quoted 4 lines · Stephen Hemminger
The generic
RTE_LOGTYPE_PMDis a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for theRTE_LOG_DP().I don't see why we need a new
rte_log_dphelper.
The #defineRTE_LOGTYPE_XXXtrick should work fine withRTE_LOG_DP(). What else is missing?
The problem is RTE_LOG_DP() usage today takes suffixes. So the param log type can only be one of the pre-defined fixed values.
Changing the macro in one patch would be a huge patch.
It seemed best to have RTE_LOG_DP() stay like RTE_LOG() and introduce rte_log_dp() to match rte_log().
Re: [PATCH v2 00/25] Replace use of RTE_LOGTYPE_PMD
Quoted 11 lines · Stephen Hemminger
Quoted 7 lines · On Wed, 13 Dec 2023 09:00:48 +0100 David Marchand <[email protected]>…
Quoted 4 lines · Stephen Hemminger
The generic
RTE_LOGTYPE_PMDis a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for theRTE_LOG_DP().
Quoted 8 lines
Quoted 3 lines
I don't see why we need a new
rte_log_dphelper.
The #defineRTE_LOGTYPE_XXXtrick should work fine withRTE_LOG_DP(). What else is missing?The problem is
RTE_LOG_DP()usage today takes suffixes. So the param log type can only be one of the pre-defined fixed values.Changing the macro in one patch would be a huge patch.
I am not asking for change in the RTE_LOG_DP() API. I sent a patch doing for what I had in mind:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
Quoted 4 lines
It seemed best to have
RTE_LOG_DP()stay likeRTE_LOG()and introducerte_log_dp()to matchrte_log().
rte_log() seems a low level API, I don't like the idea of adding another one with rte_log_dp().
And it will conflict with the cleanup I started on multiline / line with \n in logs.
Signature · 1 line
David Marchand
v3 cover Replace uso of RTE_LOGTYPE_PMD
In reply to Stephen HemmingerThe generic RTE_LOGTYPE_PMD is a leftover and should be removed. As a first step, fix many drivers to not use it, and add a helper for the RTE_LOG_DP().
Most of this patchset is boiler plate but there were some places where use of PMD type snuck in with later changes to the original driver.
v3 - add more drivers. fix docbook.
Stephen Hemminger (37):
log: fix doc comment for RTE_LOG_DP()
log: add rte_log_dp()
net/atlantic: replace RTE_LOG_DP with rte_log_dp net/avp: replace RTE_LOG_DP with rte_log_dp net/bnxt: replace RTE_LOG_DP with rte_log_dp net/dpaa: replace RTE_LOG_DP with rte_log_dp net/dpaa2: replace RTE_LOG_DP with rte_log_dp net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp net/igc: replace RTE_LOG_DP with rte_log_dp net/mana: replace RTE_LOG_DP with rte_log_dp net/mvpp2: do not use PMD logtype
net/octeon_ep: replace RTE_LOG_DP with rte_log_dp net/pfe: replace RTE_LOG_DP with rte_log_dp net/qede: replace RTE_LOG_DP with rte_log_dp net/virtio: replace RTE_LOG_DP with rte_log_dp net/vmxnet3: do not use PMD logtype
common/cnxk: replace RTE_LOG_DP with rte_log_dp common/cpt: replace RTE_LOG_DP with rte_log_dp common/sfc_efx: remove use of PMD logtype common/dpaax: do not use PMD logtype basband/la12xx: replace RTE_LOG_DP with rte_log_dp bus/cdx: replace RTE_LOG_DP with rte_log_dp bus/fslmc: replace RTE_LOG_DP with rte_log_dp dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp mempool/dpaa, mempool/dpaa2: do not use logtype PMD vdpa/ifc: replace use of RTE_LOGTYPE_PMD raw/cnxk_bphy: replace PMD logtype with dynamic type raw/cnxk_gpio: replace PMD logtype with dynamic type raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp raw/ifpga: replace PMD logtype with dynamic type event/dlb2: replace logtype PMD with rte_log_dp event/dpaa, event/dpaa2: use local logtype event/skeleton: replace logtype PMD with dynamic type crypto/caam_jr: replace logtype PMD
crypto/ccp: do not use PMD logtype crypto/scheduler: replace use of logtype PMD crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- drivers/bus/cdx/cdx_logs.h | 2 +- drivers/bus/fslmc/fslmc_logs.h | 2 +- drivers/common/cnxk/roc_platform.h | 28 +++++++++-------- drivers/common/cpt/cpt_pmd_logs.h | 2 +- drivers/common/dpaax/caamflib/compat.h | 5 ++- drivers/common/dpaax/dpaax_logs.h | 2 +- drivers/common/dpaax/version.map | 1 + drivers/common/sfc_efx/sfc_efx.c | 11 ++----- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 8 ++--- drivers/crypto/caam_jr/caam_jr_log.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++---- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++-- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 4 +-- drivers/crypto/dpaa_sec/dpaa_sec.c | 4 +-- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 2 +- drivers/crypto/scheduler/scheduler_pmd.c | 4 +-- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 +-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 +- drivers/event/dlb2/dlb2.c | 5 ++- drivers/event/dlb2/dlb2_log.h | 2 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 +-- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 ++-- drivers/event/skeleton/skeleton_eventdev.c | 3 +- drivers/event/skeleton/skeleton_eventdev.h | 8 +++-- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- drivers/net/atlantic/atl_logs.h | 15 ++++----- drivers/net/avp/avp_logs.h | 20 ++++++------ drivers/net/bnxt/bnxt.h | 5 +++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +- drivers/net/bnxt/bnxt_txr.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +-- drivers/net/enetc/enetc_logs.h | 2 +- drivers/net/enetfec/enet_pmd_logs.h | 2 +- drivers/net/igc/igc_logs.h | 10 +++--- drivers/net/mana/mana.h | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +-- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++- drivers/net/octeontx/octeontx_logs.h | 3 +- drivers/net/pfe/pfe_logs.h | 2 +- drivers/net/qede/qede_logs.h | 10 +++--- drivers/net/virtio/virtio_logs.h | 16 +++++----- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 ++++--- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++---------- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 5 +++ drivers/raw/cnxk_gpio/cnxk_gpio.c | 22 +++++++------ drivers/raw/cnxk_gpio/cnxk_gpio.h | 4 +++ drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 31 +++++++++---------- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 +- .../raw/ifpga/base/osdep_rte/osdep_generic.h | 4 ++- drivers/vdpa/ifc/base/ifcvf.c | 14 ++++----- drivers/vdpa/ifc/base/ifcvf_osdep.h | 9 ++++-- lib/log/rte_log.h | 24 ++++++++++++-- 67 files changed, 249 insertions(+), 192 deletions(-)
Signature · 1 line
2.43.0
PATCH v3 1/37 log: fix doc comment for RTE_LOG_DP()
The macro does not return a numeric status, only void.
--- lib/log/rte_log.h | 3 --- 1 file changed, 3 deletions(-)
lib/log/rte_log.h +0 -3
@@ -348,9 +348,6 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)* @param ... * The fmt string, as in printf(3), followed by the variable arguments * required by the format. -* @return -* - 0: Success. -* - Negative on error. */ #define RTE_LOG_DP (l, t, ...) \ (void)((RTE_LOG_ ## l <= RTE_LOG_DP_LEVEL) ? \
Signature · 1 line
2.43.0
PATCH v3 2/37 log: add rte_log_dp()
In reply to Stephen HemmingerAdd a new macro for logging in datapath using a logtype. The existing macro RTE_LOG_DP() takes log type suffix (i.e. PMD) like RTE_LOG(). This macro allows using a dynamic type.
Ideally, rte_log_dp() could be an always_inline function but GCC and Clang will not inline a function with variable number of arguments. Therefore it has to be a macro.
--- lib/log/rte_log.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
lib/log/rte_log.h +21 -0
@@ -355,6 +355,27 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \ 0) +/** +* Generates a log message for data path. +* +* Similar to rte_log(), except that it gets optimized away +* if the RTE_LOG_DP_LEVEL configuration option is lower than the log +* level argument. +* +* @param l +* Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8). +* @param t +* The log type, for example, RTE_LOGTYPE_EAL. +* @param ... +* The format string, as in printf(3), followed by the variable arguments +* required by the format. +*/ +#define rte_log_dp (l, t, ...) \ + do { \ + if ((l) <= RTE_LOG_DP_LEVEL) \ + rte_log(l, t, __VA_ARGS__); \ + } while (0) +#define RTE_LOG_REGISTER_IMPL (type, name, level) \ int type; \ RTE_INIT(__##type) \
Signature · 1 line
2.43.0
PATCH v3 3/37 net/atlantic: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/atlantic/atl_logs.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/atlantic/atl_logs.h +8 -7
@@ -14,18 +14,19 @@ extern int atl_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) - -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) -extern int atl_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \ __func__, ## args) #define PMD_DRV_LOG(level, fmt, args...) \ - PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, atl_logtype_driver, fmt "\n", \ + ## args) + +#define PMD_RX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args) + +#define PMD_TX_LOG(level, fmt, args...) \ + PMD_DRV_LOG(level, fmt, ## args)#endif
Signature · 1 line
2.43.0
PATCH v3 4/37 net/avp: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/avp/avp_logs.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/avp/avp_logs.h +11 -9
@@ -7,24 +7,26 @@#include <rte_log.h> + +extern int avp_logtype_driver; + +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s(): " fmt, __func__, ## args) +#ifdef RTE_LIBRTE_AVP_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() rx: " fmt, __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_AVP_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args) + rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ + "%s() tx: " fmt, __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif - -extern int avp_logtype_driver; - -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, avp_logtype_driver, \ - "%s(): " fmt, __func__, ## args) -#endif /* _AVP_LOGS_H_ */
Signature · 1 line
2.43.0
PATCH v3 5/37 net/bnxt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 +-- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 +-- drivers/net/bnxt/bnxt_txr.c | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/bnxt/bnxt.h +5 -0
@@ -1058,6 +1058,11 @@ extern int bnxt_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt, ## args) +#define PMD_DRV_LOG_DP(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, bnxt_logtype_driver, \ + fmt, ## args) + +extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;int32_t bnxt_ulp_port_init (struct bnxt *bp);void bnxt_ulp_port_deinit (struct bnxt *bp);
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +1 -2
@@ -357,8 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1 -2
@@ -326,8 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
drivers/net/bnxt/bnxt_txr.c +1 -3
@@ -542,9 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)if (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 ) nb_tx_pkts += opaque;else -RTE_LOG_DP (ERR ,PMD , -"Unhandled CMP type %02x\n" , -CMP_TYPE (txcmp)); +PMD_DRV_LOG_DP (ERR ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons); }while (nb_tx_pkts < ring_mask);
Signature · 1 line
2.43.0
PATCH v3 6/37 net/dpaa: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa/dpaa_ethdev.c | 4 ++-- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +2 -2
@@ -2096,7 +2096,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* copy the primary mac address */ rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); -RTE_LOG (INFO ,PMD ,"net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n" , +DPAA_PMD_INFO ("dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT , dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr));if (!fman_intf->is_shared_mac) {
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, ret =dpaa_dev_init_secondary (eth_dev);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"secondary dev init failed\n" ); +DPAA_PMD_ERR ("secondary dev init failed" );return ret; }
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -232,6 +232,6 @@ extern int dpaa_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_pmd, fmt, ## args)#endif
Signature · 1 line
2.43.0
RE: [PATCH v3 06/37] net/dpaa: replace RTE_LOG_DP with rte_log_dp
PATCH v3 7/37 net/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)return ret; } } -RTE_LOG (INFO ,PMD ,"%s: netdev created, connected to %s\n" , +DPAA2_PMD_INFO ("%s: netdev created, connected to %s\n" , eth_dev->data->name, dpaa2_dev->ep_name);return 0 ;
drivers/net/dpaa2/dpaa2_pmd_logs.h +1 -1
@@ -28,7 +28,7 @@ extern int dpaa2_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_pmd, fmt, ## args) #define DPAA2_PMD_DP_DEBUG(fmt, args...) \ DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/dpaa2/dpaa2_sparser.c +2 -2
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv, priv->ss_iova = (uint64_t )(DPAA2_VADDR_TO_IOVA (addr)); priv->ss_offset += sp_param.size; -RTE_LOG (INFO ,PMD ,"Soft parser loaded for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser loaded for dpni@%d\n" , priv->hw_id);rte_free (addr);return 0 ;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv, }rte_free (param_addr); -RTE_LOG (INFO ,PMD ,"Soft parser enabled for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser enabled for dpni@%d\n" , priv->hw_id);return 0 ; }
Signature · 1 line
2.43.0
RE: [PATCH v3 07/37] net/dpaa2: replace RTE_LOG_DP with rte_log_dp
PATCH v3 8/37 net/enetc, net/enetfec: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/enetc/enetc_logs.h | 2 +- drivers/net/enetfec/enet_pmd_logs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/enetc/enetc_logs.h +1 -1
@@ -30,7 +30,7 @@ extern int enetc_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETC_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetc_logtype_pmd, fmt, ## args) #define ENETC_PMD_DP_DEBUG(fmt, args...) \ ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/enetfec/enet_pmd_logs.h +1 -1
@@ -28,6 +28,6 @@ extern int enetfec_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETFEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, enetfec_logtype_pmd, fmt, ## args)#endif /* _ENETFEC_LOGS_H_ */
Signature · 1 line
2.43.0
PATCH v3 9/37 net/igc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/igc/igc_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/igc/igc_logs.h +6 -4
@@ -21,15 +21,17 @@ extern int igc_logtype_driver;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>")#ifdef RTE_ETHDEV_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_RX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_ETHDEV_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) +#define PMD_TX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, igc_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif
Signature · 1 line
2.43.0
PATCH v3 10/37 net/mana: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/mana/mana.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mana/mana.h +1 -1
@@ -467,7 +467,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
Signature · 1 line
2.43.0
RE: [PATCH v3 10/37] net/mana: replace RTE_LOG_DP with rte_log_dp
Quoted 5 lines
Subject: [PATCH v3 10/37] net/mana: replace
RTE_LOG_DPwithrte_log_dpWant datapath logs to use own logtype.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 19 lines
--- drivers/net/mana/mana.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/mana/mana.h index renamed from drivers/net/mana/mana.h +0
-0
6836872dc257..8d60f9172d44100644drivers/net/mana/mana.h +1
-2@@ -467,7 +467,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, mana_logtype_driver, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\ --2.43.0
PATCH v3 11/37 net/mvpp2: do not use PMD logtype
In reply to Stephen HemmingerThe driver already has a logtype but it was not being used in one place.
--- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +2 -2
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)/* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (priv->multiseg) { -RTE_LOG (INFO ,PMD ,"Using multi-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using multi-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst; }else { -RTE_LOG (INFO ,PMD ,"Using single-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using single-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_pkt_burst; } }
Signature · 1 line
2.43.0
PATCH v3 12/37 net/octeon_ep: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeon_ep/otx_ep_common.h | 7 +++++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/octeon_ep/otx_ep_common.h +7 -0
@@ -81,6 +81,13 @@ "%s():%u " fmt "\n", \ __func__, __LINE__, ##args) +#define otx_ep_log_dp(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, otx_net_ep_logtype, \ + "%s():%u " fmt "\n", \ + __func__, __LINE__, ##args) + + +/* IO Access */ #define oct_ep_read64 (addr) rte_read64_relaxed((void *)(addr))#define oct_ep_write64 (val, addr) rte_write64_relaxed((val), (void *)(addr))
drivers/net/octeon_ep/otx_ep_rxtx.c +2 -3
@@ -884,9 +884,8 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) next_fetch = (pkts == new_pkts -1 ) ?0 :1 ; oq_pkt =otx_ep_droq_read_packet (otx_ep, droq, next_fetch);if (!oq_pkt) { -RTE_LOG_DP (ERR ,PMD , -"DROQ read pkt failed pending %" PRIu64 -"last_pkt_count %" PRIu64"new_pkts %d.\n" , +otx_ep_log_dp (ERR ,"DROQ read pkt failed pending %" PRIu64 +"last_pkt_count %" PRIu64"new_pkts %d." , droq->pkts_pending, droq->last_pkt_count, new_pkts); droq->stats.rx_err++;
Signature · 1 line
2.43.0
PATCH v3 13/37 net/pfe: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/octeontx/octeontx_logs.h | 3 +-- drivers/net/pfe/pfe_logs.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/octeontx/octeontx_logs.h +1 -2
@@ -19,11 +19,10 @@ rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \ "%s(): " fmt "\n", __func__, ## args) -#define octeontx_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, fmt "\n", ## args)#define octeontx_log_err (s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)#define octeontx_log_dbg (s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__) +#define octeontx_log_info (s, ...) PMD_DRV_LOG(INFO, s, ##__VA_ARGS__)#define octeontx_mbox_log (s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__)#define PMD_RX_LOG PMD_DRV_LOG
drivers/net/pfe/pfe_logs.h +1 -1
@@ -26,6 +26,6 @@ extern int pfe_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define PFE_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ##level, pfe_logtype_pmd, fmt, ## args)#endif /* _PFE_LOGS_H_ */
Signature · 1 line
2.43.0
PATCH v3 14/37 net/qede: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/qede/qede_logs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/qede/qede_logs.h +6 -4
@@ -58,16 +58,18 @@ extern int qede_logtype_init;#define PMD_INIT_FUNC_TRACE (edev) PMD_INIT_LOG(DEBUG, edev, " >>")#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -#define PMD_TX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_TX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_QEDE_DEBUG_RX -#define PMD_RX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_RX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
Signature · 1 line
2.43.0
RE: [EXT] [PATCH v3 14/37] net/qede: replace RTE_LOG_DP with rte_log_dp
Quoted 43 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, December 13, 2023 10:06 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Devendra Singh Rawat <[email protected]>; Alok Prasad <[email protected]>
Subject: [EXT] [PATCH v3 14/37] net/qede: replaceRTE_LOG_DPwithrte_log_dpExternal Email
----------------------------------------------------------------------
Want datapath logs to use own logtype.Signed-off-by Stephen Hemminger <[email protected]>---
drivers/net/qede/qede_logs.h| 10 ++++++----1 file changed, 6 insertions(+), 4 deletions(-)drivers/net/qede/qede_logs.h +3
-2@@ -58,16 +58,18 @@ extern int qede_logtype_init; #define PMD_INIT_FUNC_TRACE(edev) PMD_INIT_LOG(DEBUG, edev, " >>") #ifdef RTE_LIBRTE_QEDE_DEBUG_TX -#define PMD_TX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_TX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args) #else #define
PMD_TX_LOG(level, fmt, args...)do { } while (0) #endif#ifdef
RTE_LIBRTE_QEDE_DEBUG_RXdrivers/net/qede/qede_logs.h +3
-2-#define PMD_RX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ +#define PMD_RX_LOG(level, q, fmt, args...) \ + rte_log(RTE_LOG_ ## level, qede_logtype_driver, \ + "%s(): port=%u queue=%u " fmt "\n", \__func__, q->port_id, q->queue_id, ## args) #else #define
Quoted 3 lines
PMD_RX_LOG(level, q, fmt, args...)do { } while (0) --
2.43.0
Acked.
PATCH v3 15/37 net/virtio: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/net/virtio/virtio_logs.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/virtio/virtio_logs.h +9 -7
@@ -14,23 +14,25 @@ extern int virtio_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int virtio_logtype_driver; +#define PMD_DRV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args) +#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() rx: " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ + "%s() tx: " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif -extern int virtio_logtype_driver; -#define PMD_DRV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ - "%s(): " fmt "\n", __func__, ## args) -#endif /* _VIRTIO_LOGS_H_ */
Signature · 1 line
2.43.0
PATCH v3 16/37 net/vmxnet3: do not use PMD logtype
In reply to Stephen HemmingerThe driver used a slightly different (and older) format for datapath logs. Remove PMD logtype here.
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)if (events ==0 ) goto done; -RTE_LOG (DEBUG ,PMD ,"Reading events: 0x%X" , events); +PMD_DRV_LOG (DEBUG ,"Reading events: 0x%X" , events);vmxnet3_process_events (dev); done:vmxnet3_enable_intr (hw, *eventIntrIdx);
drivers/net/vmxnet3/vmxnet3_logs.h +8 -4
@@ -11,28 +11,32 @@ extern int vmxnet3_logtype_init; "%s(): " fmt "\n", __func__, ## args)#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") +extern int vmxnet3_logtype_driver; +#ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE #define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)#endif -extern int vmxnet3_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ "%s(): " fmt "\n", __func__, ## args)
Signature · 1 line
2.43.0
PATCH v3 17/37 common/cnxk: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/common/cnxk/roc_platform.h +15 -13
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;extern int cnxk_logtype_ree;extern int cnxk_logtype_dpi; -#define plt_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) -#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args) -#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) +#define plt_log(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_err (fmt, ...) plt_log(ERR, fmt, ##__VA_ARGS__) +#define plt_info (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__) +#define plt_warn (fmt, ...) plt_log(WARNING, fmt, ##__VA_ARGS__) +#define plt_print (fmt, ...) plt_log(INFO, fmt, ##__VA_ARGS__)#define plt_dump (fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)#define plt_dump_no_nl (fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -278,8 +280,7 @@ extern int cnxk_logtype_dpi;*/ #define plt_dbg(subsystem, fmt, args...) \ rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem, \ - "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, \ -##args) + "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, ##args)#define plt_base_dbg (fmt, ...) plt_dbg(base, fmt, ##__VA_ARGS__)#define plt_cpt_dbg (fmt, ...) plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -295,12 +296,13 @@ extern int cnxk_logtype_dpi;#define plt_dpi_dbg (fmt, ...) plt_dbg(dpi, fmt, ##__VA_ARGS__)/* Datapath logs */ -#define plt_dp_err(fmt, args...) \ - RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_info(fmt, args...) \ - RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_dp_dbg(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_dp_log(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, cnxk_logtype_base, \ + "%s():%u " fmt "\n", __func__, __LINE__, ## args) + +#define plt_dp_err (fmt, ...) plt_dp_log(ERR, fmt, ##__VA_ARGS__) +#define plt_dp_info (fmt, ...) plt_dp_log(INFO, fmt, ##__VA_ARGS__) +#define plt_dp_dbg (fmt, ...) plt_dp_log(DEBUG, fmt, ##__VA_ARGS__)#ifdef __cplusplus#define CNXK_PCI_ID (subsystem_dev, dev) \
Signature · 1 line
2.43.0
PATCH v3 18/37 common/cpt: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/common/cpt/cpt_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cpt/cpt_pmd_logs.h +1 -1
@@ -34,7 +34,7 @@* level of 'pmd' has to be used. */ #define CPT_LOG_DP(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, CPT_LOGTYPE, fmt "\n", ## args) #define CPT_LOG_DP_DEBUG(fmt, args...) \ CPT_LOG_DP(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
PATCH v3 19/37 common/sfc_efx: remove use of PMD logtype
In reply to Stephen HemmingerThis code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers.
--- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/common/sfc_efx/sfc_efx.c +2 -9
@@ -15,7 +15,7 @@#include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,return rc; } -RTE_INIT (sfc_efx_register_logtype) -{ -int ret; - - ret =rte_log_register_type_and_pick_level ("pmd.common.sfc_efx" , -RTE_LOG_NOTICE ); - sfc_efx_logtype = (ret <0 ) ?RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT (sfc_efx_logtype,NOTICE );
drivers/common/sfc_efx/sfc_efx_log.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_EFX_LOG_H_/** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype;/** Log message, add a prefix and a line break */ #define SFC_EFX_LOG (level, ...) \
Signature · 1 line
2.43.0
PATCH v3 20/37 common/dpaax: do not use PMD logtype
In reply to Stephen HemmingerUse existing dpaax_logger log type instead of PMD.
--- drivers/common/dpaax/caamflib/compat.h | 5 ++++- drivers/common/dpaax/dpaax_logs.h | 2 +- drivers/common/dpaax/version.map | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/common/dpaax/caamflib/compat.h +4 -1
@@ -40,11 +40,14 @@#define __maybe_unused __rte_unused#endif +extern int dpaax_logger; +#if defined(SUPPRESS_PRINTS )#define pr_msg (l, fmt, ...) do { } while (0)#else #define pr_msg (l, fmt, ...) \ - RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) + rte_log(RTE_LOG_ ## l, dpaax_logger, "%s(): " fmt "\n", \ + __func__, ##__VA_ARGS__)#endif #if !defined(pr_debug)
drivers/common/dpaax/dpaax_logs.h +1 -1
@@ -37,7 +37,7 @@ extern int dpaax_logger;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAAX_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaax_logger, fmt, ## args) #define DPAAX_DP_DEBUG(fmt, args...) \ DPAAX_DP_LOG(DEBUG, fmt, ## args)
drivers/common/dpaax/version.map +1 -0
@@ -6,6 +6,7 @@ INTERNAL { dpaax_iova_table_p; dpaax_iova_table_populate; dpaax_iova_table_update; + dpaax_logger; of_device_is_available; of_device_is_compatible; of_find_compatible_node;
Signature · 1 line
2.43.0
RE: [PATCH v3 20/37] common/dpaax: do not use PMD logtype
PATCH v3 21/37 basband/la12xx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h +1 -1
@@ -23,6 +23,6 @@ extern int bbdev_la12xx_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define rte_bbdev_dp_log(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt, ## args)#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
Signature · 1 line
2.43.0
RE: [PATCH v3 21/37] basband/la12xx: replace RTE_LOG_DP with rte_log_dp
PATCH v3 22/37 bus/cdx: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/cdx/cdx_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/cdx/cdx_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int cdx_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define CDX_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, cdx_logtype_bus, fmt, ## args) #define CDX_BUS_DP_DEBUG(fmt, args...) \ CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
PATCH v3 23/37 bus/fslmc: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/bus/fslmc/fslmc_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/fslmc/fslmc_logs.h +1 -1
@@ -27,7 +27,7 @@ extern int dpaa2_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, dpaa2_logtype_bus, fmt, ## args) #define DPAA2_BUS_DP_DEBUG(fmt, args...) \ DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
RE: [PATCH v3 23/37] bus/fslmc: replace RTE_LOG_DP with rte_log_dp
PATCH v3 24/37 dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
In reply to Stephen HemmingerWant datapath logs to use own logtype.
--- drivers/dma/dpaa/dpaa_qdma_logs.h | 5 +++-- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/dma/dpaa/dpaa_qdma_logs.h +3 -2
@@ -25,8 +25,9 @@ extern int dpaa_qdma_logtype; DPAA_QDMA_LOG(WARNING, fmt, ## args) /* DP Logs, toggled out at compile time if level lower than current level */ -#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) +#define DPAA_QDMA_DP_LOG(level, fmt, args...) \ + rte_log_dp(RTE_LOG_ ## level, dpaa_qdma_logtype, \ + "dpaa_qdma: " fmt "\n", ## args) #define DPAA_QDMA_DP_DEBUG(fmt, args...) \ DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
drivers/dma/dpaa2/dpaa2_qdma_logs.h +2 -1
@@ -30,7 +30,8 @@ extern int dpaa2_qdma_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_qdma_logtype, \ + "dpaa2_qdma: " fmt "\n", ## args) #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \ DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
RE: [PATCH v3 24/37] dma/dpaa, dma/dpaa2: replace RTE_LOG_DP with rte_log_dp
PATCH v3 25/37 mempool/dpaa, mempool/dpaa2: do not use logtype PMD
In reply to Stephen HemmingerThe driver already has a logtype, just not consistently used.
--- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++-- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/mempool/dpaa/dpaa_mempool.h +1 -1
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;#define MEMPOOL_INIT_FUNC_TRACE () DPAA_MEMPOOL_LOG(DEBUG, " >>") #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_DEBUG, dpaa_logtype_mempool, fmt, ## args) #define DPAA_MEMPOOL_DEBUG(fmt, args...) \ DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args) #define DPAA_MEMPOOL_ERR(fmt, args...) \
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured\n" );return -ENOMEM ; }
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_LOG (ERR ,"DPAA2 buffer pool not configured" );return NULL ; }
drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h +1 -1
@@ -25,7 +25,7 @@ extern int dpaa2_logtype_mempool;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_mempool, fmt, ## args) #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \ DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
RE: [PATCH v3 25/37] mempool/dpaa, mempool/dpaa2: do not use logtype PMD
PATCH v3 26/37 vdpa/ifc: replace use of RTE_LOGTYPE_PMD
In reply to Stephen HemmingerThis driver is using RTE_LOGTYPE_PMD, fix to have a dynamic type.
--- drivers/vdpa/ifc/base/ifcvf.c | 14 +++++++------- drivers/vdpa/ifc/base/ifcvf_osdep.h | 9 +++++++-- 2 files changed, 14 insertions(+), 9 deletions(-)
drivers/vdpa/ifc/base/ifcvf.c +7 -7
@@ -224,11 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)if (mq_cfg) {if (hw->device_type ==IFCVF_BLK ) { *(u32 *)mq_cfg = nr_queue; -RTE_LOG (INFO ,PMD ,"%d queues are enabled\n" , nr_queue); +IFCVF_LOG (INFO ,"%d queues are enabled" , nr_queue); }else { *(u32 *)mq_cfg = nr_queue /2 ; -RTE_LOG (INFO ,PMD ,"%d queue pairs are enabled\n" , - nr_queue /2 ); +IFCVF_LOG (INFO ,"%d queue pairs are enabled" , nr_queue /2 ); } } }
@@ -246,7 +245,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg;if (!cfg) { -RTE_LOG (ERR ,PMD ,"common_cfg in HW is NULL.\n" ); +IFCVF_LOG (ERR ,"common_cfg in HW is NULL." );return -1 ; }
@@ -258,8 +257,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)IFCVF_WRITE_REG16 (i +1 , &cfg->queue_msix_vector); msix_vector =IFCVF_READ_REG16 (&cfg->queue_msix_vector);if (msix_vector ==IFCVF_MSI_NO_VECTOR ) { -RTE_LOG (ERR ,PMD ,"queue %d, msix vec alloc failed\n" , - i); +IFCVF_LOG (ERR ,"queue %d, msix vec alloc failed" , i);return -1 ; } }
@@ -307,7 +305,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg;if (!cfg) { -RTE_LOG (ERR ,PMD ,"common_cfg in HW is NULL.\n" ); +IFCVF_LOG (ERR ,"common_cfg in HW is NULL." );return ; }
@@ -531,3 +529,5 @@ ifcvf_get_queue_notify_off(struct ifcvf_hw *hw, int qid)return (u8 *)hw->notify_addr[qid] - (u8 *)hw->mem_resource[hw->notify_region].addr; } + +RTE_LOG_REGISTER_DEFAULT (ifcvf_logtype,INFO );
drivers/vdpa/ifc/base/ifcvf_osdep.h +7 -2
@@ -13,8 +13,13 @@#include <rte_log.h> #include <rte_io.h> -#define WARNINGOUT(S, args...) RTE_LOG(WARNING, PMD, S, ##args) -#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args) +extern int ifcvf_logtype; + +#define IFCVF_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ifcvf_logtype, fmt "\n", ## args) + +#define WARNINGOUT(S, args...) IFCVF_LOG(WARNING, S, ##args) +#define DEBUGOUT(S, args...) IFCVF_LOG(DEBUG, S, ##args)#define STATIC static#define msec_delay (x) rte_delay_us_sleep(1000 * (x))
Signature · 1 line
2.43.0
PATCH v3 27/37 raw/cnxk_bphy: replace PMD logtype with dynamic type
In reply to Stephen HemmingerDriver should not be using PMD logtype, they should have their own logtype.
--- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 ++- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++----------- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 5 ++++ 4 files changed, 23 insertions(+), 18 deletions(-)
drivers/raw/cnxk_bphy/cnxk_bphy.c +2 -1
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +BPHY_LOG (WARNING ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {RTE_PMD_REGISTER_PCI (bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);RTE_PMD_REGISTER_PCI_TABLE (bphy_rawdev_pci_driver, pci_bphy_map);RTE_PMD_REGISTER_KMOD_DEP (bphy_rawdev_pci_driver,"vfio-pci" ); +RTE_LOG_REGISTER_DEFAULT (bphy_logtype,INFO );
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +BPHY_LOG (WARNING ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c +15 -16
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)if (ret)break ;if (descs !=1 ) { -RTE_LOG (ERR ,PMD ,"Wrong number of descs reported\n" ); +BPHY_LOG (ERR ,"Wrong number of descs reported" ); ret = -ENODEV ;break ; } -RTE_LOG (INFO ,PMD ,"Testing queue %d\n" , i); +BPHY_LOG (INFO ,"Testing queue %d" , i); ret =rte_pmd_bphy_cgx_stop_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to stop rx/tx\n" ); +BPHY_LOG (ERR ,"Failed to stop rx/tx" );break ; } ret =rte_pmd_bphy_cgx_start_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to start rx/tx\n" ); +BPHY_LOG (ERR ,"Failed to start rx/tx" );break ; } ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, false);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link down\n" ); +BPHY_LOG (ERR ,"Failed to set link down" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,0 );if (ret !=0 ) -RTE_LOG (ERR ,PMD , -"Timed out waiting for a link down\n" ); +BPHY_LOG (ERR ,"Timed out waiting for a link down" ); ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, true);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link up\n" ); +BPHY_LOG (ERR ,"Failed to set link up" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,1 );if (ret !=1 ) -RTE_LOG (ERR ,PMD ,"Timed out waiting for a link up\n" ); +BPHY_LOG (ERR ,"Timed out waiting for a link up" ); ret =rte_pmd_bphy_cgx_intlbk_enable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to enable internal lbk\n" ); +BPHY_LOG (ERR ,"Failed to enable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_intlbk_disable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable internal lbk\n" ); +BPHY_LOG (ERR ,"Failed to disable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_ptp_rx_enable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to enable ptp\n" ); +BPHY_LOG (ERR ,"Failed to enable ptp" );break ; } ret =0 ;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) ret =rte_pmd_bphy_cgx_ptp_rx_disable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to disable ptp\n" ); +BPHY_LOG (ERR ,"Failed to disable ptp" );break ; } ret =0 ; ret =rte_pmd_bphy_cgx_get_supported_fec (dev_id, i, &fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to get supported FEC\n" ); +BPHY_LOG (ERR ,"Failed to get supported FEC" );break ; } ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set FEC to %d\n" , fec); +BPHY_LOG (ERR ,"Failed to set FEC to %d" , fec);break ; } fec =CNXK_BPHY_CGX_ETH_LINK_FEC_NONE ; ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable FEC\n" ); +BPHY_LOG (ERR ,"Failed to disable FEC" );break ; } }
drivers/raw/cnxk_bphy/rte_pmd_bphy.h +5 -0
@@ -26,6 +26,11 @@ extern "C" { #endif +extern int bphy_logtype; + +#define BPHY_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, bphy_logtype, "%s(): " fmt "\n", __func__, ## args) + /** Available message types */ enum cnxk_bphy_cgx_msg_type { /** Type used to obtain link information */
Signature · 1 line
2.43.0
PATCH v3 28/37 raw/cnxk_gpio: replace PMD logtype with dynamic type
In reply to Stephen HemmingerDriver should not be using PMD logtype, they should have their own logtype.
--- drivers/raw/cnxk_gpio/cnxk_gpio.c | 22 ++++++++------- drivers/raw/cnxk_gpio/cnxk_gpio.h | 4 +++ drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 31 +++++++++++----------- 3 files changed, 31 insertions(+), 26 deletions(-)
drivers/raw/cnxk_gpio/cnxk_gpio.c +12 -10
@@ -8,6 +8,7 @@#include <bus_vdev_driver.h> #include <rte_eal.h> +#include <rte_log.h> #include <rte_kvargs.h> #include <rte_lcore.h> #include <rte_rawdev_pmd.h>
@@ -215,13 +216,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist) errno =0 ; val =strtol (token,NULL ,10 );if (errno) { -RTE_LOG (ERR ,PMD ,"failed to parse %s\n" , token); +CNXK_LOG (ERR ,"failed to parse %s" , token); ret = -errno; goto out; }if (val <0 || val >= gpiochip->num_gpios) { -RTE_LOG (ERR ,PMD ,"gpio%d out of 0-%d range\n" , val, +CNXK_LOG (ERR ,"gpio%d out of 0-%d range" , val, gpiochip->num_gpios -1 ); ret = -EINVAL ; goto out;
@@ -231,7 +232,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)if (list[i] != val)continue ; -RTE_LOG (WARNING ,PMD ,"gpio%d already allowed\n" , val); +CNXK_LOG (WARNING ,"gpio%d already allowed" , val);break ; }if (i == queue)
@@ -398,7 +399,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,return ret; } }else { -RTE_LOG (WARNING ,PMD ,"using existing gpio%d\n" , gpio->num); +CNXK_LOG (WARNING ,"using existing gpio%u" , gpio->num); } gpiochip->gpios[num] = gpio;
@@ -647,7 +648,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)/* get rid of last response if any */ if (gpio->rsp) { -RTE_LOG (WARNING ,PMD ,"previous response got overwritten\n" ); +CNXK_LOG (WARNING ,"previous response got overwritten" );rte_free (gpio->rsp); } gpio->rsp = rsp;
@@ -741,7 +742,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)cnxk_gpio_format_name (name,sizeof (name)); rawdev =rte_rawdev_pmd_allocate (name,sizeof (*gpiochip),rte_socket_id ());if (!rawdev) { -RTE_LOG (ERR ,PMD ,"failed to allocate %s rawdev\n" , name); +CNXK_LOG (ERR ,"failed to allocate %s rawdev" , name);return -ENOMEM ; }
@@ -770,7 +771,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/base" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->base);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_LOG (ERR ,"failed to read %s" , buf); goto out; }
@@ -778,20 +779,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/ngpio" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->num_gpios);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_LOG (ERR ,"failed to read %s" , buf); goto out; } gpiochip->num_queues = gpiochip->num_gpios; ret =cnxk_gpio_parse_allowlist (gpiochip, params->allowlist);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to parse allowed gpios\n" ); +CNXK_LOG (ERR ,"failed to parse allowed gpios" ); goto out; } gpiochip->gpios =rte_calloc (NULL , gpiochip->num_gpios,sizeof (struct cnxk_gpio *),0 );if (!gpiochip->gpios) { -RTE_LOG (ERR ,PMD ,"failed to allocate gpios memory\n" ); +CNXK_LOG (ERR ,"failed to allocate gpios memory" ); ret = -ENOMEM ; goto out; }
@@ -851,3 +852,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);RTE_PMD_REGISTER_PARAM_STRING (cnxk_gpio,"gpiochip=<int> " "allowlist=<list>" ); +RTE_LOG_REGISTER_DEFAULT (cnxk_logtype,INFO );
drivers/raw/cnxk_gpio/cnxk_gpio.h +4 -0
@@ -5,6 +5,10 @@#ifndef _CNXK_GPIO_H_#define _CNXK_GPIO_H_ +extern int cnxk_logtype; +#define CNXK_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype, fmt "\n", ## args) +struct cnxk_gpiochip ; struct cnxk_gpio {
drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c +15 -16
@@ -54,12 +54,14 @@ cnxk_gpio_read_attr(char *attr, char *val)return 0 ; } -#define CNXK_GPIO_ERR_STR (err, str, ...) do { \ - if (err) { \ - RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \ - ##__VA_ARGS__, err); \ - goto out; \ - } \ + + +#define CNXK_GPIO_ERR_STR (err, str, ...) do { \ + if (err) { \ + CNXK_LOG(ERR, "%s:%d: " str " (%d)",__func__, __LINE__, \ + ##__VA_ARGS__, err); \ + goto out; \ + } \ } while (0) static int
@@ -330,30 +332,28 @@ cnxk_gpio_selftest(uint16_t dev_id)for (i =0 ; i < queues; i++) { ret =rte_rawdev_queue_conf_get (dev_id, i, &conf,sizeof (conf));if (ret) { -RTE_LOG (ERR ,PMD , -"failed to read queue configuration (%d)\n" , - ret); +CNXK_LOG (ERR ,"failed to read queue configuration (%d)n" , ret); goto out; } -RTE_LOG (INFO ,PMD ,"testing queue%d (gpio%d)\n" , i, conf.gpio); +CNXK_LOG (INFO ,"testing queue%u (gpio%u)" , i, conf.gpio);if (conf.size !=1 ) { -RTE_LOG (ERR ,PMD ,"wrong queue size received\n" ); +CNXK_LOG (ERR ,"wrong queue size received: %u" , conf.size); ret = -EIO ; goto out; } ret =rte_rawdev_queue_setup (dev_id, i,NULL ,0 );if (ret) { -RTE_LOG (ERR ,PMD ,"failed to setup queue (%d)\n" , ret); +CNXK_LOG (ERR ,"failed to setup queue%u (%d)" , i, ret); goto out; } gpio = gpiochip->gpios[conf.gpio];snprintf (buf,sizeof (buf),CNXK_GPIO_PATH_FMT , gpio->num);if (!cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s does not exist\n" , buf); +CNXK_LOG (ERR ,"%s does not exist" , buf); ret = -ENOENT ; goto release; }
@@ -371,13 +371,12 @@ cnxk_gpio_selftest(uint16_t dev_id) ret2 = ret; ret =rte_rawdev_queue_release (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to release queue (%d)\n" , - ret); +CNXK_LOG (ERR ,"failed to release queue%u (%d)" , i, ret);break ; }if (cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s still exists\n" , buf); +CNXK_LOG (ERR ,"%s still exists" , buf); ret = -EIO ;break ; }
Signature · 1 line
2.43.0
PATCH v3 29/37 raw/dpaa2_cmdif: replace PMD logtype with rte_log_dp
In reply to Stephen HemmingerUse local logtype for datapath logs.
--- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +2 -1
@@ -30,7 +30,8 @@ extern int dpaa2_cmdif_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_cmdif_logtype, \ + "dpaa2_cmdif: " fmt "\n", ## args) #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \ DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
PATCH v3 30/37 raw/ifpga: replace PMD logtype with dynamic type
In reply to Stephen HemmingerDriver should not be using PMD logtype, they should have their own logtype.
--- drivers/raw/ifpga/base/osdep_rte/osdep_generic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/raw/ifpga/base/osdep_rte/osdep_generic.h +3 -1
@@ -16,8 +16,10 @@#include <rte_byteorder.h> #include <rte_memcpy.h> +extern int ifpga_rawdev_logtype; + #define dev_printf(level, fmt, args...) \ - RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args) + rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "osdep_rte: " fmt, ## args)#define osdep_panic (...) rte_panic(...)
Signature · 1 line
2.43.0
RE: [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic type
Hi,
Quoted 32 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, December 14, 2023 12:36 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Xu, Rosen <[email protected]>; Tianfei Zhang <[email protected]>
Subject: [PATCH v3 30/37] raw/ifpga: replace PMD logtype with dynamic typeDriver should not be using PMD logtype, they should have their own logtype.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/raw/ifpga/base/osdep_rte/osdep_generic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/raw/ifpga/base/osdep_rte/osdep_generic.h +3
-1@@ -16,8 +16,10 @@#include <rte_byteorder.h> #include <rte_memcpy.h> +extern int ifpga_rawdev_logtype; + #define dev_printf(level, fmt, args...) \ - RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args) + rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "osdep_rte: "fmt, ##
+args)
Quoted 4 lines
#define
osdep_panic(...)rte_panic(...)--
2.43.0
PATCH v3 31/37 event/dlb2: replace logtype PMD with rte_log_dp
In reply to Stephen HemmingerUse local logtype for all log messages.
--- drivers/event/dlb2/dlb2.c | 5 ++--- drivers/event/dlb2/dlb2_log.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/event/dlb2/dlb2.c +2 -3
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,struct rte_kvargs *kvlist =rte_kvargs_parse (params, args);if (kvlist ==NULL ) { -RTE_LOG (INFO ,PMD , -"Ignoring unsupported parameters when creating device '%s'\n" , - name); +DLB2_LOG_INFO ("Ignoring unsupported parameters when creating device '%s'\n" , + name); }else { int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG, set_numa_node,
drivers/event/dlb2/dlb2_log.h +1 -1
@@ -20,6 +20,6 @@ extern int eventdev_dlb2_log_level;/* remove debug logs at compile time unless actually debugging */ #define DLB2_LOG_DBG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_DEBUG, eventdev_dlb2_log_level, fmt, ## args)#endif /* _DLB2_EVDEV_LOG_H_ */
Signature · 1 line
2.43.0
PATCH v3 32/37 event/dpaa, event/dpaa2: use local logtype
In reply to Stephen HemmingerThe driver has macros to use local logtype, but some changes added PMD log messages.
--- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 ++-- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/event/dpaa/dpaa_eventdev.c +1 -1
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue; eventdev->txa_enqueue_same_dest = dpaa_eventdev_txa_enqueue_same_dest; -RTE_LOG (INFO ,PMD ,"%s eventdev added" , name); +DPAA_EVENTDEV_INFO ("%s eventdev added" , name);/* For secondary processes, the primary has done all the work */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/event/dpaa2/dpaa2_eventdev.c +2 -2
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev) priv->max_event_queues++; }while (dpcon_dev && dpci_dev); -RTE_LOG (INFO ,PMD ,"%s eventdev created\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev created" , name); done:event_dev_probing_finish (eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name) } priv->max_event_queues =0 ; -RTE_LOG (INFO ,PMD ,"%s eventdev cleaned\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev cleaned" , name);return 0 ; }
drivers/event/dpaa2/dpaa2_eventdev_logs.h +1 -1
@@ -26,7 +26,7 @@ extern int dpaa2_logtype_event;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_event, fmt, ## args) #define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \ DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +3 -3
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void), int (*test)(void), const char *name) {if (setup () <0 ) { -RTE_LOG (INFO ,PMD ,"Error setting up test %s" , name); +DPAA2_EVENTDEV_INFO ("Error setting up test %s" , name); unsupported++; }else {if (test () <0 ) { failed++; -RTE_LOG (INFO ,PMD ,"%s Failed\n" , name); +DPAA2_EVENTDEV_INFO ("%s Failed" , name); }else { passed++; -RTE_LOG (INFO ,PMD ,"%s Passed" , name); +DPAA2_EVENTDEV_INFO ("%s Passed" , name); } }
Signature · 1 line
2.43.0
RE: [PATCH v3 32/37] event/dpaa, event/dpaa2: use local logtype
PATCH v3 33/37 event/skeleton: replace logtype PMD with dynamic type
In reply to Stephen HemmingerThe skeleton is supposed to match current best practices. Change it to use dynamic logtype.
--- drivers/event/skeleton/skeleton_eventdev.c | 3 ++- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/event/skeleton/skeleton_eventdev.c +2 -1
@@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)const char *name; name =rte_vdev_device_name (vdev); -RTE_LOG (INFO ,PMD ,"Initializing %s on NUMA node %d\n" , name, +PMD_DRV_LOG (INFO ,"Initializing %s on NUMA node %d\n" , name,rte_socket_id ());return skeleton_eventdev_create (name,rte_socket_id (), vdev); }
@@ -479,3 +479,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = { };RTE_PMD_REGISTER_VDEV (EVENTDEV_NAME_SKELETON_PMD , vdev_eventdev_skeleton_pmd); +RTE_LOG_REGISTER_DEFAULT (skeleton_eventdev_logtype,INFO );
drivers/event/skeleton/skeleton_eventdev.h +6 -2
@@ -8,9 +8,12 @@#include <eventdev_pmd_pci.h> #include <eventdev_pmd_vdev.h> +extern int skeleton_eventdev_logtype; +#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)#define PMD_DRV_FUNC_TRACE () PMD_DRV_LOG(DEBUG, ">>")#else #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@#endif #define PMD_DRV_ERR(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)struct skeleton_eventdev {uintptr_t reg_base;
Signature · 1 line
2.43.0
PATCH v3 34/37 crypto/caam_jr: replace logtype PMD
In reply to Stephen HemmingerThe driver has macros for logging, they just weren't used everywhere.
--- drivers/crypto/caam_jr/caam_jr.c | 8 +++----- drivers/crypto/caam_jr/caam_jr_log.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/crypto/caam_jr/caam_jr.c +3 -5
@@ -2346,7 +2346,7 @@ caam_jr_dev_init(const char *name,rte_cryptodev_pmd_probing_finish (dev); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , dev->data->name); +CAAM_JR_INFO ("%s cryptodev init\n" , dev->data->name);return 0 ;
@@ -2386,8 +2386,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) ret =of_init ();if (ret) { -RTE_LOG (ERR ,PMD , -"of_init failed\n" ); +CAAM_JR_ERR ("of_init failed\n" );return -EINVAL ; }/* if sec device version is not configured */
@@ -2407,8 +2406,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) }#ifdef RTE_LIBRTE_PMD_CAAM_JR_BE if (rta_get_sec_era () >RTA_SEC_ERA_8 ) { -RTE_LOG (ERR ,PMD , -"CAAM is compiled in BE mode for device with sec era > 8???\n" ); +CAAM_JR_ERR ("CAAM is compiled in BE mode for device with sec era > 8???\n" );return -EINVAL ; }#endif
drivers/crypto/caam_jr/caam_jr_log.h +1 -1
@@ -28,7 +28,7 @@ extern int caam_jr_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define CAAM_JR_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + rte_log_dp(RTE_LOG_ ## level, caam_jr_logtype, fmt "\n", ## args) #define CAAM_JR_DP_DEBUG(fmt, args...) \ CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
RE: [PATCH v3 34/37] crypto/caam_jr: replace logtype PMD
PATCH v3 35/37 crypto/ccp: do not use PMD logtype
In reply to Stephen HemmingerThis driver has logging macros but not used consistently.
--- drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/crypto/ccp/rte_ccp_pmd.c +6 -7
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev) ccp_pmd_init_done =0 ; -RTE_LOG (INFO ,PMD ,"Closing ccp device %s on numa socket %u\n" , - name,rte_socket_id ()); +CCP_LOG_INFO ("Closing ccp device %s on numa socket %u" , name,rte_socket_id ());return rte_cryptodev_pmd_destroy (dev); }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name, } cryptodev_cnt++; -CCP_LOG_DBG ("CCP : Crypto device count = %d\n" , cryptodev_cnt); +CCP_LOG_DBG ("CCP : Crypto device count = %d" , cryptodev_cnt); dev->device = &pci_dev->device; dev->device->driver = &pci_drv->driver; dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, };if (ccp_pmd_init_done) { -RTE_LOG (INFO ,PMD ,"CCP PMD already initialized\n" ); +CCP_LOG_INFO ("CCP PMD already initialized" );return -EFAULT ; }rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, init_params.def_p.max_nb_queue_pairs =CCP_PMD_MAX_QUEUE_PAIRS ; -RTE_LOG (INFO ,PMD ,"Initialising %s on NUMA node %d\n" , name, +CCP_LOG_INFO ("Initialising %s on NUMA node %d" , name, init_params.def_p.socket_id); -RTE_LOG (INFO ,PMD ,"Max number of queue pairs = %d\n" , +CCP_LOG_INFO ("Max number of queue pairs = %d" , init_params.def_p.max_nb_queue_pairs); -RTE_LOG (INFO ,PMD ,"Authentication offload to %s\n" , +CCP_LOG_INFO ("Authentication offload to %s" , ((init_params.auth_opt ==0 ) ?"CCP" :"CPU" ));rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
Signature · 1 line
2.43.0
PATCH v3 36/37 crypto/scheduler: replace use of logtype PMD
In reply to Stephen HemmingerDriver has logging macro but not used everywhere.
--- drivers/crypto/scheduler/scheduler_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/scheduler/scheduler_pmd.c +2 -2
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,return -EINVAL ; } -RTE_LOG (INFO ,PMD ," Sched mode param (%s = %s)\n" , - param_name, param_val); +CR_SCHED_LOG (INFO ," Sched mode param (%s = %s)\n" , + param_name, param_val); } }
Signature · 1 line
2.43.0
PATCH v3 37/37 crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype
In reply to Stephen HemmingerUse macro consistently for all logs and rte_log_dp() for datapath.
--- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++--- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 4 ++-- drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++-- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +3 -3
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_opr (dpseci,CMD_PRI_LOW , priv->token, qp_id,OPR_OPT_CREATE , &ocfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error setting opr: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error setting opr: ret: %d" , ret);return ret; } qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h +2 -2
@@ -29,7 +29,7 @@ extern int dpaa2_logtype_sec;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_SEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa2_logtype_sec, fmt, ## args) #define DPAA2_SEC_DP_DEBUG(fmt, args...) \ DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
@@ -38,7 +38,7 @@ extern int dpaa2_logtype_sec; #define DPAA2_SEC_DP_WARN(fmt, args...) \ DPAA2_SEC_DP_LOG(WARNING, fmt, ## args) #define DPAA2_SEC_DP_ERR(fmt, args...) \ - DPAA2_SEC_DP_LOG(ERR, fmt, ## args) + DPAA2_SEC_DP_LOG(ERR, fmt, ## args)#endif /* _DPAA2_SEC_LOGS_H_ */
drivers/crypto/dpaa_sec/dpaa_sec.c +2 -2
@@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,qman_oos_fq (&qp->outq); ret =qman_init_fq (&qp->outq,0 , &opts);if (ret) -RTE_LOG (ERR ,PMD ,"Error in qman_init_fq: ret: %d\n" , ret); +DPAA_SEC_ERR ("Error in qman_init_fq: ret: %d\n" , ret); qp->outq.cb.dqrr =NULL ;return ret;
@@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)dpaa_sec_get_devargs (cryptodev->device->devargs,DRIVER_DUMP_MODE ); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , cryptodev->data->name); +DPAA_SEC_INFO ("%s cryptodev init\n" , cryptodev->data->name);return 0 ; init_error:
drivers/crypto/dpaa_sec/dpaa_sec_log.h +1 -1
@@ -29,7 +29,7 @@ extern int dpaa_logtype_sec;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_SEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + rte_log_dp(RTE_LOG_ ## level, dpaa_logtype_sec, fmt, ## args) #define DPAA_SEC_DP_DEBUG(fmt, args...) \ DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
Signature · 1 line
2.43.0
RE: [PATCH v3 37/37] crypto/dpaa_sec, crypto/dpaa2_sec: replace use of PMD logtype
v4 cover Replace uses of RTE_LOGTYPE_PMD
In reply to Stephen HemmingerThe generic RTE_LOGTYPE_PMD is a leftover and should be removed. This replaces all uses in current tree. It leaves PMD logtype as deprecated because there maybe other uses in external projects leftover.
Depends-on: patch-135264 ("drivers: use dedicated logtypes")
Stephen Hemminger (17):
common/sfc_efx: remove use of PMD logtype mempool/dpaa2: use driver logtype not PMD net/dpaa: use dedicated logtype not PMD net/dpaa2: used dedicated logtype not PMD net/mvpp2: use dedicated logtype
net/vmxnet3: used dedicated logtype not PMD raw/cnxk: replace PMD logtype with dynamic type crypto/scheduler: replace use of logtype PMD crypto/ccp: do not use PMD logtype crypto/caam_jr: use dedicated logtype crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype event/dlb2: use dedicated logtype
event/dpaa, event/dpaa2: use dedicated logtype event/skeleton: replace logtype PMD with dynamic type net/nfb: use dynamic logtype examples/fips_validation: replace use of PMD logtype
log: mark PMD logtype as deprecated
drivers/common/cnxk/roc_platform.h | 16 ++++--- drivers/common/sfc_efx/sfc_efx.c | 11 +---- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 10 ++--- drivers/crypto/ccp/rte_ccp_pmd.c | 13 +++--- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +-- drivers/crypto/dpaa_sec/dpaa_sec.c | 4 +- drivers/crypto/scheduler/scheduler_pmd.c | 4 +- drivers/event/dlb2/dlb2.c | 5 +-- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +-- drivers/event/skeleton/skeleton_eventdev.c | 3 +- drivers/event/skeleton/skeleton_eventdev.h | 8 +++- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +- drivers/net/dpaa/dpaa_ethdev.c | 8 ++-- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +- drivers/net/nfb/nfb.h | 5 +++ drivers/net/nfb/nfb_ethdev.c | 24 +++++----- drivers/net/nfb/nfb_rx.c | 9 ++-- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 9 ++-- drivers/net/nfb/nfb_tx.h | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++------ drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 6 +++ drivers/raw/cnxk_gpio/cnxk_gpio.c | 21 ++++----- drivers/raw/cnxk_gpio/cnxk_gpio.h | 5 +++ drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++--- examples/fips_validation/fips_dev_self_test.c | 44 +++++++++---------- lib/log/log.c | 3 ++ lib/log/rte_log.h | 2 +- 36 files changed, 156 insertions(+), 147 deletions(-)
Signature · 1 line
2.43.0
PATCH v4 1/17 common/sfc_efx: remove use of PMD logtype
This code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers.
--- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/common/sfc_efx/sfc_efx.c +2 -9
@@ -15,7 +15,7 @@#include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,return rc; } -RTE_INIT (sfc_efx_register_logtype) -{ -int ret; - - ret =rte_log_register_type_and_pick_level ("pmd.common.sfc_efx" , -RTE_LOG_NOTICE ); - sfc_efx_logtype = (ret <0 ) ?RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT (sfc_efx_logtype,NOTICE );
drivers/common/sfc_efx/sfc_efx_log.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_EFX_LOG_H_/** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype;/** Log message, add a prefix and a line break */ #define SFC_EFX_LOG (level, ...) \
Signature · 1 line
2.43.0
PATCH v4 2/17 mempool/dpaa2: use driver logtype not PMD
In reply to Stephen HemmingerThe driver already has macros for logging, use them.
--- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_ERR ("DPAA2 buffer pool not configured" );return -ENOMEM ; }
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_ERR ("DPAA2 buffer pool not configured" );return NULL ; }
Signature · 1 line
2.43.0
PATCH v4 3/17 net/dpaa: use dedicated logtype not PMD
In reply to Stephen HemmingerThe driver already has a logtype, but was not used in couple places.
--- drivers/net/dpaa/dpaa_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +4 -4
@@ -2096,8 +2096,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* copy the primary mac address */ rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); -RTE_LOG (INFO ,PMD ,"net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n" , - dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr)); +DPAA_PMD_INFO ("net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT , + dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr));if (!fman_intf->is_shared_mac) {/* Configure error packet handling */
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, ret =dpaa_dev_init_secondary (eth_dev);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"secondary dev init failed\n" ); +DPAA_PMD_ERR ("secondary dev init failed" );return ret; }
@@ -2182,7 +2182,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,if (!(default_q || fmc_q)) {if (dpaa_fm_init ()) { -DPAA_PMD_ERR ("FM init failed\n" ); +DPAA_PMD_ERR ("FM init failed" );return -1 ; } }
Signature · 1 line
2.43.0
PATCH v4 4/17 net/dpaa2: used dedicated logtype not PMD
In reply to Stephen HemmingerThe driver has a logtype, but was not being used in one place.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)return ret; } } -RTE_LOG (INFO ,PMD ,"%s: netdev created, connected to %s\n" , +DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);return 0 ;
drivers/net/dpaa2/dpaa2_sparser.c +2 -2
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv, priv->ss_iova = (uint64_t )(DPAA2_VADDR_TO_IOVA (addr)); priv->ss_offset += sp_param.size; -RTE_LOG (INFO ,PMD ,"Soft parser loaded for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser loaded for dpni@%d" , priv->hw_id);rte_free (addr);return 0 ;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv, }rte_free (param_addr); -RTE_LOG (INFO ,PMD ,"Soft parser enabled for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser enabled for dpni@%d" , priv->hw_id);return 0 ; }
Signature · 1 line
2.43.0
PATCH v4 5/17 net/mvpp2: use dedicated logtype
In reply to Stephen HemmingerAlways use the dedicated logtype, not PMD.
--- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +2 -2
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)/* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (priv->multiseg) { -RTE_LOG (INFO ,PMD ,"Using multi-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using multi-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst; }else { -RTE_LOG (INFO ,PMD ,"Using single-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using single-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_pkt_burst; } }
Signature · 1 line
2.43.0
PATCH v4 6/17 net/vmxnet3: used dedicated logtype not PMD
In reply to Stephen HemmingerThe driver has log macros, just not used in one place.
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)if (events ==0 ) goto done; -RTE_LOG (DEBUG ,PMD ,"Reading events: 0x%X" , events); +PMD_DRV_LOG (DEBUG ,"Reading events: 0x%X" , events);vmxnet3_process_events (dev); done:vmxnet3_enable_intr (hw, *eventIntrIdx);
Signature · 1 line
2.43.0
PATCH v4 7/17 raw/cnxk: replace PMD logtype with dynamic type
In reply to Stephen HemmingerDriver should not be using PMD logtype, they should have their own logtype.
--- drivers/common/cnxk/roc_platform.h | 16 ++++++----- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 ++- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++----------- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 6 +++++ drivers/raw/cnxk_gpio/cnxk_gpio.c | 21 ++++++++------- drivers/raw/cnxk_gpio/cnxk_gpio.h | 5 ++++ drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++++------ 8 files changed, 57 insertions(+), 44 deletions(-)
drivers/common/cnxk/roc_platform.h +9 -7
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;extern int cnxk_logtype_ree;extern int cnxk_logtype_dpi; +#define RTE_LOGTYPE_CNXK cnxk_logtype_base + #define plt_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) -#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args) -#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) + RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args) +#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args) +#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)#define plt_dump (fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)#define plt_dump_no_nl (fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -296,11 +298,11 @@ extern int cnxk_logtype_dpi;/* Datapath logs */ #define plt_dp_err(fmt, args...) \ - RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) #define plt_dp_info(fmt, args...) \ - RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) #define plt_dp_dbg(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)#ifdef __cplusplus#define CNXK_PCI_ID (subsystem_dev, dev) \
drivers/raw/cnxk_bphy/cnxk_bphy.c +2 -1
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +CNXK_BPHY_LOG (ERR ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {RTE_PMD_REGISTER_PCI (bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);RTE_PMD_REGISTER_PCI_TABLE (bphy_rawdev_pci_driver, pci_bphy_map);RTE_PMD_REGISTER_KMOD_DEP (bphy_rawdev_pci_driver,"vfio-pci" ); +RTE_LOG_REGISTER_SUFFIX (cnxk_logtype_bphy, bphy,INFO );
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +CNXK_BPHY_LOG (WARNING ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c +15 -16
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)if (ret)break ;if (descs !=1 ) { -RTE_LOG (ERR ,PMD ,"Wrong number of descs reported\n" ); +CNXK_BPHY_LOG (ERR ,"Wrong number of descs reported" ); ret = -ENODEV ;break ; } -RTE_LOG (INFO ,PMD ,"Testing queue %d\n" , i); +CNXK_BPHY_LOG (INFO ,"Testing queue %d" , i); ret =rte_pmd_bphy_cgx_stop_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to stop rx/tx\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to stop rx/tx" );break ; } ret =rte_pmd_bphy_cgx_start_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to start rx/tx\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to start rx/tx" );break ; } ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, false);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link down\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to set link down" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,0 );if (ret !=0 ) -RTE_LOG (ERR ,PMD , -"Timed out waiting for a link down\n" ); +CNXK_BPHY_LOG (ERR ,"Timed out waiting for a link down" ); ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, true);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link up\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to set link up" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,1 );if (ret !=1 ) -RTE_LOG (ERR ,PMD ,"Timed out waiting for a link up\n" ); +CNXK_BPHY_LOG (ERR ,"Timed out waiting for a link up" ); ret =rte_pmd_bphy_cgx_intlbk_enable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to enable internal lbk\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to enable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_intlbk_disable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable internal lbk\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_ptp_rx_enable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to enable ptp\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to enable ptp" );break ; } ret =0 ;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) ret =rte_pmd_bphy_cgx_ptp_rx_disable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to disable ptp\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable ptp" );break ; } ret =0 ; ret =rte_pmd_bphy_cgx_get_supported_fec (dev_id, i, &fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to get supported FEC\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to get supported FEC" );break ; } ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set FEC to %d\n" , fec); +CNXK_BPHY_LOG (ERR ,"Failed to set FEC to %d" , fec);break ; } fec =CNXK_BPHY_CGX_ETH_LINK_FEC_NONE ; ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable FEC\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable FEC" );break ; } }
drivers/raw/cnxk_bphy/rte_pmd_bphy.h +6 -0
@@ -26,6 +26,12 @@ extern "C" { #endif +extern int cnxk_logtype_bphy; + +#define CNXK_BPHY_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \ + "%s(): " fmt "\n", __func__, ## args) + /** Available message types */ enum cnxk_bphy_cgx_msg_type { /** Type used to obtain link information */
drivers/raw/cnxk_gpio/cnxk_gpio.c +11 -10
@@ -215,13 +215,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist) errno =0 ; val =strtol (token,NULL ,10 );if (errno) { -RTE_LOG (ERR ,PMD ,"failed to parse %s\n" , token); +CNXK_GPIO_LOG (ERR ,"failed to parse %s" , token); ret = -errno; goto out; }if (val <0 || val >= gpiochip->num_gpios) { -RTE_LOG (ERR ,PMD ,"gpio%d out of 0-%d range\n" , val, +CNXK_GPIO_LOG (ERR ,"gpio%d out of 0-%d range" , val, gpiochip->num_gpios -1 ); ret = -EINVAL ; goto out;
@@ -231,7 +231,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)if (list[i] != val)continue ; -RTE_LOG (WARNING ,PMD ,"gpio%d already allowed\n" , val); +CNXK_GPIO_LOG (WARNING ,"gpio%d already allowed" , val);break ; }if (i == queue)
@@ -398,7 +398,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,return ret; } }else { -RTE_LOG (WARNING ,PMD ,"using existing gpio%d\n" , gpio->num); +CNXK_GPIO_LOG (WARNING ,"using existing gpio%d" , gpio->num); } gpiochip->gpios[num] = gpio;
@@ -647,7 +647,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)/* get rid of last response if any */ if (gpio->rsp) { -RTE_LOG (WARNING ,PMD ,"previous response got overwritten\n" ); +CNXK_GPIO_LOG (WARNING ,"previous response got overwritten" );rte_free (gpio->rsp); } gpio->rsp = rsp;
@@ -741,7 +741,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)cnxk_gpio_format_name (name,sizeof (name)); rawdev =rte_rawdev_pmd_allocate (name,sizeof (*gpiochip),rte_socket_id ());if (!rawdev) { -RTE_LOG (ERR ,PMD ,"failed to allocate %s rawdev\n" , name); +CNXK_GPIO_LOG (ERR ,"failed to allocate %s rawdev" , name);return -ENOMEM ; }
@@ -770,7 +770,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/base" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->base);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_GPIO_LOG (ERR ,"failed to read %s" , buf); goto out; }
@@ -778,20 +778,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/ngpio" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->num_gpios);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_GPIO_LOG (ERR ,"failed to read %s" , buf); goto out; } gpiochip->num_queues = gpiochip->num_gpios; ret =cnxk_gpio_parse_allowlist (gpiochip, params->allowlist);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to parse allowed gpios\n" ); +CNXK_GPIO_LOG (ERR ,"failed to parse allowed gpios" ); goto out; } gpiochip->gpios =rte_calloc (NULL , gpiochip->num_gpios,sizeof (struct cnxk_gpio *),0 );if (!gpiochip->gpios) { -RTE_LOG (ERR ,PMD ,"failed to allocate gpios memory\n" ); +CNXK_GPIO_LOG (ERR ,"failed to allocate gpios memory" ); ret = -ENOMEM ; goto out; }
@@ -851,3 +851,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);RTE_PMD_REGISTER_PARAM_STRING (cnxk_gpio,"gpiochip=<int> " "allowlist=<list>" ); +RTE_LOG_REGISTER_SUFFIX (cnxk_logtype_gpio, gpio,INFO );
drivers/raw/cnxk_gpio/cnxk_gpio.h +5 -0
@@ -5,6 +5,11 @@#ifndef _CNXK_GPIO_H_#define _CNXK_GPIO_H_ +extern int cnxk_logtype_gpio; + +#define CNXK_GPIO_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args) +struct cnxk_gpiochip ; struct cnxk_gpio {
drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c +8 -9
@@ -56,7 +56,7 @@ cnxk_gpio_read_attr(char *attr, char *val)#define CNXK_GPIO_ERR_STR (err, str, ...) do { \ if (err) { \ - RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \ + CNXK_GPIO_LOG(ERR, "%s:%d: " str " (%d)", __func__, __LINE__, \ ##__VA_ARGS__, err); \ goto out; \ } \
@@ -330,30 +330,29 @@ cnxk_gpio_selftest(uint16_t dev_id)for (i =0 ; i < queues; i++) { ret =rte_rawdev_queue_conf_get (dev_id, i, &conf,sizeof (conf));if (ret) { -RTE_LOG (ERR ,PMD , -"failed to read queue configuration (%d)\n" , +CNXK_GPIO_LOG (ERR ,"failed to read queue configuration (%d)" , ret); goto out; } -RTE_LOG (INFO ,PMD ,"testing queue%d (gpio%d)\n" , i, conf.gpio); +CNXK_GPIO_LOG (INFO ,"testing queue%d (gpio%d)" , i, conf.gpio);if (conf.size !=1 ) { -RTE_LOG (ERR ,PMD ,"wrong queue size received\n" ); +CNXK_GPIO_LOG (ERR ,"wrong queue size received" ); ret = -EIO ; goto out; } ret =rte_rawdev_queue_setup (dev_id, i,NULL ,0 );if (ret) { -RTE_LOG (ERR ,PMD ,"failed to setup queue (%d)\n" , ret); +CNXK_GPIO_LOG (ERR ,"failed to setup queue (%d)" , ret); goto out; } gpio = gpiochip->gpios[conf.gpio];snprintf (buf,sizeof (buf),CNXK_GPIO_PATH_FMT , gpio->num);if (!cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s does not exist\n" , buf); +CNXK_GPIO_LOG (ERR ,"%s does not exist" , buf); ret = -ENOENT ; goto release; }
@@ -371,13 +370,13 @@ cnxk_gpio_selftest(uint16_t dev_id) ret2 = ret; ret =rte_rawdev_queue_release (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to release queue (%d)\n" , +CNXK_GPIO_LOG (ERR ,"failed to release queue (%d)" , ret);break ; }if (cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s still exists\n" , buf); +CNXK_GPIO_LOG (ERR ,"%s still exists" , buf); ret = -EIO ;break ; }
Signature · 1 line
2.43.0
Re: [PATCH v4 07/17] raw/cnxk: replace PMD logtype with dynamic type
Quoted 5 lines · Stephen Hemminger
Driver should not be using PMD logtype, they should have their own logtype.
Signed-off-by Stephen Hemminger <[email protected]>
[snip]
\
drivers/raw/cnxk_bphy/cnxk_bphy.c cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev, · line 254
Quoted 10 lines
drivers/raw/cnxk_bphy/cnxk_bphy.c +1
-1@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +CNXK_BPHY_LOG (ERR ,"Previous response got overwritten" );
This level change is unrelated to $SUBJECT.
Quoted 3 lines
drivers/raw/cnxk_bphy/cnxk_bphy.c +0
-0rte_free (qp->rsp); } qp->rsp = rsp;
Signature · 1 line
David Marchand
PATCH v4 8/17 crypto/scheduler: replace use of logtype PMD
In reply to Stephen HemmingerDriver has logging macro but not used everywhere.
--- drivers/crypto/scheduler/scheduler_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/scheduler/scheduler_pmd.c +2 -2
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,return -EINVAL ; } -RTE_LOG (INFO ,PMD ," Sched mode param (%s = %s)\n" , - param_name, param_val); +CR_SCHED_LOG (INFO ," Sched mode param (%s = %s)\n" , + param_name, param_val); } }
Signature · 1 line
2.43.0
Re: [PATCH v4 08/17] crypto/scheduler: replace use of logtype PMD
Quoted 14 lines · Stephen Hemminger
Driver has logging macro but not used everywhere.
Fixes 6760463c9f26 ("crypto/scheduler: add mode-specific threshold parameter")Signed-off-by Stephen Hemminger <[email protected]>--- drivers/crypto/scheduler/scheduler_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/crypto/scheduler/scheduler_pmd.c +0
-0
drivers/crypto/scheduler/scheduler_pmd.c cryptodev_scheduler_create(const char *name, · line 203
Quoted 9 lines
drivers/crypto/scheduler/scheduler_pmd.c +2
-2@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,return -EINVAL ; } -RTE_LOG (INFO ,PMD ," Sched mode param (%s = %s)\n" , - param_name, param_val); +CR_SCHED_LOG (INFO ," Sched mode param (%s = %s)\n" , + param_name, param_val); } }
No \n please.
Signature · 1 line
David Marchand
PATCH v4 9/17 crypto/ccp: do not use PMD logtype
In reply to Stephen HemmingerThis driver has logging macros but not used consistently.
--- drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/crypto/ccp/rte_ccp_pmd.c +6 -7
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev) ccp_pmd_init_done =0 ; -RTE_LOG (INFO ,PMD ,"Closing ccp device %s on numa socket %u\n" , - name,rte_socket_id ()); +CCP_LOG_INFO ("Closing ccp device %s on numa socket %u" , name,rte_socket_id ());return rte_cryptodev_pmd_destroy (dev); }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name, } cryptodev_cnt++; -CCP_LOG_DBG ("CCP : Crypto device count = %d\n" , cryptodev_cnt); +CCP_LOG_DBG ("CCP : Crypto device count = %d" , cryptodev_cnt); dev->device = &pci_dev->device; dev->device->driver = &pci_drv->driver; dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, };if (ccp_pmd_init_done) { -RTE_LOG (INFO ,PMD ,"CCP PMD already initialized\n" ); +CCP_LOG_INFO ("CCP PMD already initialized" );return -EFAULT ; }rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, init_params.def_p.max_nb_queue_pairs =CCP_PMD_MAX_QUEUE_PAIRS ; -RTE_LOG (INFO ,PMD ,"Initialising %s on NUMA node %d\n" , name, +CCP_LOG_INFO ("Initialising %s on NUMA node %d" , name, init_params.def_p.socket_id); -RTE_LOG (INFO ,PMD ,"Max number of queue pairs = %d\n" , +CCP_LOG_INFO ("Max number of queue pairs = %d" , init_params.def_p.max_nb_queue_pairs); -RTE_LOG (INFO ,PMD ,"Authentication offload to %s\n" , +CCP_LOG_INFO ("Authentication offload to %s" , ((init_params.auth_opt ==0 ) ?"CCP" :"CPU" ));rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
Signature · 1 line
2.43.0
PATCH v4 10/17 crypto/caam_jr: use dedicated logtype
In reply to Stephen HemmingerThe driver has macro and logtype but not used in a couple places.
--- drivers/crypto/caam_jr/caam_jr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/crypto/caam_jr/caam_jr.c +4 -6
@@ -309,7 +309,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) cdb =caam_jr_dma_mem_alloc (L1_CACHE_BYTES ,sizeof (struct sec_cdb ));if (!cdb) { -CAAM_JR_ERR ("failed to allocate memory for cdb\n" ); +CAAM_JR_ERR ("failed to allocate memory for cdb" );return -1 ; }
@@ -2346,7 +2346,7 @@ caam_jr_dev_init(const char *name,rte_cryptodev_pmd_probing_finish (dev); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , dev->data->name); +CAAM_JR_INFO ("%s cryptodev init\n" , dev->data->name);return 0 ;
@@ -2386,8 +2386,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) ret =of_init ();if (ret) { -RTE_LOG (ERR ,PMD , -"of_init failed\n" ); +CAAM_JR_ERR ("of_init failed\n" );return -EINVAL ; }/* if sec device version is not configured */
@@ -2407,8 +2406,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) }#ifdef RTE_LIBRTE_PMD_CAAM_JR_BE if (rta_get_sec_era () >RTA_SEC_ERA_8 ) { -RTE_LOG (ERR ,PMD , -"CAAM is compiled in BE mode for device with sec era > 8???\n" ); +CAAM_JR_ERR ("CAAM is compiled in BE mode for device with sec era > 8???\n" );return -EINVAL ; }#endif
Signature · 1 line
2.43.0
Re: [PATCH v4 10/17] crypto/caam_jr: use dedicated logtype
Quoted 5 lines · Stephen Hemminger
The driver has macro and logtype but not used in a couple places.
Fixes af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver")Signed-off-by Stephen Hemminger <[email protected]>
CAAM_JR log macros add a \n, please remove them from the format strings when converting.
Signature · 1 line
David Marchand
PATCH v4 11/17 crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
In reply to Stephen HemmingerA couple of messages were using RTE_LOGTYPE_PMD when dedicated logtype was already available.
--- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++--- drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +3 -3
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_opr (dpseci,CMD_PRI_LOW , priv->token, qp_id,OPR_OPT_CREATE , &ocfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error setting opr: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error setting opr: ret: %d" , ret);return ret; } qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
drivers/crypto/dpaa_sec/dpaa_sec.c +2 -2
@@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,qman_oos_fq (&qp->outq); ret =qman_init_fq (&qp->outq,0 , &opts);if (ret) -RTE_LOG (ERR ,PMD ,"Error in qman_init_fq: ret: %d\n" , ret); +DPAA_SEC_ERR ("Error in qman_init_fq: ret: %d\n" , ret); qp->outq.cb.dqrr =NULL ;return ret;
@@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)dpaa_sec_get_devargs (cryptodev->device->devargs,DRIVER_DUMP_MODE ); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , cryptodev->data->name); +DPAA_SEC_INFO ("%s cryptodev init\n" , cryptodev->data->name);return 0 ; init_error:
Signature · 1 line
2.43.0
Re: [PATCH v4 11/17] crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
Quoted 14 lines · Stephen Hemminger
drivers/crypto/dpaa_sec/dpaa_sec.c +1
-1@@ -3518,7 +3518,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,qman_oos_fq (&qp->outq); ret =qman_init_fq (&qp->outq,0 , &opts);if (ret) -RTE_LOG (ERR ,PMD ,"Error in qman_init_fq: ret: %d\n" , ret); +DPAA_SEC_ERR ("Error in qman_init_fq: ret: %d\n" , ret); qp->outq.cb.dqrr =NULL ;return ret;
drivers/crypto/dpaa_sec/dpaa_sec.c dpaa_sec_dev_init(struct rte_cryptodev *cryptodev) · line 3715
Quoted 8 lines
drivers/crypto/dpaa_sec/dpaa_sec.c +1
-1@@ -3709,7 +3709,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)dpaa_sec_get_devargs (cryptodev->device->devargs,DRIVER_DUMP_MODE ); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , cryptodev->data->name); +DPAA_SEC_INFO ("%s cryptodev init\n" , cryptodev->data->name);return 0 ; init_error:
No \n please, DPAA_SEC* log macros add one.
Signature · 1 line
David Marchand
PATCH v4 12/17 event/dlb2: use dedicated logtype
In reply to Stephen HemmingerDriver was using RTE_LOGTYPE_PMD when it had its own logtype.
--- drivers/event/dlb2/dlb2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/event/dlb2/dlb2.c +2 -3
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,struct rte_kvargs *kvlist =rte_kvargs_parse (params, args);if (kvlist ==NULL ) { -RTE_LOG (INFO ,PMD , -"Ignoring unsupported parameters when creating device '%s'\n" , - name); +DLB2_LOG_INFO ("Ignoring unsupported parameters when creating device '%s'\n" , + name); }else { int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG, set_numa_node,
Signature · 1 line
2.43.0
Re: [PATCH v4 12/17] event/dlb2: use dedicated logtype
Quoted 15 lines · Stephen Hemminger
Driver was using
RTE_LOGTYPE_PMDwhen it had its own logtype.Fixes 5433956d5185 ("event/dlb2: add eventdev probe")Signed-off-by Stephen Hemminger <[email protected]>--- drivers/event/dlb2/dlb2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/event/dlb2/dlb2.c +0
-0@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,struct rte_kvargs *kvlist =rte_kvargs_parse (params, args);
drivers/event/dlb2/dlb2.c dlb2_parse_params(const char *params, · line 4748
Quoted 10 lines
drivers/event/dlb2/dlb2.c +2
-3if (kvlist ==NULL ) { -RTE_LOG (INFO ,PMD , -"Ignoring unsupported parameters when creating device '%s'\n" , - name); +DLB2_LOG_INFO ("Ignoring unsupported parameters when creating device '%s'\n" , + name); }else { int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG, set_numa_node,
No \n please.
Signature · 1 line
David Marchand
PATCH v4 13/17 event/dpaa, event/dpaa2: use dedicated logtype
In reply to Stephen HemmingerDo not use RTE_LOGTYPE_PMD.
--- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 ++-- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/event/dpaa/dpaa_eventdev.c +1 -1
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue; eventdev->txa_enqueue_same_dest = dpaa_eventdev_txa_enqueue_same_dest; -RTE_LOG (INFO ,PMD ,"%s eventdev added" , name); +DPAA_EVENTDEV_INFO ("%s eventdev added" , name);/* For secondary processes, the primary has done all the work */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/event/dpaa2/dpaa2_eventdev.c +2 -2
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev) priv->max_event_queues++; }while (dpcon_dev && dpci_dev); -RTE_LOG (INFO ,PMD ,"%s eventdev created\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev created" , name); done:event_dev_probing_finish (eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name) } priv->max_event_queues =0 ; -RTE_LOG (INFO ,PMD ,"%s eventdev cleaned\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev cleaned" , name);return 0 ; }
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +3 -3
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void), int (*test)(void), const char *name) {if (setup () <0 ) { -RTE_LOG (INFO ,PMD ,"Error setting up test %s" , name); +DPAA2_EVENTDEV_INFO ("Error setting up test %s" , name); unsupported++; }else {if (test () <0 ) { failed++; -RTE_LOG (INFO ,PMD ,"%s Failed\n" , name); +DPAA2_EVENTDEV_INFO ("%s Failed" , name); }else { passed++; -RTE_LOG (INFO ,PMD ,"%s Passed" , name); +DPAA2_EVENTDEV_INFO ("%s Passed" , name); } }
Signature · 1 line
2.43.0
PATCH v4 14/17 event/skeleton: replace logtype PMD with dynamic type
In reply to Stephen HemmingerThe skeleton is supposed to match current best practices. Change it to use dynamic logtype.
--- drivers/event/skeleton/skeleton_eventdev.c | 3 ++- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/event/skeleton/skeleton_eventdev.c +2 -1
@@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)const char *name; name =rte_vdev_device_name (vdev); -RTE_LOG (INFO ,PMD ,"Initializing %s on NUMA node %d\n" , name, +PMD_DRV_LOG (INFO ,"Initializing %s on NUMA node %d\n" , name,rte_socket_id ());return skeleton_eventdev_create (name,rte_socket_id (), vdev); }
@@ -479,3 +479,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = { };RTE_PMD_REGISTER_VDEV (EVENTDEV_NAME_SKELETON_PMD , vdev_eventdev_skeleton_pmd); +RTE_LOG_REGISTER_DEFAULT (skeleton_eventdev_logtype,INFO );
drivers/event/skeleton/skeleton_eventdev.h +6 -2
@@ -8,9 +8,12 @@#include <eventdev_pmd_pci.h> #include <eventdev_pmd_vdev.h> +extern int skeleton_eventdev_logtype; +#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)#define PMD_DRV_FUNC_TRACE () PMD_DRV_LOG(DEBUG, ">>")#else #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@#endif #define PMD_DRV_ERR(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)struct skeleton_eventdev {uintptr_t reg_base;
Signature · 1 line
2.43.0
Re: [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type
Quoted 15 lines · Stephen Hemminger
The skeleton is supposed to match current best practices. Change it to use dynamic logtype.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/event/skeleton/skeleton_eventdev.c | 3 ++- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)drivers/event/skeleton/skeleton_eventdev.c +0
-0
drivers/event/skeleton/skeleton_eventdev.c skeleton_eventdev_probe(struct rte_vdev_device *vdev) · line 463
Quoted 8 lines
drivers/event/skeleton/skeleton_eventdev.c +1
-1@@ -457,7 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)const char *name; name =rte_vdev_device_name (vdev); -RTE_LOG (INFO ,PMD ,"Initializing %s on NUMA node %d\n" , name, +PMD_DRV_LOG (INFO ,"Initializing %s on NUMA node %d\n" , name,rte_socket_id ());return skeleton_eventdev_create (name,rte_socket_id (), vdev); }
No \n please.
Signature · 1 line
David Marchand
PATCH v4 15/17 net/nfb: use dynamic logtype
In reply to Stephen HemmingerAll drivers should be using dynamic logtype.
--- drivers/net/nfb/nfb.h | 5 +++++ drivers/net/nfb/nfb_ethdev.c | 24 ++++++++++-------------- drivers/net/nfb/nfb_rx.c | 9 ++++----- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 9 ++++----- drivers/net/nfb/nfb_tx.h | 2 +- 6 files changed, 25 insertions(+), 26 deletions(-)
drivers/net/nfb/nfb.h +5 -0
@@ -12,6 +12,11 @@#include <netcope/rxmac.h> #include <netcope/txmac.h> +extern int nfb_logtype; +#define NFB_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \ + __func__, ## args) +#include "nfb_rx.h" #include "nfb_tx.h"
drivers/net/nfb/nfb_ethdev.c +10 -14
@@ -12,11 +12,9 @@#include <ethdev_pci.h> #include <rte_kvargs.h> +#include "nfb.h" #include "nfb_stats.h" -#include "nfb_rx.h" -#include "nfb_tx.h" #include "nfb_rxmode.h" -#include "nfb.h" /** * Default MAC addr
@@ -192,8 +190,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) (&nfb_timestamp_dynfield_offset, &nfb_timestamp_rx_dynflag);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"Cannot register Rx timestamp" -" field/flag %d\n" , ret); +NFB_LOG (ERR ,"Cannot register Rx timestamp field/flag %d" , ret);nfb_close (internals->nfb);return -rte_errno; }
@@ -520,7 +517,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)struct rte_ether_addr eth_addr_init;struct rte_kvargs *kvlist; -RTE_LOG (INFO ,PMD ,"Initializing NFB device (" PCI_PRI_FMT ")\n" , +NFB_LOG (INFO ,"Initializing NFB device (" PCI_PRI_FMT ")" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -536,7 +533,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) kvlist =rte_kvargs_parse (dev->device->devargs->args,VALID_KEYS );if (kvlist ==NULL ) { -RTE_LOG (ERR ,PMD ,"Failed to parse device arguments %s" , +NFB_LOG (ERR ,"Failed to parse device arguments %s" , dev->device->devargs->args);rte_kvargs_free (kvlist);return -EINVAL ;
@@ -551,14 +548,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)*/ internals->nfb =nfb_open (internals->nfb_dev);if (internals->nfb ==NULL ) { -RTE_LOG (ERR ,PMD ,"nfb_open(): failed to open %s" , +NFB_LOG (ERR ,"nfb_open(): failed to open %s" , internals->nfb_dev);return -EINVAL ; } data->nb_rx_queues =ndp_get_rx_queue_available_count (internals->nfb); data->nb_tx_queues =ndp_get_tx_queue_available_count (internals->nfb); -RTE_LOG (INFO ,PMD ,"Available NDP queues RX: %u TX: %u\n" , +NFB_LOG (INFO ,"Available NDP queues RX: %u TX: %u\n" , data->nb_rx_queues, data->nb_tx_queues); nfb_nc_rxmac_init(internals->nfb,
@@ -583,7 +580,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) data->mac_addrs =rte_zmalloc (data->name,sizeof (struct rte_ether_addr ) * mac_count,RTE_CACHE_LINE_SIZE );if (data->mac_addrs ==NULL ) { -RTE_LOG (ERR ,PMD ,"Could not alloc space for MAC address!\n" ); +NFB_LOG (ERR ,"Could not alloc space for MAC address" );nfb_close (internals->nfb);return -EINVAL ; }
@@ -601,8 +598,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) dev->data->dev_flags |=RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; -RTE_LOG (INFO ,PMD ,"NFB device (" -PCI_PRI_FMT ") successfully initialized\n" , +NFB_LOG (INFO ,"NFB device (" PCI_PRI_FMT ") successfully initialized" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -626,8 +622,7 @@ nfb_eth_dev_uninit(struct rte_eth_dev *dev)nfb_eth_dev_close (dev); -RTE_LOG (INFO ,PMD ,"NFB device (" -PCI_PRI_FMT ") successfully uninitialized\n" , +NFB_LOG (INFO ,"NFB device (" PCI_PRI_FMT ") successfully uninitialized" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -690,3 +685,4 @@ static struct rte_pci_driver nfb_eth_driver = {RTE_PMD_REGISTER_PCI (RTE_NFB_DRIVER_NAME , nfb_eth_driver);RTE_PMD_REGISTER_PCI_TABLE (RTE_NFB_DRIVER_NAME , nfb_pci_id_table);RTE_PMD_REGISTER_KMOD_DEP (RTE_NFB_DRIVER_NAME ,"* nfb" ); +RTE_LOG_REGISTER_DEFAULT (nfb_logtype,NOTICE );
drivers/net/nfb/nfb_rx.c +4 -5
@@ -6,7 +6,6 @@#include <rte_kvargs.h> -#include "nfb_rx.h" #include "nfb.h" uint64_t nfb_timestamp_rx_dynflag;
@@ -19,7 +18,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)int ret;if (rxq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -40,7 +39,7 @@ nfb_eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rxq_id)int ret;if (rxq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -70,8 +69,8 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev, RTE_CACHE_LINE_SIZE, socket_id);if (rxq ==NULL ) { -RTE_LOG (ERR ,PMD ,"rte_zmalloc_socket() failed for rx queue id " -"%" PRIu16"!\n" , rx_queue_id); +NFB_LOG (ERR ,"rte_zmalloc_socket() failed for rx queue id %" PRIu16, + rx_queue_id);return -ENOMEM ; }
drivers/net/nfb/nfb_rx.h +1 -1
@@ -156,7 +156,7 @@ nfb_eth_ndp_rx(void *queue,struct rte_mbuf *mbufs[nb_pkts];if (unlikely (ndp->queue ==NULL || nb_pkts ==0 )) { -RTE_LOG (ERR ,PMD ,"RX invalid arguments!\n" ); +NFB_LOG (ERR ,"RX invalid arguments" );return 0 ; }
drivers/net/nfb/nfb_tx.c +4 -5
@@ -4,7 +4,6 @@* All rights reserved. */ -#include "nfb_tx.h" #include "nfb.h" int
@@ -14,7 +13,7 @@ nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)int ret;if (txq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -35,7 +34,7 @@ nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)int ret;if (txq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"TX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"TX NDP queue is NULL" );return -EINVAL ; }
@@ -62,8 +61,8 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev, RTE_CACHE_LINE_SIZE, socket_id);if (txq ==NULL ) { -RTE_LOG (ERR ,PMD ,"rte_zmalloc_socket() failed for tx queue id " -"%" PRIu16"!\n" , tx_queue_id); +NFB_LOG (ERR ,"rte_zmalloc_socket() failed for tx queue id %" PRIu16, + tx_queue_id);return -ENOMEM ; }
drivers/net/nfb/nfb_tx.h +1 -1
@@ -140,7 +140,7 @@ nfb_eth_ndp_tx(void *queue,return 0 ;if (unlikely (ndp->queue ==NULL )) { -RTE_LOG (ERR ,PMD ,"TX invalid arguments!\n" ); +NFB_LOG (ERR ,"TX invalid arguments" );return 0 ; }
Signature · 1 line
2.43.0
PATCH v4 16/17 examples/fips_validation: replace use of PMD logtype
In reply to Stephen HemmingerReplace PMD with USER1 since that is already used in main
--- examples/fips_validation/fips_dev_self_test.c | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-)
examples/fips_validation/fips_dev_self_test.c +22 -22
@@ -1032,7 +1032,7 @@ prepare_cipher_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1040,7 +1040,7 @@ prepare_cipher_xform(uint8_t dev_id,if (rte_cryptodev_sym_capability_check_cipher (cap, cipher_xform->key.length, cipher_xform->iv.length) !=0 ) { -RTE_LOG (ERR ,PMD ,"PMD %s key length %u IV length %u\n" , +RTE_LOG (ERR ,USER1 ,"PMD %s key length %u IV length %u\n" ,rte_cryptodev_name_get (dev_id), cipher_xform->key.length, cipher_xform->iv.length);
@@ -1088,7 +1088,7 @@ prepare_auth_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1096,7 +1096,7 @@ prepare_auth_xform(uint8_t dev_id,if (rte_cryptodev_sym_capability_check_auth (cap, auth_xform->key.length, auth_xform->digest_length,0 ) !=0 ) { -RTE_LOG (ERR ,PMD ,"PMD %s key length %u Digest length %u\n" , +RTE_LOG (ERR ,USER1 ,"PMD %s key length %u Digest length %u\n" ,rte_cryptodev_name_get (dev_id), auth_xform->key.length, auth_xform->digest_length);
@@ -1147,7 +1147,7 @@ prepare_aead_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1156,7 +1156,7 @@ prepare_aead_xform(uint8_t dev_id, aead_xform->key.length, aead_xform->digest_length, aead_xform->aad_length, aead_xform->iv.length) != 0) { - RTE_LOG(ERR, PMD, + RTE_LOG(ERR, USER1, "PMD %s key_len %u tag_len %u aad_len %u iv_len %u\n", rte_cryptodev_name_get(dev_id), aead_xform->key.length,
@@ -1195,7 +1195,7 @@ prepare_cipher_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf, len);if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1219,7 +1219,7 @@ prepare_auth_op(struct rte_crypto_op *op,uint8_t *dst;if (vec->input.len + vec->digest.len >RTE_MBUF_MAX_NB_SEGS ) { -RTE_LOG (ERR ,PMD ,"Error %i: Test data too long (%u).\n" , +RTE_LOG (ERR ,USER1 ,"Error %i: Test data too long (%u).\n" , -ENOMEM , vec->input.len + vec->digest.len);return -ENOMEM ; }
@@ -1229,7 +1229,7 @@ prepare_auth_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf, vec->input.len + vec->digest.len);if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1274,7 +1274,7 @@ prepare_aead_op(struct rte_crypto_op *op,memcpy (iv, vec->iv.data, vec->iv.len);if (len + vec->digest.len >RTE_MBUF_MAX_NB_SEGS ) { -RTE_LOG (ERR ,PMD ,"Error %i: Test data too long (%u).\n" , +RTE_LOG (ERR ,USER1 ,"Error %i: Test data too long (%u).\n" , -ENOMEM , len + vec->digest.len);return -ENOMEM ; }
@@ -1282,7 +1282,7 @@ prepare_aead_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf,RTE_ALIGN_CEIL (len + vec->digest.len,16 ));if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1303,7 +1303,7 @@ prepare_aead_op(struct rte_crypto_op *op, dst =rte_malloc (NULL , len,16 );if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: Not enough memory\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: Not enough memory\n" , -ENOMEM );return -ENOMEM ; }
@@ -1474,24 +1474,24 @@ run_single_test(uint8_t dev_id, ret = test_ops->prepare_xform (dev_id, &xform, vec, dir, key, negative_test);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Error %i: Prepare Xform\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Prepare Xform\n" , ret);return ret; } sess =rte_cryptodev_sym_session_create (dev_id, &xform, env->sess_pool);if (!sess) { -RTE_LOG (ERR ,PMD ,"Error %i: Init session\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Init session\n" , ret);return ret; } ret = test_ops->prepare_op (env->op, env->mbuf, sess, dir, vec);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Error %i: Prepare op\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Prepare op\n" , ret);return ret; }if (rte_cryptodev_enqueue_burst (dev_id,0 , &env->op,1 ) <1 ) { -RTE_LOG (ERR ,PMD ,"Error: Failed enqueue\n" ); +RTE_LOG (ERR ,USER1 ,"Error: Failed enqueue\n" );return ret; }
@@ -1622,7 +1622,7 @@ fips_dev_self_test(uint8_t dev_id, ret =fips_dev_auto_test_init (dev_id, &env);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Failed to init self-test for PMD %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to init self-test for PMD %u\n" , dev_id);return ret; }
@@ -1644,7 +1644,7 @@ fips_dev_self_test(uint8_t dev_id, negative_test =0 ; } - RTE_LOG(INFO, PMD, "Testing (ID %u) %s %s%s...\n", + RTE_LOG(INFO, USER1, "Testing (ID %u) %s %s%s...\n", i, vec->name, j == self_test_dir_enc_auth_gen ?
@@ -1658,18 +1658,18 @@ fips_dev_self_test(uint8_t dev_id,if (!negative_test)break ; ret =-1 ; -RTE_LOG (ERR ,PMD ,"PMD %u Failed test %s %s\n" , +RTE_LOG (ERR ,USER1 ,"PMD %u Failed test %s %s\n" , dev_id, vec->name, j == self_test_dir_enc_auth_gen ?"Encrypt" :"Decrypt" ); goto error_exit;case -EACCES : -RTE_LOG (ERR ,PMD ,"Not supported by %s. Skip\n" , +RTE_LOG (ERR ,USER1 ,"Not supported by %s. Skip\n" ,rte_cryptodev_name_get (dev_id)); ret =0 ;break ;default : -RTE_LOG (ERR ,PMD ,"PMD %u Failed test %s %s\n" , +RTE_LOG (ERR ,USER1 ,"PMD %u Failed test %s %s\n" , dev_id, vec->name, j == self_test_dir_enc_auth_gen ?"Encrypt" :"Decrypt" );
@@ -1682,7 +1682,7 @@ fips_dev_self_test(uint8_t dev_id,fips_dev_auto_test_uninit (dev_id, &env);if (ret ==0 ) { -RTE_LOG (INFO ,PMD ,"PMD %u finished self-test successfully\n" , +RTE_LOG (INFO ,USER1 ,"PMD %u finished self-test successfully\n" , dev_id); }
Signature · 1 line
2.43.0
PATCH v4 17/17 log: mark PMD logtype as deprecated
In reply to Stephen HemmingerThis is temporary patch to help find all misue use of PMD logtype
--- lib/log/log.c | 3 +++ lib/log/rte_log.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
lib/log/log.c +3 -0
@@ -352,6 +352,9 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, +/* avoid deprecated warning */ +#undef RTE_LOGTYPE_PMD +#define RTE_LOGTYPE_PMD 5 {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_PORT ,"lib.port" }, {RTE_LOGTYPE_TABLE ,"lib.table" },
lib/log/rte_log.h +1 -1
@@ -31,7 +31,7 @@ extern "C" {/* was RTE_LOGTYPE_RING */ /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ -#define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ +#define RTE_LOGTYPE_PMD RTE_DEPRECATED(RTE_LOGTYPE_PMD) 5/* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */
Signature · 1 line
2.43.0
v5 cover Replace uses of PMD logtype
In reply to Stephen HemmingerThe generic RTE_LOGTYPE_PMD is a leftover and should be removed. This replaces all uses in current tree. It leaves PMD logtype as deprecated because there maybe other uses in external projects leftover.
This version does not use Depends-on: because CI system can't handle that and want to make sure no PMD left behind.
v5 - incorporate review feedback
David Marchand (1):
drivers: use dedicated logtypes
Stephen Hemminger (17):
common/sfc_efx: remove use of PMD logtype mempool/dpaa2: use driver logtype not PMD net/dpaa: use dedicated logtype not PMD net/dpaa2: used dedicated logtype not PMD net/mvpp2: use dedicated logtype
net/vmxnet3: used dedicated logtype not PMD raw/cnxk: replace PMD logtype with dynamic type crypto/scheduler: replace use of logtype PMD crypto/ccp: do not use PMD logtype crypto/caam_jr: use dedicated logtype crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype event/dlb2: use dedicated logtype
event/dpaa, event/dpaa2: use dedicated logtype event/skeleton: replace logtype PMD with dynamic type net/nfb: use dynamic logtype examples/fips_validation: replace use of PMD logtype
log: mark PMD logtype as deprecated
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 3 +- drivers/bus/cdx/cdx_logs.h | 3 +- drivers/bus/fslmc/fslmc_logs.h | 3 +- drivers/common/cnxk/roc_platform.h | 16 +- drivers/common/cpt/cpt_pmd_logs.h | 6 +- drivers/common/dpaax/caamflib/compat.h | 4 +- drivers/common/dpaax/dpaax_logs.h | 3 +- drivers/common/dpaax/version.map | 1 + drivers/common/idpf/idpf_common_logs.h | 5 +- drivers/common/sfc_efx/sfc_efx.c | 11 +- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 46 ++- drivers/crypto/caam_jr/caam_jr_log.h | 15 +- drivers/crypto/caam_jr/caam_jr_uio.c | 4 +- drivers/crypto/ccp/rte_ccp_pmd.c | 13 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 3 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 30 +- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 3 +- drivers/crypto/scheduler/scheduler_pmd.c | 4 +- drivers/dma/dpaa/dpaa_qdma_logs.h | 3 +- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 +- drivers/event/dlb2/dlb2.c | 275 +++++++++--------- drivers/event/dlb2/dlb2_log.h | 3 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 +- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 3 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +- drivers/event/skeleton/skeleton_eventdev.c | 4 +- drivers/event/skeleton/skeleton_eventdev.h | 8 +- drivers/mempool/dpaa/dpaa_mempool.c | 1 + drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 3 +- drivers/net/atlantic/atl_logs.h | 5 +- drivers/net/avp/avp_logs.h | 5 +- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 2 +- drivers/net/bnxt/bnxt_txr.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 8 +- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 3 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +- drivers/net/enetc/enetc_logs.h | 3 +- drivers/net/enetfec/enet_pmd_logs.h | 3 +- drivers/net/igc/igc_logs.h | 5 +- drivers/net/mana/mana.h | 3 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +- drivers/net/nfb/nfb.h | 5 + drivers/net/nfb/nfb_ethdev.c | 24 +- drivers/net/nfb/nfb_rx.c | 9 +- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 9 +- drivers/net/nfb/nfb_tx.h | 2 +- drivers/net/octeon_ep/otx_ep_common.h | 2 + drivers/net/octeon_ep/otx_ep_rxtx.c | 2 +- drivers/net/octeontx/octeontx_logs.h | 3 +- drivers/net/pfe/pfe_logs.h | 3 +- drivers/net/qede/qede_logs.h | 5 +- drivers/net/virtio/virtio_logs.h | 5 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 7 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 6 + drivers/raw/cnxk_gpio/cnxk_gpio.c | 21 +- drivers/raw/cnxk_gpio/cnxk_gpio.h | 5 + drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 +- .../raw/ifpga/base/osdep_rte/osdep_generic.h | 5 +- drivers/vdpa/ifc/base/ifcvf.c | 10 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 7 +- examples/fips_validation/fips_dev_self_test.c | 44 +-- lib/log/log.c | 3 + lib/log/rte_log.h | 2 +- 78 files changed, 420 insertions(+), 376 deletions(-)
Signature · 1 line
2.43.0
PATCH v5 1/18 drivers: use dedicated logtypes
From: David Marchand <[email protected]>
When a driver dedicated logtype exists, use it instead of the generic PMD logtype.
This has been done partially automatically with:
$ for file in $(git grep -l RTE_LOG.*PMD.*fmt drivers/'**.h' \
:^drivers/common/cnxk/roc_platform.h)
do
tail=${file#drivers/*/*/}
dir=${file%%$tail}
! git grep -q RTE_LOGTYPE_ $dir || \
{ echo $dir already done; continue; }
git grep -hE '^extern int .*log.*;$' $file | \
sed -ne 's/^extern int \([^ ;]*\);$/\1/p' | \
while read logtype
do
git grep -q 'RTE_LOG_REGISTER\(_DEFAULT\|\)('$logtype',' || \
[ "$logtype" != "${logtype%%driver}" ] || \
{ echo Skipped $logtype; continue; }
abbrev=$(echo $logtype | sed -e 's/_logtype//' | tr '[a-z]' '[A-Z]')
sed -i -e 's/^\(extern int '$logtype'.*\)$/\1\n#define RTE_LOGTYPE_' \
$abbrev' '$logtype'/' $file
sed -i -e 's/\(RTE_LOG.*, \)PMD,/\1'$abbrev',/' $file
break
done
doneThen a manual update for:
- common/cpt,
- common/dpaax,
- common/idpf,
- mempool/dpaa,
- net/bnxt,
- net/octeon_ep,
- raw/ifpga,
- vdpa/ifc,
--- drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h | 3 ++- drivers/bus/cdx/cdx_logs.h | 3 ++- drivers/bus/fslmc/fslmc_logs.h | 3 ++- drivers/common/cpt/cpt_pmd_logs.h | 6 +++--- drivers/common/dpaax/caamflib/compat.h | 4 +++- drivers/common/dpaax/dpaax_logs.h | 3 ++- drivers/common/dpaax/version.map | 1 + drivers/common/idpf/idpf_common_logs.h | 5 +++-- drivers/crypto/caam_jr/caam_jr_log.h | 3 ++- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 3 ++- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 3 ++- drivers/dma/dpaa/dpaa_qdma_logs.h | 3 ++- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 ++- drivers/event/dlb2/dlb2_log.h | 3 ++- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 3 ++- drivers/mempool/dpaa/dpaa_mempool.c | 1 + drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 3 ++- drivers/net/atlantic/atl_logs.h | 5 +++-- drivers/net/avp/avp_logs.h | 5 +++-- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 2 +- drivers/net/bnxt/bnxt_txr.c | 2 +- drivers/net/dpaa/dpaa_ethdev.h | 3 ++- drivers/net/dpaa2/dpaa2_pmd_logs.h | 3 ++- drivers/net/enetc/enetc_logs.h | 3 ++- drivers/net/enetfec/enet_pmd_logs.h | 3 ++- drivers/net/igc/igc_logs.h | 5 +++-- drivers/net/mana/mana.h | 3 ++- drivers/net/octeon_ep/otx_ep_common.h | 2 ++ drivers/net/octeon_ep/otx_ep_rxtx.c | 2 +- drivers/net/octeontx/octeontx_logs.h | 3 ++- drivers/net/pfe/pfe_logs.h | 3 ++- drivers/net/qede/qede_logs.h | 5 +++-- drivers/net/virtio/virtio_logs.h | 5 +++-- drivers/net/vmxnet3/vmxnet3_logs.h | 7 ++++--- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 ++- drivers/raw/ifpga/base/osdep_rte/osdep_generic.h | 5 ++++- drivers/vdpa/ifc/base/ifcvf.c | 10 +++++----- drivers/vdpa/ifc/base/ifcvf_osdep.h | 7 +++++-- 41 files changed, 92 insertions(+), 52 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h +2 -1
@@ -6,6 +6,7 @@#define _BBDEV_LA12XX_PMD_LOGS_H_extern int bbdev_la12xx_logtype; +#define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype#define rte_bbdev_log (level, fmt, ...) \ rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
@@ -23,6 +24,6 @@ extern int bbdev_la12xx_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define rte_bbdev_dp_log(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/bus/cdx/cdx_logs.h +2 -1
@@ -6,6 +6,7 @@#define CDX_LOGS_H extern int cdx_logtype_bus; +#define RTE_LOGTYPE_CDX_BUS cdx_logtype_bus #define CDX_BUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, cdx_logtype_bus, "cdx: " fmt "\n", \
@@ -25,7 +26,7 @@ extern int cdx_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define CDX_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, CDX_BUS, fmt, ## args) #define CDX_BUS_DP_DEBUG(fmt, args...) \ CDX_BUS_DP_LOG(DEBUG, fmt, ## args)
drivers/bus/fslmc/fslmc_logs.h +2 -1
@@ -8,6 +8,7 @@#define _FSLMC_LOGS_H_extern int dpaa2_logtype_bus; +#define RTE_LOGTYPE_DPAA2_BUS dpaa2_logtype_bus #define DPAA2_BUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_logtype_bus, "fslmc: " fmt "\n", \
@@ -27,7 +28,7 @@ extern int dpaa2_logtype_bus;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_BUS_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA2_BUS, fmt, ## args) #define DPAA2_BUS_DP_DEBUG(fmt, args...) \ DPAA2_BUS_DP_LOG(DEBUG, fmt, ## args)
drivers/common/cpt/cpt_pmd_logs.h +3 -3
@@ -15,6 +15,8 @@* otx*_cryptodev.h file would define the CPT_LOGTYPE macro for the * platform. */ +#define RTE_LOGTYPE_CPT CPT_LOGTYPE + #define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \ "cpt: %s(): " fmt "\n", __func__, ##args)
@@ -30,11 +32,9 @@/* * DP logs, toggled out at compile time if level lower than current level. -* DP logs would be logged under 'PMD' type. So for dynamic logging, the -* level of 'pmd' has to be used. */ #define CPT_LOG_DP(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + RTE_LOG_DP(level, CPT, fmt "\n", ## args) #define CPT_LOG_DP_DEBUG(fmt, args...) \ CPT_LOG_DP(DEBUG, fmt, ## args)
drivers/common/dpaax/caamflib/compat.h +3 -1
@@ -20,6 +20,8 @@#include <rte_byteorder.h> #include <rte_common.h> +#include "dpaax_logs.h" +#ifndef __BYTE_ORDER__#error "Undefined endianness"#endif
@@ -44,7 +46,7 @@#define pr_msg (l, fmt, ...) do { } while (0)#else #define pr_msg (l, fmt, ...) \ - RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) + RTE_LOG(l, DPAAX_LOGGER, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)#endif #if !defined(pr_debug)
drivers/common/dpaax/dpaax_logs.h +2 -1
@@ -8,6 +8,7 @@#include <rte_log.h> extern int dpaax_logger; +#define RTE_LOGTYPE_DPAAX_LOGGER dpaax_logger#ifdef RTE_LIBRTE_DPAAX_DEBUG #define DPAAX_HWWARN(cond, fmt, args...) \
@@ -37,7 +38,7 @@ extern int dpaax_logger;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAAX_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAAX_LOGGER, fmt, ## args) #define DPAAX_DP_DEBUG(fmt, args...) \ DPAAX_DP_LOG(DEBUG, fmt, ## args)
drivers/common/dpaax/version.map +1 -0
@@ -6,6 +6,7 @@ INTERNAL { dpaax_iova_table_p; dpaax_iova_table_populate; dpaax_iova_table_update; + dpaax_logger; of_device_is_available; of_device_is_compatible; of_find_compatible_node;
drivers/common/idpf/idpf_common_logs.h +3 -2
@@ -8,6 +8,7 @@#include <rte_log.h> extern int idpf_common_logtype; +#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype#define DRV_LOG_RAW (level, ...) \ rte_log(RTE_LOG_ ## level, \
@@ -23,7 +24,7 @@ extern int idpf_common_logtype;#ifdef RTE_LIBRTE_IDPF_DEBUG_RX #define RX_LOG (level, ...) \ RTE_LOG(level, \ - PMD, \ + IDPF_COMMON, \ RTE_FMT("%s(): " \ RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ __func__, \
@@ -35,7 +36,7 @@ extern int idpf_common_logtype;#ifdef RTE_LIBRTE_IDPF_DEBUG_TX #define TX_LOG (level, ...) \ RTE_LOG(level, \ - PMD, \ + IDPF_COMMON, \ RTE_FMT("%s(): " \ RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ __func__, \
drivers/crypto/caam_jr/caam_jr_log.h +2 -1
@@ -8,6 +8,7 @@#include <rte_log.h> extern int caam_jr_logtype; +#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype #define CAAM_JR_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
@@ -28,7 +29,7 @@ extern int caam_jr_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define CAAM_JR_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args) #define CAAM_JR_DP_DEBUG(fmt, args...) \ CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h +2 -1
@@ -9,6 +9,7 @@#define _DPAA2_SEC_LOGS_H_extern int dpaa2_logtype_sec; +#define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec #define DPAA2_SEC_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa2_logtype_sec;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_SEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args) #define DPAA2_SEC_DP_DEBUG(fmt, args...) \ DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
drivers/crypto/dpaa_sec/dpaa_sec_log.h +2 -1
@@ -9,6 +9,7 @@#define _DPAA_SEC_LOG_H_extern int dpaa_logtype_sec; +#define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec #define DPAA_SEC_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa_logtype_sec;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_SEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA_SEC, fmt, ## args) #define DPAA_SEC_DP_DEBUG(fmt, args...) \ DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
drivers/dma/dpaa/dpaa_qdma_logs.h +2 -1
@@ -6,6 +6,7 @@#define __DPAA_QDMA_LOGS_H__extern int dpaa_qdma_logtype; +#define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype #define DPAA_QDMA_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
@@ -26,7 +27,7 @@ extern int dpaa_qdma_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args) + RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args) #define DPAA_QDMA_DP_DEBUG(fmt, args...) \ DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
drivers/dma/dpaa2/dpaa2_qdma_logs.h +2 -1
@@ -10,6 +10,7 @@ extern "C" {#endif extern int dpaa2_qdma_logtype; +#define RTE_LOGTYPE_DPAA2_QDMA dpaa2_qdma_logtype #define DPAA2_QDMA_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_qdma_logtype, "dpaa2_qdma: " \
@@ -30,7 +31,7 @@ extern int dpaa2_qdma_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_qdma: " fmt "\n", ## args) + RTE_LOG_DP(level, DPAA2_QDMA, "dpaa2_qdma: " fmt "\n", ## args) #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \ DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
drivers/event/dlb2/dlb2_log.h +2 -1
@@ -6,6 +6,7 @@#define _DLB2_EVDEV_LOG_H_extern int eventdev_dlb2_log_level; +#define RTE_LOGTYPE_EVENTDEV_DLB2_LOG_LEVEL eventdev_dlb2_log_level/* Dynamic logging */ #define DLB2_LOG_IMPL(level, fmt, args...) \
@@ -20,6 +21,6 @@ extern int eventdev_dlb2_log_level;/* remove debug logs at compile time unless actually debugging */ #define DLB2_LOG_DBG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + RTE_LOG_DP(DEBUG, EVENTDEV_DLB2_LOG_LEVEL, fmt, ## args)#endif /* _DLB2_EVDEV_LOG_H_ */
drivers/event/dpaa2/dpaa2_eventdev_logs.h +2 -1
@@ -6,6 +6,7 @@#define _DPAA2_EVENTDEV_LOGS_H_extern int dpaa2_logtype_event; +#define RTE_LOGTYPE_DPAA2_EVENT dpaa2_logtype_event #define DPAA2_EVENTDEV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \
@@ -26,7 +27,7 @@ extern int dpaa2_logtype_event;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA2_EVENT, fmt, ## args) #define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \ DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
drivers/mempool/dpaa/dpaa_mempool.c +1 -0
@@ -38,6 +38,7 @@ struct dpaa_memseg_list rte_dpaa_memsegsstruct dpaa_bp_info *rte_dpaa_bpid_info;RTE_LOG_REGISTER_DEFAULT (dpaa_logtype_mempool,NOTICE ); +#define RTE_LOGTYPE_DPAA_MEMPOOL dpaa_logtype_mempoolstatic int dpaa_mbuf_create_pool (struct rte_mempool *mp)
drivers/mempool/dpaa/dpaa_mempool.h +1 -1
@@ -67,7 +67,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;#define MEMPOOL_INIT_FUNC_TRACE () DPAA_MEMPOOL_LOG(DEBUG, " >>") #define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, fmt, ## args) + RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## args) #define DPAA_MEMPOOL_DEBUG(fmt, args...) \ DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args) #define DPAA_MEMPOOL_ERR(fmt, args...) \
drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h +2 -1
@@ -6,6 +6,7 @@#define _DPAA2_HW_MEMPOOL_LOGS_H_extern int dpaa2_logtype_mempool; +#define RTE_LOGTYPE_DPAA2_MEMPOOL dpaa2_logtype_mempool #define DPAA2_MEMPOOL_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_logtype_mempool, \
@@ -25,7 +26,7 @@ extern int dpaa2_logtype_mempool;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## args) #define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \ DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
drivers/net/atlantic/atl_logs.h +3 -2
@@ -15,12 +15,13 @@ extern int atl_logtype_init;#define PMD_INIT_FUNC_TRACE () PMD_INIT_LOG(DEBUG, " >>") #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args) #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)extern int atl_logtype_driver; +#define RTE_LOGTYPE_ATL_DRIVER atl_logtype_driver #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \ __func__, ## args)
drivers/net/avp/avp_logs.h +3 -2
@@ -9,19 +9,20 @@#ifdef RTE_LIBRTE_AVP_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt, __func__, ## args) + RTE_LOG(level, AVP_DRIVER, "%s() rx: " fmt, __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_LIBRTE_AVP_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt, __func__, ## args) + RTE_LOG(level, AVP_DRIVER, "%s() tx: " fmt, __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif extern int avp_logtype_driver; +#define RTE_LOGTYPE_AVP_DRIVER avp_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, avp_logtype_driver, \
drivers/net/bnxt/bnxt.h +1 -0
@@ -1051,6 +1051,7 @@ extern const struct rte_flow_ops bnxt_flow_meter_ops; ((eth_dev)->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)extern int bnxt_logtype_driver; +#define RTE_LOGTYPE_BNXT bnxt_logtype_driver #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \ __func__, ## args)
drivers/net/bnxt/bnxt_rxtx_vec_neon.c +1 -1
@@ -357,7 +357,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , +RTE_LOG_DP (ERR ,BNXT ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons);
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1 -1
@@ -326,7 +326,7 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)if (likely (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 )) nb_tx_pkts += txcmp->opaque;else -RTE_LOG_DP (ERR ,PMD , +RTE_LOG_DP (ERR ,BNXT ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons);
drivers/net/bnxt/bnxt_txr.c +1 -1
@@ -542,7 +542,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)if (CMP_TYPE (txcmp) ==TX_CMPL_TYPE_TX_L2 ) nb_tx_pkts += opaque;else -RTE_LOG_DP (ERR ,PMD , +RTE_LOG_DP (ERR ,BNXT ,"Unhandled CMP type %02x\n" ,CMP_TYPE (txcmp)); raw_cons =NEXT_RAW_CMP (raw_cons);
drivers/net/dpaa/dpaa_ethdev.h +2 -1
@@ -214,6 +214,7 @@ dpaa_rx_cb_atomic(void *event,/* PMD related logs */ extern int dpaa_logtype_pmd; +#define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd #define DPAA_PMD_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
@@ -232,6 +233,6 @@ extern int dpaa_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA_PMD, fmt, ## args)#endif
drivers/net/dpaa2/dpaa2_pmd_logs.h +2 -1
@@ -6,6 +6,7 @@#define _DPAA2_PMD_LOGS_H_extern int dpaa2_logtype_pmd; +#define RTE_LOGTYPE_DPAA2_PMD dpaa2_logtype_pmd #define DPAA2_PMD_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_logtype_pmd, "dpaa2_net: " \
@@ -28,7 +29,7 @@ extern int dpaa2_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, DPAA2_PMD, fmt, ## args) #define DPAA2_PMD_DP_DEBUG(fmt, args...) \ DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/enetc/enetc_logs.h +2 -1
@@ -6,6 +6,7 @@#define _ENETC_LOGS_H_extern int enetc_logtype_pmd; +#define RTE_LOGTYPE_ENETC_PMD enetc_logtype_pmd #define ENETC_PMD_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
@@ -30,7 +31,7 @@ extern int enetc_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETC_PMD_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, ENETC_PMD, fmt, ## args) #define ENETC_PMD_DP_DEBUG(fmt, args...) \ ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
drivers/net/enetfec/enet_pmd_logs.h +2 -1
@@ -8,6 +8,7 @@#include <rte_log.h> extern int enetfec_logtype_pmd; +#define RTE_LOGTYPE_ENETFEC_PMD enetfec_logtype_pmd/* PMD related logs */ #define ENETFEC_PMD_LOG(level, fmt, args...) \
@@ -28,6 +29,6 @@ extern int enetfec_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define ENETFEC_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, ENETFEC_PMD, fmt, ## args)#endif /* _ENETFEC_LOGS_H_ */
drivers/net/igc/igc_logs.h +3 -2
@@ -13,6 +13,7 @@ extern "C" {extern int igc_logtype_init;extern int igc_logtype_driver; +#define RTE_LOGTYPE_IGC_DRIVER igc_logtype_driver #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, igc_logtype_init, \
@@ -22,14 +23,14 @@ extern int igc_logtype_driver;#ifdef RTE_ETHDEV_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while (0)#endif #ifdef RTE_ETHDEV_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)#endif
drivers/net/mana/mana.h +2 -1
@@ -460,6 +460,7 @@ struct mana_rxq { };extern int mana_logtype_driver; +#define RTE_LOGTYPE_MANA_DRIVER mana_logtype_driverextern int mana_logtype_init; #define DRV_LOG(level, fmt, args...) \
@@ -467,7 +468,7 @@ extern int mana_logtype_init; __func__, ## args) #define DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt "\n", ## args) + RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args) #define PMD_INIT_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
drivers/net/octeon_ep/otx_ep_common.h +2 -0
@@ -598,4 +598,6 @@ int otx_ep_delete_oqs(struct otx_ep_device *otx_ep, uint32_t oq_no);#define PCI_VENDOR_ID_CAVIUM 0x177Dextern int otx_net_ep_logtype; +#define RTE_LOGTYPE_OTX_NET_EP otx_net_ep_logtype +#endif /* _OTX_EP_COMMON_H_ */
drivers/net/octeon_ep/otx_ep_rxtx.c +1 -1
@@ -884,7 +884,7 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) next_fetch = (pkts == new_pkts -1 ) ?0 :1 ; oq_pkt =otx_ep_droq_read_packet (otx_ep, droq, next_fetch);if (!oq_pkt) { - RTE_LOG_DP(ERR, PMD, + RTE_LOG_DP(ERR, OTX_NET_EP, "DROQ read pkt failed pending %" PRIu64 "last_pkt_count %" PRIu64 "new_pkts %d.\n", droq->pkts_pending, droq->last_pkt_count,
drivers/net/octeontx/octeontx_logs.h +2 -1
@@ -20,7 +20,7 @@ "%s(): " fmt "\n", __func__, ## args) #define octeontx_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, fmt "\n", ## args) + RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)#define octeontx_log_err (s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)#define octeontx_log_dbg (s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
@@ -31,6 +31,7 @@extern int otx_net_logtype_init;extern int otx_net_logtype_driver; +#define RTE_LOGTYPE_OTX_NET_DRIVER otx_net_logtype_driverextern int otx_net_logtype_mbox;#endif /* __OCTEONTX_LOGS_H__*/
drivers/net/pfe/pfe_logs.h +2 -1
@@ -6,6 +6,7 @@#define _PFE_LOGS_H_extern int pfe_logtype_pmd; +#define RTE_LOGTYPE_PFE_PMD pfe_logtype_pmd/* PMD related logs */ #define PFE_PMD_LOG(level, fmt, args...) \
@@ -26,6 +27,6 @@ extern int pfe_logtype_pmd;/* DP Logs, toggled out at compile time if level lower than current level */ #define PFE_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, fmt, ## args) + RTE_LOG_DP(level, PFE_PMD, fmt, ## args)#endif /* _PFE_LOGS_H_ */
drivers/net/qede/qede_logs.h +3 -2
@@ -8,6 +8,7 @@#define _QEDE_LOGS_H_extern int qede_logtype_driver; +#define RTE_LOGTYPE_QEDE_DRIVER qede_logtype_driver#define DP_ERR (p_dev, fmt, ...) \ rte_log(RTE_LOG_ERR, qede_logtype_driver, \
@@ -59,7 +60,7 @@ extern int qede_logtype_init;#ifdef RTE_LIBRTE_QEDE_DEBUG_TX #define PMD_TX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ + RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
@@ -67,7 +68,7 @@ extern int qede_logtype_init;#ifdef RTE_LIBRTE_QEDE_DEBUG_RX #define PMD_RX_LOG(level, q, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): port=%u queue=%u " fmt "\n", \ + RTE_LOG(level, QEDE_DRIVER, "%s(): port=%u queue=%u " fmt "\n", \ __func__, q->port_id, q->queue_id, ## args)#else #define PMD_RX_LOG(level, q, fmt, args...) do { } while (0)
drivers/net/virtio/virtio_logs.h +3 -2
@@ -16,19 +16,20 @@ extern int virtio_logtype_init;#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args) + RTE_LOG(level, VIRTIO_DRIVER, "%s() rx: " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args) + RTE_LOG(level, VIRTIO_DRIVER, "%s() tx: " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif extern int virtio_logtype_driver; +#define RTE_LOGTYPE_VIRTIO_DRIVER virtio_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \ "%s(): " fmt "\n", __func__, ## args)
drivers/net/vmxnet3/vmxnet3_logs.h +4 -3
@@ -13,26 +13,27 @@ extern int vmxnet3_logtype_init;#ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX #define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)#else #define PMD_RX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX #define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_LOG(level, fmt, args...) do { } while(0)#endif #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE #define PMD_TX_FREE_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)#else #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)#endif extern int vmxnet3_logtype_driver; +#define RTE_LOGTYPE_VMXNET3_DRIVER vmxnet3_logtype_driver #define PMD_DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \ "%s(): " fmt "\n", __func__, ## args)
drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +2 -1
@@ -10,6 +10,7 @@ extern "C" {#endif extern int dpaa2_cmdif_logtype; +#define RTE_LOGTYPE_DPAA2_CMDIF dpaa2_cmdif_logtype #define DPAA2_CMDIF_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \
@@ -30,7 +31,7 @@ extern int dpaa2_cmdif_logtype;/* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \ - RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args) + RTE_LOG_DP(level, DPAA2_CMDIF, "dpaa2_cmdif: " fmt "\n", ## args) #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \ DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
drivers/raw/ifpga/base/osdep_rte/osdep_generic.h +4 -1
@@ -16,8 +16,11 @@#include <rte_byteorder.h> #include <rte_memcpy.h> +extern int ifpga_rawdev_logtype; +#define RTE_LOGTYPE_IFPGA_RAWDEV ifpga_rawdev_logtype + #define dev_printf(level, fmt, args...) \ - RTE_LOG(level, PMD, "osdep_rte: " fmt, ## args) + RTE_LOG(level, IFPGA_RAWDEV, "osdep_rte: " fmt, ## args)#define osdep_panic (...) rte_panic(...)
drivers/vdpa/ifc/base/ifcvf.c +5 -5
@@ -224,10 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)if (mq_cfg) {if (hw->device_type ==IFCVF_BLK ) { *(u32 *)mq_cfg = nr_queue; -RTE_LOG (INFO ,PMD ,"%d queues are enabled\n" , nr_queue); +RTE_LOG (INFO ,IFCVF_VDPA ,"%d queues are enabled\n" , nr_queue); }else { *(u32 *)mq_cfg = nr_queue /2 ; -RTE_LOG (INFO ,PMD ,"%d queue pairs are enabled\n" , +RTE_LOG (INFO ,IFCVF_VDPA ,"%d queue pairs are enabled\n" , nr_queue /2 ); } }
@@ -246,7 +246,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg;if (!cfg) { -RTE_LOG (ERR ,PMD ,"common_cfg in HW is NULL.\n" ); +RTE_LOG (ERR ,IFCVF_VDPA ,"common_cfg in HW is NULL.\n" );return -1 ; }
@@ -258,7 +258,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)IFCVF_WRITE_REG16 (i +1 , &cfg->queue_msix_vector); msix_vector =IFCVF_READ_REG16 (&cfg->queue_msix_vector);if (msix_vector ==IFCVF_MSI_NO_VECTOR ) { -RTE_LOG (ERR ,PMD ,"queue %d, msix vec alloc failed\n" , +RTE_LOG (ERR ,IFCVF_VDPA ,"queue %d, msix vec alloc failed\n" , i);return -1 ; }
@@ -307,7 +307,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg;if (!cfg) { -RTE_LOG (ERR ,PMD ,"common_cfg in HW is NULL.\n" ); +RTE_LOG (ERR ,IFCVF_VDPA ,"common_cfg in HW is NULL.\n" );return ; }
drivers/vdpa/ifc/base/ifcvf_osdep.h +5 -2
@@ -13,8 +13,11 @@#include <rte_log.h> #include <rte_io.h> -#define WARNINGOUT(S, args...) RTE_LOG(WARNING, PMD, S, ##args) -#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args) +extern int ifcvf_vdpa_logtype; +#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype + +#define WARNINGOUT(S, args...) RTE_LOG(WARNING, IFCVF_VDPA, S, ##args) +#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, IFCVF_VDPA, S, ##args)#define STATIC static#define msec_delay (x) rte_delay_us_sleep(1000 * (x))
Signature · 1 line
2.43.0
PATCH v5 2/18 common/sfc_efx: remove use of PMD logtype
In reply to Stephen HemmingerThis code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers.
--- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/common/sfc_efx/sfc_efx.c +2 -9
@@ -15,7 +15,7 @@#include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev,return rc; } -RTE_INIT (sfc_efx_register_logtype) -{ -int ret; - - ret =rte_log_register_type_and_pick_level ("pmd.common.sfc_efx" , -RTE_LOG_NOTICE ); - sfc_efx_logtype = (ret <0 ) ?RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT (sfc_efx_logtype,NOTICE );
drivers/common/sfc_efx/sfc_efx_log.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_EFX_LOG_H_/** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype;/** Log message, add a prefix and a line break */ #define SFC_EFX_LOG (level, ...) \
Signature · 1 line
2.43.0
PATCH v5 3/18 mempool/dpaa2: use driver logtype not PMD
In reply to Stephen HemmingerThe driver already has macros for logging, use them.
--- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
@@ -293,7 +293,7 @@ rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_ERR ("DPAA2 buffer pool not configured" );return -ENOMEM ; }
@@ -307,7 +307,7 @@ rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr) bp_info =mempool_to_bpinfo (mp);if (!(bp_info->bp_list)) { -RTE_LOG (ERR ,PMD ,"DPAA2 buffer pool not configured\n" ); +DPAA2_MEMPOOL_ERR ("DPAA2 buffer pool not configured" );return NULL ; }
Signature · 1 line
2.43.0
PATCH v5 4/18 net/dpaa: use dedicated logtype not PMD
In reply to Stephen HemmingerThe driver already has a logtype, but was not used in couple places.
--- drivers/net/dpaa/dpaa_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +4 -4
@@ -2096,8 +2096,8 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* copy the primary mac address */ rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); -RTE_LOG (INFO ,PMD ,"net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT "\n" , - dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr)); +DPAA_PMD_INFO ("net: dpaa: %s: " RTE_ETHER_ADDR_PRT_FMT , + dpaa_device->name,RTE_ETHER_ADDR_BYTES (&fman_intf->mac_addr));if (!fman_intf->is_shared_mac) {/* Configure error packet handling */
@@ -2166,7 +2166,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, ret =dpaa_dev_init_secondary (eth_dev);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"secondary dev init failed\n" ); +DPAA_PMD_ERR ("secondary dev init failed" );return ret; }
@@ -2182,7 +2182,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,if (!(default_q || fmc_q)) {if (dpaa_fm_init ()) { -DPAA_PMD_ERR ("FM init failed\n" ); +DPAA_PMD_ERR ("FM init failed" );return -1 ; } }
Signature · 1 line
2.43.0
PATCH v5 5/18 net/dpaa2: used dedicated logtype not PMD
In reply to Stephen HemmingerThe driver has a logtype, but was not being used in one place.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2851,7 +2851,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)return ret; } } -RTE_LOG (INFO ,PMD ,"%s: netdev created, connected to %s\n" , +DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);return 0 ;
drivers/net/dpaa2/dpaa2_sparser.c +2 -2
@@ -181,7 +181,7 @@ int dpaa2_eth_load_wriop_soft_parser(struct dpaa2_dev_priv *priv, priv->ss_iova = (uint64_t )(DPAA2_VADDR_TO_IOVA (addr)); priv->ss_offset += sp_param.size; -RTE_LOG (INFO ,PMD ,"Soft parser loaded for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser loaded for dpni@%d" , priv->hw_id);rte_free (addr);return 0 ;
@@ -234,6 +234,6 @@ int dpaa2_eth_enable_wriop_soft_parser(struct dpaa2_dev_priv *priv, }rte_free (param_addr); -RTE_LOG (INFO ,PMD ,"Soft parser enabled for dpni@%d\n" , priv->hw_id); +DPAA2_PMD_INFO ("Soft parser enabled for dpni@%d" , priv->hw_id);return 0 ; }
Signature · 1 line
2.43.0
PATCH v5 6/18 net/mvpp2: use dedicated logtype
In reply to Stephen HemmingerAlways use the dedicated logtype, not PMD.
--- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +2 -2
@@ -415,10 +415,10 @@ mrvl_set_tx_function(struct rte_eth_dev *dev)/* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (priv->multiseg) { -RTE_LOG (INFO ,PMD ,"Using multi-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using multi-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_sg_pkt_burst; }else { -RTE_LOG (INFO ,PMD ,"Using single-segment tx callback\n" ); +MRVL_LOG (INFO ,"Using single-segment tx callback" ); dev->tx_pkt_burst = mrvl_tx_pkt_burst; } }
Signature · 1 line
2.43.0
PATCH v5 7/18 net/vmxnet3: used dedicated logtype not PMD
In reply to Stephen HemmingerThe driver has log macros, just not used in one place.
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -1919,7 +1919,7 @@ vmxnet3_interrupt_handler(void *param)if (events ==0 ) goto done; -RTE_LOG (DEBUG ,PMD ,"Reading events: 0x%X" , events); +PMD_DRV_LOG (DEBUG ,"Reading events: 0x%X" , events);vmxnet3_process_events (dev); done:vmxnet3_enable_intr (hw, *eventIntrIdx);
Signature · 1 line
2.43.0
PATCH v5 8/18 raw/cnxk: replace PMD logtype with dynamic type
In reply to Stephen HemmingerDriver should not be using PMD logtype, they should have their own logtype.
--- drivers/common/cnxk/roc_platform.h | 16 ++++++----- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 ++- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +++++++++++----------- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 6 +++++ drivers/raw/cnxk_gpio/cnxk_gpio.c | 21 ++++++++------- drivers/raw/cnxk_gpio/cnxk_gpio.h | 5 ++++ drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 ++++++------ 8 files changed, 57 insertions(+), 44 deletions(-)
drivers/common/cnxk/roc_platform.h +9 -7
@@ -265,11 +265,13 @@ extern int cnxk_logtype_tm;extern int cnxk_logtype_ree;extern int cnxk_logtype_dpi; +#define RTE_LOGTYPE_CNXK cnxk_logtype_base + #define plt_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) -#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) -#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args) -#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args) + RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) +#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args) +#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args) +#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)#define plt_dump (fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)#define plt_dump_no_nl (fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -296,11 +298,11 @@ extern int cnxk_logtype_dpi;/* Datapath logs */ #define plt_dp_err(fmt, args...) \ - RTE_LOG_DP(ERR, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) #define plt_dp_info(fmt, args...) \ - RTE_LOG_DP(INFO, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args) #define plt_dp_dbg(fmt, args...) \ - RTE_LOG_DP(DEBUG, PMD, "%s():%u " fmt "\n", __func__, __LINE__, ##args) + RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)#ifdef __cplusplus#define CNXK_PCI_ID (subsystem_dev, dev) \
drivers/raw/cnxk_bphy/cnxk_bphy.c +2 -1
@@ -251,7 +251,7 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +CNXK_BPHY_LOG (WARNING ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
@@ -410,3 +410,4 @@ static struct rte_pci_driver cnxk_bphy_rawdev_pmd = {RTE_PMD_REGISTER_PCI (bphy_rawdev_pci_driver, cnxk_bphy_rawdev_pmd);RTE_PMD_REGISTER_PCI_TABLE (bphy_rawdev_pci_driver, pci_bphy_map);RTE_PMD_REGISTER_KMOD_DEP (bphy_rawdev_pci_driver,"vfio-pci" ); +RTE_LOG_REGISTER_SUFFIX (cnxk_logtype_bphy, bphy,INFO );
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -189,7 +189,7 @@ cnxk_bphy_cgx_process_buf(struct cnxk_bphy_cgx *cgx, unsigned int queue,/* get rid of last response if any */ if (qp->rsp) { -RTE_LOG (WARNING ,PMD ,"Previous response got overwritten\n" ); +CNXK_BPHY_LOG (WARNING ,"Previous response got overwritten" );rte_free (qp->rsp); } qp->rsp = rsp;
drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c +15 -16
@@ -57,62 +57,61 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id)if (ret)break ;if (descs !=1 ) { -RTE_LOG (ERR ,PMD ,"Wrong number of descs reported\n" ); +CNXK_BPHY_LOG (ERR ,"Wrong number of descs reported" ); ret = -ENODEV ;break ; } -RTE_LOG (INFO ,PMD ,"Testing queue %d\n" , i); +CNXK_BPHY_LOG (INFO ,"Testing queue %d" , i); ret =rte_pmd_bphy_cgx_stop_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to stop rx/tx\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to stop rx/tx" );break ; } ret =rte_pmd_bphy_cgx_start_rxtx (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to start rx/tx\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to start rx/tx" );break ; } ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, false);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link down\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to set link down" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,0 );if (ret !=0 ) -RTE_LOG (ERR ,PMD , -"Timed out waiting for a link down\n" ); +CNXK_BPHY_LOG (ERR ,"Timed out waiting for a link down" ); ret =rte_pmd_bphy_cgx_set_link_state (dev_id, i, true);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set link up\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to set link up" );break ; } ret =cnxk_bphy_cgx_link_cond (dev_id, i,1 );if (ret !=1 ) -RTE_LOG (ERR ,PMD ,"Timed out waiting for a link up\n" ); +CNXK_BPHY_LOG (ERR ,"Timed out waiting for a link up" ); ret =rte_pmd_bphy_cgx_intlbk_enable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to enable internal lbk\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to enable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_intlbk_disable (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable internal lbk\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable internal lbk" );break ; } ret =rte_pmd_bphy_cgx_ptp_rx_enable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to enable ptp\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to enable ptp" );break ; } ret =0 ;
@@ -120,27 +119,27 @@ cnxk_bphy_cgx_dev_selftest(uint16_t dev_id) ret =rte_pmd_bphy_cgx_ptp_rx_disable (dev_id, i);/* ptp not available on RPM */ if (ret <0 && ret != -ENOTSUP ) { -RTE_LOG (ERR ,PMD ,"Failed to disable ptp\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable ptp" );break ; } ret =0 ; ret =rte_pmd_bphy_cgx_get_supported_fec (dev_id, i, &fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to get supported FEC\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to get supported FEC" );break ; } ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to set FEC to %d\n" , fec); +CNXK_BPHY_LOG (ERR ,"Failed to set FEC to %d" , fec);break ; } fec =CNXK_BPHY_CGX_ETH_LINK_FEC_NONE ; ret =rte_pmd_bphy_cgx_set_fec (dev_id, i, fec);if (ret) { -RTE_LOG (ERR ,PMD ,"Failed to disable FEC\n" ); +CNXK_BPHY_LOG (ERR ,"Failed to disable FEC" );break ; } }
drivers/raw/cnxk_bphy/rte_pmd_bphy.h +6 -0
@@ -26,6 +26,12 @@ extern "C" { #endif +extern int cnxk_logtype_bphy; + +#define CNXK_BPHY_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \ + "%s(): " fmt "\n", __func__, ## args) + /** Available message types */ enum cnxk_bphy_cgx_msg_type { /** Type used to obtain link information */
drivers/raw/cnxk_gpio/cnxk_gpio.c +11 -10
@@ -215,13 +215,13 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist) errno =0 ; val =strtol (token,NULL ,10 );if (errno) { -RTE_LOG (ERR ,PMD ,"failed to parse %s\n" , token); +CNXK_GPIO_LOG (ERR ,"failed to parse %s" , token); ret = -errno; goto out; }if (val <0 || val >= gpiochip->num_gpios) { -RTE_LOG (ERR ,PMD ,"gpio%d out of 0-%d range\n" , val, +CNXK_GPIO_LOG (ERR ,"gpio%d out of 0-%d range" , val, gpiochip->num_gpios -1 ); ret = -EINVAL ; goto out;
@@ -231,7 +231,7 @@ cnxk_gpio_parse_allowlist(struct cnxk_gpiochip *gpiochip, char *allowlist)if (list[i] != val)continue ; -RTE_LOG (WARNING ,PMD ,"gpio%d already allowed\n" , val); +CNXK_GPIO_LOG (WARNING ,"gpio%d already allowed" , val);break ; }if (i == queue)
@@ -398,7 +398,7 @@ cnxk_gpio_queue_setup(struct rte_rawdev *dev, uint16_t queue_id,return ret; } }else { -RTE_LOG (WARNING ,PMD ,"using existing gpio%d\n" , gpio->num); +CNXK_GPIO_LOG (WARNING ,"using existing gpio%d" , gpio->num); } gpiochip->gpios[num] = gpio;
@@ -647,7 +647,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)/* get rid of last response if any */ if (gpio->rsp) { -RTE_LOG (WARNING ,PMD ,"previous response got overwritten\n" ); +CNXK_GPIO_LOG (WARNING ,"previous response got overwritten" );rte_free (gpio->rsp); } gpio->rsp = rsp;
@@ -741,7 +741,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)cnxk_gpio_format_name (name,sizeof (name)); rawdev =rte_rawdev_pmd_allocate (name,sizeof (*gpiochip),rte_socket_id ());if (!rawdev) { -RTE_LOG (ERR ,PMD ,"failed to allocate %s rawdev\n" , name); +CNXK_GPIO_LOG (ERR ,"failed to allocate %s rawdev" , name);return -ENOMEM ; }
@@ -770,7 +770,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/base" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->base);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_GPIO_LOG (ERR ,"failed to read %s" , buf); goto out; }
@@ -778,20 +778,20 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)snprintf (buf,sizeof (buf),"%s/gpiochip%d/ngpio" ,CNXK_GPIO_CLASS_PATH , gpiochip->num); ret =cnxk_gpio_read_attr_int (buf, &gpiochip->num_gpios);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to read %s\n" , buf); +CNXK_GPIO_LOG (ERR ,"failed to read %s" , buf); goto out; } gpiochip->num_queues = gpiochip->num_gpios; ret =cnxk_gpio_parse_allowlist (gpiochip, params->allowlist);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to parse allowed gpios\n" ); +CNXK_GPIO_LOG (ERR ,"failed to parse allowed gpios" ); goto out; } gpiochip->gpios =rte_calloc (NULL , gpiochip->num_gpios,sizeof (struct cnxk_gpio *),0 );if (!gpiochip->gpios) { -RTE_LOG (ERR ,PMD ,"failed to allocate gpios memory\n" ); +CNXK_GPIO_LOG (ERR ,"failed to allocate gpios memory" ); ret = -ENOMEM ; goto out; }
@@ -851,3 +851,4 @@ RTE_PMD_REGISTER_VDEV(cnxk_gpio, cnxk_gpio_drv);RTE_PMD_REGISTER_PARAM_STRING (cnxk_gpio,"gpiochip=<int> " "allowlist=<list>" ); +RTE_LOG_REGISTER_SUFFIX (cnxk_logtype_gpio, gpio,INFO );
drivers/raw/cnxk_gpio/cnxk_gpio.h +5 -0
@@ -5,6 +5,11 @@#ifndef _CNXK_GPIO_H_#define _CNXK_GPIO_H_ +extern int cnxk_logtype_gpio; + +#define CNXK_GPIO_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args) +struct cnxk_gpiochip ; struct cnxk_gpio {
drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c +8 -9
@@ -56,7 +56,7 @@ cnxk_gpio_read_attr(char *attr, char *val)#define CNXK_GPIO_ERR_STR (err, str, ...) do { \ if (err) { \ - RTE_LOG(ERR, PMD, "%s:%d: " str " (%d)\n", __func__, __LINE__, \ + CNXK_GPIO_LOG(ERR, "%s:%d: " str " (%d)", __func__, __LINE__, \ ##__VA_ARGS__, err); \ goto out; \ } \
@@ -330,30 +330,29 @@ cnxk_gpio_selftest(uint16_t dev_id)for (i =0 ; i < queues; i++) { ret =rte_rawdev_queue_conf_get (dev_id, i, &conf,sizeof (conf));if (ret) { -RTE_LOG (ERR ,PMD , -"failed to read queue configuration (%d)\n" , +CNXK_GPIO_LOG (ERR ,"failed to read queue configuration (%d)" , ret); goto out; } -RTE_LOG (INFO ,PMD ,"testing queue%d (gpio%d)\n" , i, conf.gpio); +CNXK_GPIO_LOG (INFO ,"testing queue%d (gpio%d)" , i, conf.gpio);if (conf.size !=1 ) { -RTE_LOG (ERR ,PMD ,"wrong queue size received\n" ); +CNXK_GPIO_LOG (ERR ,"wrong queue size received" ); ret = -EIO ; goto out; } ret =rte_rawdev_queue_setup (dev_id, i,NULL ,0 );if (ret) { -RTE_LOG (ERR ,PMD ,"failed to setup queue (%d)\n" , ret); +CNXK_GPIO_LOG (ERR ,"failed to setup queue (%d)" , ret); goto out; } gpio = gpiochip->gpios[conf.gpio];snprintf (buf,sizeof (buf),CNXK_GPIO_PATH_FMT , gpio->num);if (!cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s does not exist\n" , buf); +CNXK_GPIO_LOG (ERR ,"%s does not exist" , buf); ret = -ENOENT ; goto release; }
@@ -371,13 +370,13 @@ cnxk_gpio_selftest(uint16_t dev_id) ret2 = ret; ret =rte_rawdev_queue_release (dev_id, i);if (ret) { -RTE_LOG (ERR ,PMD ,"failed to release queue (%d)\n" , +CNXK_GPIO_LOG (ERR ,"failed to release queue (%d)" , ret);break ; }if (cnxk_gpio_attr_exists (buf)) { -RTE_LOG (ERR ,PMD ,"%s still exists\n" , buf); +CNXK_GPIO_LOG (ERR ,"%s still exists" , buf); ret = -EIO ;break ; }
Signature · 1 line
2.43.0
PATCH v5 9/18 crypto/scheduler: replace use of logtype PMD
In reply to Stephen HemmingerDriver has logging macro but not used everywhere.
--- drivers/crypto/scheduler/scheduler_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/scheduler/scheduler_pmd.c +2 -2
@@ -197,8 +197,8 @@ cryptodev_scheduler_create(const char *name,return -EINVAL ; } -RTE_LOG (INFO ,PMD ," Sched mode param (%s = %s)\n" , - param_name, param_val); +CR_SCHED_LOG (INFO ," Sched mode param (%s = %s)" , + param_name, param_val); } }
Signature · 1 line
2.43.0
PATCH v5 10/18 crypto/ccp: do not use PMD logtype
In reply to Stephen HemmingerThis driver has logging macros but not used consistently.
--- drivers/crypto/ccp/rte_ccp_pmd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/crypto/ccp/rte_ccp_pmd.c +6 -7
@@ -194,8 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev) ccp_pmd_init_done =0 ; -RTE_LOG (INFO ,PMD ,"Closing ccp device %s on numa socket %u\n" , - name,rte_socket_id ()); +CCP_LOG_INFO ("Closing ccp device %s on numa socket %u" , name,rte_socket_id ());return rte_cryptodev_pmd_destroy (dev); }
@@ -228,7 +227,7 @@ cryptodev_ccp_create(const char *name, } cryptodev_cnt++; -CCP_LOG_DBG ("CCP : Crypto device count = %d\n" , cryptodev_cnt); +CCP_LOG_DBG ("CCP : Crypto device count = %d" , cryptodev_cnt); dev->device = &pci_dev->device; dev->device->driver = &pci_drv->driver; dev->driver_id = ccp_cryptodev_driver_id;
@@ -279,7 +278,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, };if (ccp_pmd_init_done) { -RTE_LOG (INFO ,PMD ,"CCP PMD already initialized\n" ); +CCP_LOG_INFO ("CCP PMD already initialized" );return -EFAULT ; }rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
@@ -288,11 +287,11 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, init_params.def_p.max_nb_queue_pairs =CCP_PMD_MAX_QUEUE_PAIRS ; -RTE_LOG (INFO ,PMD ,"Initialising %s on NUMA node %d\n" , name, +CCP_LOG_INFO ("Initialising %s on NUMA node %d" , name, init_params.def_p.socket_id); -RTE_LOG (INFO ,PMD ,"Max number of queue pairs = %d\n" , +CCP_LOG_INFO ("Max number of queue pairs = %d" , init_params.def_p.max_nb_queue_pairs); -RTE_LOG (INFO ,PMD ,"Authentication offload to %s\n" , +CCP_LOG_INFO ("Authentication offload to %s" , ((init_params.auth_opt ==0 ) ?"CCP" :"CPU" ));rte_pci_device_name (&pci_dev->addr, name,sizeof (name));
Signature · 1 line
2.43.0
PATCH v5 11/18 crypto/caam_jr: use dedicated logtype
In reply to Stephen HemmingerThe driver has macro and logtype but not used in a couple places. Also, remove extraneous newlines.
--- drivers/crypto/caam_jr/caam_jr.c | 46 +++++++++++++--------------- drivers/crypto/caam_jr/caam_jr_log.h | 12 ++++---- drivers/crypto/caam_jr/caam_jr_uio.c | 4 +-- 3 files changed, 29 insertions(+), 33 deletions(-)
drivers/crypto/caam_jr/caam_jr.c +21 -25
@@ -123,10 +123,8 @@ void caam_jr_stats_get(struct rte_cryptodev *dev, stats->dequeued_count += qp[i]->rx_pkts; stats->enqueue_err_count += qp[i]->tx_errs; stats->dequeue_err_count += qp[i]->rx_errs; -CAAM_JR_INFO ("extra stats:\n\tRX Poll ERR = %" PRIu64 -"\n\tTX Ring Full = %" PRIu64, - qp[i]->rx_poll_err, - qp[i]->tx_ring_full); +CAAM_JR_INFO ("extra stats: RX Poll ERR = %" PRIu64"TX Ring Full = %" PRIu64, + qp[i]->rx_poll_err, qp[i]->tx_ring_full); } }
@@ -309,7 +307,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) cdb =caam_jr_dma_mem_alloc (L1_CACHE_BYTES ,sizeof (struct sec_cdb ));if (!cdb) { -CAAM_JR_ERR ("failed to allocate memory for cdb\n" ); +CAAM_JR_ERR ("failed to allocate memory for cdb" );return -1 ; }
@@ -606,7 +604,7 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,/*TODO for multiple ops, packets*/ ctx = container_of(current_desc, struct caam_jr_op_ctx, jobdes);if (unlikely (sec_error_code)) { -CAAM_JR_ERR ("desc at cidx %d generated error 0x%x\n" , +CAAM_JR_ERR ("desc at cidx %d generated error 0x%x" , job_ring->cidx, sec_error_code);hw_handle_job_ring_error (job_ring, sec_error_code);//todo improve with exact errors
@@ -1368,7 +1366,7 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) }if (unlikely (!ses->qp || ses->qp != qp)) { -CAAM_JR_DP_DEBUG ("Old:sess->qp=%p New qp = %p\n" , ses->qp, qp); +CAAM_JR_DP_DEBUG ("Old:sess->qp=%p New qp = %p" , ses->qp, qp); ses->qp = qp;caam_jr_prep_cdb (ses); }
@@ -1554,7 +1552,7 @@ caam_jr_cipher_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.data =rte_zmalloc (NULL , xform->cipher.key.length,RTE_CACHE_LINE_SIZE );if (session->cipher_key.data ==NULL && xform->cipher.key.length >0 ) { -CAAM_JR_ERR ("No Memory for cipher key\n" ); +CAAM_JR_ERR ("No Memory for cipher key" );return -ENOMEM ; } session->cipher_key.length = xform->cipher.key.length;
@@ -1576,7 +1574,7 @@ caam_jr_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.data =rte_zmalloc (NULL , xform->auth.key.length,RTE_CACHE_LINE_SIZE );if (session->auth_key.data ==NULL && xform->auth.key.length >0 ) { -CAAM_JR_ERR ("No Memory for auth key\n" ); +CAAM_JR_ERR ("No Memory for auth key" );return -ENOMEM ; } session->auth_key.length = xform->auth.key.length;
@@ -1602,7 +1600,7 @@ caam_jr_aead_init(struct rte_cryptodev *dev __rte_unused, session->aead_key.data =rte_zmalloc (NULL , xform->aead.key.length,RTE_CACHE_LINE_SIZE );if (session->aead_key.data ==NULL && xform->aead.key.length >0 ) { -CAAM_JR_ERR ("No Memory for aead key\n" ); +CAAM_JR_ERR ("No Memory for aead key" );return -ENOMEM ; } session->aead_key.length = xform->aead.key.length;
@@ -1755,7 +1753,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev, RTE_CACHE_LINE_SIZE);if (session->cipher_key.data ==NULL && cipher_xform->key.length >0 ) { -CAAM_JR_ERR ("No Memory for cipher key\n" ); +CAAM_JR_ERR ("No Memory for cipher key" );return -ENOMEM ; }
@@ -1765,7 +1763,7 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev, RTE_CACHE_LINE_SIZE);if (session->auth_key.data ==NULL && auth_xform->key.length >0 ) { -CAAM_JR_ERR ("No Memory for auth key\n" ); +CAAM_JR_ERR ("No Memory for auth key" );rte_free (session->cipher_key.data);return -ENOMEM ; }
@@ -1810,11 +1808,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,case RTE_CRYPTO_AUTH_KASUMI_F9 :case RTE_CRYPTO_AUTH_AES_CBC_MAC :case RTE_CRYPTO_AUTH_ZUC_EIA3 : -CAAM_JR_ERR ("Crypto: Unsupported auth alg %u\n" , +CAAM_JR_ERR ("Crypto: Unsupported auth alg %u" , auth_xform->algo); goto out;default : -CAAM_JR_ERR ("Crypto: Undefined Auth specified %u\n" , +CAAM_JR_ERR ("Crypto: Undefined Auth specified %u" , auth_xform->algo); goto out; }
@@ -1834,11 +1832,11 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,case RTE_CRYPTO_CIPHER_3DES_ECB :case RTE_CRYPTO_CIPHER_AES_ECB :case RTE_CRYPTO_CIPHER_KASUMI_F8 : -CAAM_JR_ERR ("Crypto: Unsupported Cipher alg %u\n" , +CAAM_JR_ERR ("Crypto: Unsupported Cipher alg %u" , cipher_xform->algo); goto out;default : -CAAM_JR_ERR ("Crypto: Undefined Cipher specified %u\n" , +CAAM_JR_ERR ("Crypto: Undefined Cipher specified %u" , cipher_xform->algo); goto out; }
@@ -1962,7 +1960,7 @@ caam_jr_dev_configure(struct rte_cryptodev *dev,NULL ,NULL ,NULL ,NULL , SOCKET_ID_ANY, 0);if (!internals->ctx_pool) { -CAAM_JR_ERR ("%s create failed\n" , str); +CAAM_JR_ERR ("%s create failed" , str);return -ENOMEM ; } }else
@@ -2180,7 +2178,7 @@ init_job_ring(void *reg_base_addr, int irq_id) } }if (job_ring ==NULL ) { -CAAM_JR_ERR ("No free job ring\n" ); +CAAM_JR_ERR ("No free job ring" );return NULL ; }
@@ -2301,7 +2299,7 @@ caam_jr_dev_init(const char *name, job_ring->uio_fd);if (!dev->data->dev_private) { -CAAM_JR_ERR ("Ring memory allocation failed\n" ); +CAAM_JR_ERR ("Ring memory allocation failed" ); goto cleanup2; }
@@ -2334,7 +2332,7 @@ caam_jr_dev_init(const char *name, security_instance =rte_malloc ("caam_jr" ,sizeof (struct rte_security_ctx ),0 );if (security_instance ==NULL ) { -CAAM_JR_ERR ("memory allocation failed\n" ); +CAAM_JR_ERR ("memory allocation failed" );//todo error handling. goto cleanup2; }
@@ -2346,7 +2344,7 @@ caam_jr_dev_init(const char *name,rte_cryptodev_pmd_probing_finish (dev); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , dev->data->name); +CAAM_JR_INFO ("%s cryptodev init" , dev->data->name);return 0 ;
@@ -2386,8 +2384,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) ret =of_init ();if (ret) { -RTE_LOG (ERR ,PMD , -"of_init failed\n" ); +CAAM_JR_ERR ("of_init failed" );return -EINVAL ; }/* if sec device version is not configured */
@@ -2407,8 +2404,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) }#ifdef RTE_LIBRTE_PMD_CAAM_JR_BE if (rta_get_sec_era () >RTA_SEC_ERA_8 ) { -RTE_LOG (ERR ,PMD , -"CAAM is compiled in BE mode for device with sec era > 8???\n" ); +CAAM_JR_ERR ("CAAM is compiled in BE mode for device with sec era > 8???" );return -EINVAL ; }#endif
drivers/crypto/caam_jr/caam_jr_log.h +6 -6
@@ -10,13 +10,13 @@extern int caam_jr_logtype;#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype -#define CAAM_JR_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \ - fmt "\n", ##args) +#define CAAM_JR_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, caam_jr_logtype, \ + "caam_jr: " fmt "\n", ##args) -#define CAAM_JR_DEBUG(fmt, args...) \ - rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \ - fmt "\n", __func__, ##args) +#define CAAM_JR_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, caam_jr_logtype, \ + "caam_jr: %s(): " fmt "\n", __func__, ##args)#define PMD_INIT_FUNC_TRACE () CAAM_JR_DEBUG(" >>")
drivers/crypto/caam_jr/caam_jr_uio.c +2 -2
@@ -338,7 +338,7 @@ free_job_ring(int uio_fd) }if (job_ring ==NULL ) { -CAAM_JR_ERR ("JR not available for fd = %x\n" , uio_fd); +CAAM_JR_ERR ("JR not available for fd = %x" , uio_fd);return ; }
@@ -441,7 +441,7 @@ sec_configure(void) dir->d_name, "name", uio_name);CAAM_JR_INFO ("sec device uio name: %s" , uio_name);if (ret !=0 ) { -CAAM_JR_ERR ("file_read_first_line failed\n" ); +CAAM_JR_ERR ("file_read_first_line failed" );closedir (d);return -1 ; }
Signature · 1 line
2.43.0
PATCH v5 12/18 crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype
In reply to Stephen HemmingerA couple of messages were using RTE_LOGTYPE_PMD when dedicated logtype was already available.
--- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++--- drivers/crypto/dpaa_sec/dpaa_sec.c | 30 ++++++++++----------- 2 files changed, 17 insertions(+), 19 deletions(-)
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +3 -3
@@ -4153,7 +4153,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_opr (dpseci,CMD_PRI_LOW , priv->token, qp_id,OPR_OPT_CREATE , &ocfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error setting opr: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error setting opr: ret: %d" , ret);return ret; } qp->tx_vq.cb_eqresp_free = dpaa2_sec_free_eqresp_buf;
@@ -4163,7 +4163,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) { -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
@@ -4188,7 +4188,7 @@ dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev, ret =dpseci_set_rx_queue (dpseci,CMD_PRI_LOW , priv->token, qp_id, &cfg);if (ret) -RTE_LOG (ERR ,PMD ,"Error in dpseci_set_queue: ret: %d\n" , ret); +DPAA2_SEC_ERR ("Error in dpseci_set_queue: ret: %d" , ret);return ret; }
drivers/crypto/dpaa_sec/dpaa_sec.c +14 -16
@@ -102,7 +102,7 @@ ern_sec_fq_handler(struct qman_portal *qm __rte_unused, struct qman_fq *fq, const struct qm_mr_entry *msg) { - DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x\n", + DPAA_SEC_DP_ERR("sec fq %d error, RC = %x, seqnum = %x", fq->fqid, msg->ern.rc, msg->ern.seqnum); }
@@ -849,7 +849,7 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) op->status =RTE_CRYPTO_OP_STATUS_SUCCESS ; }else {if (dpaa_sec_dp_dump >DPAA_SEC_DP_NO_DUMP ) { -DPAA_SEC_DP_WARN ("SEC return err:0x%x\n" , +DPAA_SEC_DP_WARN ("SEC return err:0x%x" , ctx->fd_status);if (dpaa_sec_dp_dump >DPAA_SEC_DP_ERR_DUMP )dpaa_sec_dump (ctx, qp);
@@ -1943,8 +1943,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, } }else if (unlikely (ses->qp[rte_lcore_id () %MAX_DPAA_CORES ] != qp)) { -DPAA_SEC_DP_ERR ("Old:sess->qp = %p" -" New qp = %p\n" , +DPAA_SEC_DP_ERR ("Old: sess->qp = %p New qp = %p" , ses->qp[rte_lcore_id () %MAX_DPAA_CORES ], qp); frames_to_send = loop;
@@ -2054,7 +2053,7 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, fd->cmd =0x80000000 | *((uint32_t *)((uint8_t *)op + ses->pdcp.hfn_ovd_offset)); -DPAA_SEC_DP_DEBUG ("Per packet HFN: %x, ovd:%u\n" , +DPAA_SEC_DP_DEBUG ("Per packet HFN: %x, ovd:%u" , *((uint32_t *)((uint8_t *)op + ses->pdcp.hfn_ovd_offset)), ses->pdcp.hfn_ovd);
@@ -2095,7 +2094,7 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, dpaa_qp->rx_pkts += num_rx; dpaa_qp->rx_errs += nb_ops - num_rx; -DPAA_SEC_DP_DEBUG ("SEC Received %d Packets\n" , num_rx); +DPAA_SEC_DP_DEBUG ("SEC Received %d Packets" , num_rx);return num_rx; }
@@ -2158,7 +2157,7 @@ dpaa_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,NULL ,NULL ,NULL ,NULL , SOCKET_ID_ANY, 0);if (!qp->ctx_pool) { -DPAA_SEC_ERR ("%s create failed\n" , str); +DPAA_SEC_ERR ("%s create failed" , str);return -ENOMEM ; } }else
@@ -2459,7 +2458,7 @@ dpaa_sec_aead_init(struct rte_cryptodev *dev __rte_unused, session->aead_key.data =rte_zmalloc (NULL , xform->aead.key.length,RTE_CACHE_LINE_SIZE );if (session->aead_key.data ==NULL && xform->aead.key.length >0 ) { -DPAA_SEC_ERR ("No Memory for aead key\n" ); +DPAA_SEC_ERR ("No Memory for aead key" );return -ENOMEM ; } session->aead_key.length = xform->aead.key.length;
@@ -2508,7 +2507,7 @@ dpaa_sec_detach_rxq(struct dpaa_sec_dev_private *qi, struct qman_fq *fq)for (i =0 ; i <RTE_DPAA_MAX_RX_QUEUE ; i++) {if (&qi->inq[i] == fq) {if (qman_retire_fq (fq,NULL ) !=0 ) -DPAA_SEC_DEBUG ("Queue is not retired\n" ); +DPAA_SEC_DEBUG ("Queue is not retired" );qman_oos_fq (fq); qi->inq_attach[i] =0 ;return 0 ;
@@ -3483,7 +3482,7 @@ dpaa_sec_eventq_attach(const struct rte_cryptodev *dev, qp->outq.cb.dqrr_dpdk_cb = dpaa_sec_process_atomic_event;break ;case RTE_SCHED_TYPE_ORDERED : -DPAA_SEC_ERR ("Ordered queue schedule type is not supported\n" ); +DPAA_SEC_ERR ("Ordered queue schedule type is not supported" );return -ENOTSUP ;default : opts.fqd.fq_ctrl |=QM_FQCTRL_AVOIDBLOCK ;
@@ -3518,7 +3517,7 @@ dpaa_sec_eventq_detach(const struct rte_cryptodev *dev,qman_oos_fq (&qp->outq); ret =qman_init_fq (&qp->outq,0 , &opts);if (ret) -RTE_LOG (ERR ,PMD ,"Error in qman_init_fq: ret: %d\n" , ret); +DPAA_SEC_ERR ("Error in qman_init_fq: ret: %d" , ret); qp->outq.cb.dqrr =NULL ;return ret;
@@ -3581,8 +3580,7 @@ check_devargs_handler(__rte_unused const char *key, const char *value, { dpaa_sec_dp_dump =atoi (value);if (dpaa_sec_dp_dump >DPAA_SEC_DP_FULL_DUMP ) { -DPAA_SEC_WARN ("WARN: DPAA_SEC_DP_DUMP_LEVEL is not " -"supported, changing to FULL error prints\n" ); +DPAA_SEC_WARN ("WARN: DPAA_SEC_DP_DUMP_LEVEL is not supported, changing to FULL error prints" ); dpaa_sec_dp_dump =DPAA_SEC_DP_FULL_DUMP ; }
@@ -3645,7 +3643,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev) ret =munmap (internals->sec_hw,MAP_SIZE );if (ret) -DPAA_SEC_WARN ("munmap failed\n" ); +DPAA_SEC_WARN ("munmap failed" );close (map_fd); cryptodev->driver_id = dpaa_cryptodev_driver_id;
@@ -3709,11 +3707,11 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev)dpaa_sec_get_devargs (cryptodev->device->devargs,DRIVER_DUMP_MODE ); -RTE_LOG (INFO ,PMD ,"%s cryptodev init\n" , cryptodev->data->name); +DPAA_SEC_INFO ("%s cryptodev init" , cryptodev->data->name);return 0 ; init_error: -DPAA_SEC_ERR ("driver %s: create failed\n" , cryptodev->data->name); +DPAA_SEC_ERR ("driver %s: create failed" , cryptodev->data->name);rte_free (cryptodev->security_ctx);return -EFAULT ;
Signature · 1 line
2.43.0
PATCH v5 13/18 event/dlb2: use dedicated logtype
In reply to Stephen HemmingerDriver was using RTE_LOGTYPE_PMD when it had its own logtype.
--- drivers/event/dlb2/dlb2.c | 275 +++++++++++++++++++------------------- 1 file changed, 137 insertions(+), 138 deletions(-)
drivers/event/dlb2/dlb2.c +137 -138
@@ -169,7 +169,7 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2) ret =dlb2_iface_get_num_resources (handle, &dlb2->hw_rsrc_query_results);if (ret) { -DLB2_LOG_ERR ("ioctl get dlb2 num resources, err=%d\n" , ret); +DLB2_LOG_ERR ("ioctl get dlb2 num resources, err=%d" , ret);return ret; }
@@ -259,7 +259,7 @@ set_producer_coremask(const char *key __rte_unused,const char **mask_str = opaque;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -293,7 +293,7 @@ set_max_cq_depth(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -304,7 +304,7 @@ set_max_cq_depth(const char *key __rte_unused,if (*max_cq_depth <DLB2_MIN_CQ_DEPTH_OVERRIDE || *max_cq_depth >DLB2_MAX_CQ_DEPTH_OVERRIDE || !rte_is_power_of_2 (*max_cq_depth)) { -DLB2_LOG_ERR ("dlb2: max_cq_depth %d and %d and a power of 2\n" , +DLB2_LOG_ERR ("dlb2: max_cq_depth %d and %d and a power of 2" ,DLB2_MIN_CQ_DEPTH_OVERRIDE ,DLB2_MAX_CQ_DEPTH_OVERRIDE );return -EINVAL ;
@@ -322,7 +322,7 @@ set_max_enq_depth(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -333,7 +333,7 @@ set_max_enq_depth(const char *key __rte_unused,if (*max_enq_depth <DLB2_MIN_ENQ_DEPTH_OVERRIDE || *max_enq_depth >DLB2_MAX_ENQ_DEPTH_OVERRIDE || !rte_is_power_of_2 (*max_enq_depth)) { -DLB2_LOG_ERR ("dlb2: max_enq_depth %d and %d and a power of 2\n" , +DLB2_LOG_ERR ("dlb2: max_enq_depth %d and %d and a power of 2" ,DLB2_MIN_ENQ_DEPTH_OVERRIDE ,DLB2_MAX_ENQ_DEPTH_OVERRIDE );return -EINVAL ;
@@ -351,7 +351,7 @@ set_max_num_events(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -361,7 +361,7 @@ set_max_num_events(const char *key __rte_unused,if (*max_num_events <0 || *max_num_events >DLB2_MAX_NUM_LDB_CREDITS ) { -DLB2_LOG_ERR ("dlb2: max_num_events must be between 0 and %d\n" , +DLB2_LOG_ERR ("dlb2: max_num_events must be between 0 and %d" ,DLB2_MAX_NUM_LDB_CREDITS );return -EINVAL ; }
@@ -378,7 +378,7 @@ set_num_dir_credits(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -388,7 +388,7 @@ set_num_dir_credits(const char *key __rte_unused,if (*num_dir_credits <0 || *num_dir_credits >DLB2_MAX_NUM_DIR_CREDITS (DLB2_HW_V2 )) { -DLB2_LOG_ERR ("dlb2: num_dir_credits must be between 0 and %d\n" , +DLB2_LOG_ERR ("dlb2: num_dir_credits must be between 0 and %d" ,DLB2_MAX_NUM_DIR_CREDITS (DLB2_HW_V2 ));return -EINVAL ; }
@@ -405,7 +405,7 @@ set_dev_id(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -425,7 +425,7 @@ set_poll_interval(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -445,7 +445,7 @@ set_port_cos(const char *key __rte_unused,int first, last, cos_id, i;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -458,18 +458,18 @@ set_port_cos(const char *key __rte_unused, }else if (sscanf (value,"%d:%d" , &first, &cos_id) ==2 ) { last = first; }else { -DLB2_LOG_ERR ("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val\n" ); +DLB2_LOG_ERR ("Error parsing ldb port port_cos devarg. Should be port-port:val, or port:val" );return -EINVAL ; }if (first > last || first <0 || last >=DLB2_MAX_NUM_LDB_PORTS ) { -DLB2_LOG_ERR ("Error parsing ldb port cos_id arg, invalid port value\n" ); +DLB2_LOG_ERR ("Error parsing ldb port cos_id arg, invalid port value" );return -EINVAL ; }if (cos_id <DLB2_COS_0 || cos_id >DLB2_COS_3 ) { -DLB2_LOG_ERR ("Error parsing ldb port cos_id devarg, must be between 0 and 4\n" ); +DLB2_LOG_ERR ("Error parsing ldb port cos_id devarg, must be between 0 and 4" );return -EINVAL ; }
@@ -487,7 +487,7 @@ set_cos_bw(const char *key __rte_unused,struct dlb2_cos_bw *cos_bw = opaque;if (opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -495,11 +495,11 @@ set_cos_bw(const char *key __rte_unused,if (sscanf (value,"%d:%d:%d:%d" , &cos_bw->val[0 ], &cos_bw->val[1 ], &cos_bw->val[2 ], &cos_bw->val[3 ]) !=4 ) { -DLB2_LOG_ERR ("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100\n" ); +DLB2_LOG_ERR ("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100" );return -EINVAL ; }if (cos_bw->val[0 ] + cos_bw->val[1 ] + cos_bw->val[2 ] + cos_bw->val[3 ] >100 ) { -DLB2_LOG_ERR ("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100\n" ); +DLB2_LOG_ERR ("Error parsing cos bandwidth devarg. Should be bw0:bw1:bw2:bw3 where all values combined are <= 100" );return -EINVAL ; }
@@ -515,7 +515,7 @@ set_sw_credit_quanta(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -524,7 +524,7 @@ set_sw_credit_quanta(const char *key __rte_unused,return ret;if (*sw_credit_quanta <=0 ) { -DLB2_LOG_ERR ("sw_credit_quanta must be > 0\n" ); +DLB2_LOG_ERR ("sw_credit_quanta must be > 0" );return -EINVAL ; }
@@ -540,7 +540,7 @@ set_hw_credit_quanta(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -560,7 +560,7 @@ set_default_depth_thresh(const char *key __rte_unused,int ret;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -579,7 +579,7 @@ set_vector_opts_enab(const char *key __rte_unused,bool *dlb2_vector_opts_enabled = opaque;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -599,7 +599,7 @@ set_default_ldb_port_allocation(const char *key __rte_unused,bool *default_ldb_port_allocation = opaque;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -619,7 +619,7 @@ set_enable_cq_weight(const char *key __rte_unused,bool *enable_cq_weight = opaque;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -640,7 +640,7 @@ set_qid_depth_thresh(const char *key __rte_unused,int first, last, thresh, i;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -657,18 +657,18 @@ set_qid_depth_thresh(const char *key __rte_unused, }else if (sscanf (value,"%d:%d" , &first, &thresh) ==2 ) { last = first; }else { -DLB2_LOG_ERR ("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n" ); +DLB2_LOG_ERR ("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val" );return -EINVAL ; }if (first > last || first <0 || last >=DLB2_MAX_NUM_QUEUES (DLB2_HW_V2 )) { -DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value\n" ); +DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value" );return -EINVAL ; }if (thresh <0 || thresh >DLB2_MAX_QUEUE_DEPTH_THRESHOLD ) { -DLB2_LOG_ERR ("Error parsing qid depth devarg, threshold > %d\n" , +DLB2_LOG_ERR ("Error parsing qid depth devarg, threshold > %d" ,DLB2_MAX_QUEUE_DEPTH_THRESHOLD );return -EINVAL ; }
@@ -688,7 +688,7 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused,int first, last, thresh, i;if (value ==NULL || opaque ==NULL ) { -DLB2_LOG_ERR ("NULL pointer\n" ); +DLB2_LOG_ERR ("NULL pointer" );return -EINVAL ; }
@@ -705,18 +705,18 @@ set_qid_depth_thresh_v2_5(const char *key __rte_unused, }else if (sscanf (value,"%d:%d" , &first, &thresh) ==2 ) { last = first; }else { -DLB2_LOG_ERR ("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val\n" ); +DLB2_LOG_ERR ("Error parsing qid depth devarg. Should be all:val, qid-qid:val, or qid:val" );return -EINVAL ; }if (first > last || first <0 || last >=DLB2_MAX_NUM_QUEUES (DLB2_HW_V2_5 )) { -DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value\n" ); +DLB2_LOG_ERR ("Error parsing qid depth devarg, invalid qid value" );return -EINVAL ; }if (thresh <0 || thresh >DLB2_MAX_QUEUE_DEPTH_THRESHOLD ) { -DLB2_LOG_ERR ("Error parsing qid depth devarg, threshold > %d\n" , +DLB2_LOG_ERR ("Error parsing qid depth devarg, threshold > %d" ,DLB2_MAX_QUEUE_DEPTH_THRESHOLD );return -EINVAL ; }
@@ -738,7 +738,7 @@ dlb2_eventdev_info_get(struct rte_eventdev *dev,if (ret) {const struct rte_eventdev_data *data = dev->data; -DLB2_LOG_ERR ("get resources err=%d, devid=%d\n" , +DLB2_LOG_ERR ("get resources err=%d, devid=%d" , ret, data->dev_id);/* fn is void, so fall through and return values set up in * probe
@@ -781,7 +781,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,struct dlb2_create_sched_domain_args *cfg;if (resources_asked ==NULL ) { -DLB2_LOG_ERR ("dlb2: dlb2_create NULL parameter\n" ); +DLB2_LOG_ERR ("dlb2: dlb2_create NULL parameter" ); ret =EINVAL ; goto error_exit; }
@@ -809,7 +809,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2,if (cos_ports > resources_asked->num_ldb_ports || (cos_ports && dlb2->max_cos_port >= resources_asked->num_ldb_ports)) { -DLB2_LOG_ERR ("dlb2: num_ldb_ports < cos_ports\n" ); +DLB2_LOG_ERR ("dlb2: num_ldb_ports < cos_ports" ); ret =EINVAL ; goto error_exit; }
@@ -832,7 +832,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2, evdev_dlb2_default_info.max_event_port_dequeue_depth;if (device_version ==DLB2_HW_V2_5 ) { - DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d\n", + DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, credits=%d", cfg->num_ldb_queues, resources_asked->num_ldb_ports, cfg->num_dir_ports,
@@ -840,7 +840,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2, cfg->num_hist_list_entries, cfg->num_credits); }else { - DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d\n", + DLB2_LOG_DBG("sched domain create - ldb_qs=%d, ldb_ports=%d, dir_ports=%d, atomic_inflights=%d, hist_list_entries=%d, ldb_credits=%d, dir_credits=%d", cfg->num_ldb_queues, resources_asked->num_ldb_ports, cfg->num_dir_ports,
@@ -854,7 +854,7 @@ dlb2_hw_create_sched_domain(struct dlb2_eventdev *dlb2, ret =dlb2_iface_sched_domain_create (handle, cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: domain create failed, ret = %d, extra status: %s\n" , +DLB2_LOG_ERR ("dlb2: domain create failed, ret = %d, extra status: %s" , ret, dlb2_error_strings[cfg->response.status]);
@@ -930,27 +930,27 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)dlb2_hw_reset_sched_domain (dev, true); ret =dlb2_hw_query_resources (dlb2);if (ret) { -DLB2_LOG_ERR ("get resources err=%d, devid=%d\n" , +DLB2_LOG_ERR ("get resources err=%d, devid=%d" , ret, data->dev_id);return ret; } }if (config->nb_event_queues > rsrcs->num_queues) { -DLB2_LOG_ERR ("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d).\n" , +DLB2_LOG_ERR ("nb_event_queues parameter (%d) exceeds the QM device's capabilities (%d)." , config->nb_event_queues, rsrcs->num_queues);return -EINVAL ; }if (config->nb_event_ports > (rsrcs->num_ldb_ports + rsrcs->num_dir_ports)) { -DLB2_LOG_ERR ("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d).\n" , +DLB2_LOG_ERR ("nb_event_ports parameter (%d) exceeds the QM device's capabilities (%d)." , config->nb_event_ports, (rsrcs->num_ldb_ports + rsrcs->num_dir_ports));return -EINVAL ; }if (config->nb_events_limit > rsrcs->nb_events_limit) { -DLB2_LOG_ERR ("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d).\n" , +DLB2_LOG_ERR ("nb_events_limit parameter (%d) exceeds the QM device's capabilities (%d)." , config->nb_events_limit, rsrcs->nb_events_limit);return -EINVAL ;
@@ -1000,7 +1000,7 @@ dlb2_eventdev_configure(const struct rte_eventdev *dev)if (dlb2_hw_create_sched_domain (dlb2, handle, rsrcs, dlb2->version) <0 ) { -DLB2_LOG_ERR ("dlb2_hw_create_sched_domain failed\n" ); +DLB2_LOG_ERR ("dlb2_hw_create_sched_domain failed" );return -ENODEV ; }
@@ -1068,7 +1068,7 @@ dlb2_get_sn_allocation(struct dlb2_eventdev *dlb2, int group) ret =dlb2_iface_get_sn_allocation (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: get_sn_allocation ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: get_sn_allocation ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -1088,7 +1088,7 @@ dlb2_set_sn_allocation(struct dlb2_eventdev *dlb2, int group, int num) ret =dlb2_iface_set_sn_allocation (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: set_sn_allocation ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: set_sn_allocation ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -1107,7 +1107,7 @@ dlb2_get_sn_occupancy(struct dlb2_eventdev *dlb2, int group) ret =dlb2_iface_get_sn_occupancy (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: get_sn_occupancy ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: get_sn_occupancy ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -1161,7 +1161,7 @@ dlb2_program_sn_allocation(struct dlb2_eventdev *dlb2, }if (i ==DLB2_NUM_SN_GROUPS ) { -DLB2_LOG_ERR ("[%s()] No groups with %d sequence_numbers are available or have free slots\n" , +DLB2_LOG_ERR ("[%s()] No groups with %d sequence_numbers are available or have free slots" , __func__, sequence_numbers);return ; }
@@ -1236,7 +1236,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2, ret =dlb2_iface_ldb_queue_create (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: create LB event queue error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: create LB event queue error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return -EINVAL ; }
@@ -1250,7 +1250,7 @@ dlb2_hw_create_ldb_queue(struct dlb2_eventdev *dlb2, queue->sched_type = sched_type; queue->config_state =DLB2_CONFIGURED ; - DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d\n", + DLB2_LOG_DBG("Created LB event queue %d, nb_inflights=%d, nb_seq=%d, qid inflights=%d", qm_qid, cfg.num_atomic_inflights, cfg.num_sequence_numbers,
@@ -1272,7 +1272,7 @@ dlb2_eventdev_ldb_queue_setup(struct rte_eventdev *dev, qm_qid =dlb2_hw_create_ldb_queue (dlb2, ev_queue, queue_conf);if (qm_qid <0 ) { -DLB2_LOG_ERR ("Failed to create the load-balanced queue\n" ); +DLB2_LOG_ERR ("Failed to create the load-balanced queue" );return qm_qid; }
@@ -1380,7 +1380,7 @@ dlb2_init_consume_qe(struct dlb2_port *qm_port, char *mz_name) RTE_CACHE_LINE_SIZE);if (qe ==NULL ) { -DLB2_LOG_ERR ("dlb2: no memory for consume_qe\n" ); +DLB2_LOG_ERR ("dlb2: no memory for consume_qe" );return -ENOMEM ; } qm_port->consume_qe = qe;
@@ -1412,7 +1412,7 @@ dlb2_init_int_arm_qe(struct dlb2_port *qm_port, char *mz_name) RTE_CACHE_LINE_SIZE);if (qe ==NULL ) { -DLB2_LOG_ERR ("dlb2: no memory for complete_qe\n" ); +DLB2_LOG_ERR ("dlb2: no memory for complete_qe" );return -ENOMEM ; } qm_port->int_arm_qe = qe;
@@ -1440,20 +1440,20 @@ dlb2_init_qe_mem(struct dlb2_port *qm_port, char *mz_name) qm_port->qe4 =rte_zmalloc (mz_name, sz,RTE_CACHE_LINE_SIZE );if (qm_port->qe4 ==NULL ) { -DLB2_LOG_ERR ("dlb2: no qe4 memory\n" ); +DLB2_LOG_ERR ("dlb2: no qe4 memory" ); ret = -ENOMEM ; goto error_exit; } ret =dlb2_init_int_arm_qe (qm_port, mz_name);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: dlb2_init_int_arm_qe ret=%d\n" , ret); +DLB2_LOG_ERR ("dlb2: dlb2_init_int_arm_qe ret=%d" , ret); goto error_exit; } ret =dlb2_init_consume_qe (qm_port, mz_name);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: dlb2_init_consume_qe ret=%d\n" , ret); +DLB2_LOG_ERR ("dlb2: dlb2_init_consume_qe ret=%d" , ret); goto error_exit; }
@@ -1536,14 +1536,14 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,return -EINVAL ;if (dequeue_depth <DLB2_MIN_CQ_DEPTH ) { -DLB2_LOG_ERR ("dlb2: invalid cq depth, must be at least %d\n" , +DLB2_LOG_ERR ("dlb2: invalid cq depth, must be at least %d" ,DLB2_MIN_CQ_DEPTH );return -EINVAL ; }if (dlb2->version ==DLB2_HW_V2 && ev_port->cq_weight !=0 && ev_port->cq_weight > dequeue_depth) { -DLB2_LOG_ERR ("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d\n" , +DLB2_LOG_ERR ("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d" , dequeue_depth, ev_port->cq_weight);return -EINVAL ; }
@@ -1579,14 +1579,14 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, ret =dlb2_iface_ldb_port_create (handle, &cfg, dlb2->poll_mode);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: dlb2_ldb_port_create error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: dlb2_ldb_port_create error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]); goto error_exit; } qm_port_id = cfg.response.id; -DLB2_LOG_DBG ("dlb2: ev_port %d uses qm LB port %d <<<<<\n" , +DLB2_LOG_DBG ("dlb2: ev_port %d uses qm LB port %d <<<<<" , ev_port->id, qm_port_id); qm_port = &ev_port->qm_port;
@@ -1602,7 +1602,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, ret =dlb2_init_qe_mem (qm_port, mz_name);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: init_qe_mem failed, ret=%d\n" , ret); +DLB2_LOG_ERR ("dlb2: init_qe_mem failed, ret=%d" , ret); goto error_exit; }
@@ -1615,7 +1615,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, ret =dlb2_iface_enable_cq_weight (handle, &cq_weight_args);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response. status]); goto error_exit;
@@ -1680,7 +1680,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d\n", + DLB2_LOG_DBG("dlb2: created ldb port %d, depth = %d, ldb credits=%d, dir credits=%d", qm_port_id, dequeue_depth, qm_port->ldb_credits,
@@ -1689,7 +1689,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->credits = credit_high_watermark; qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; -DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, credits=%d\n" , +DLB2_LOG_DBG ("dlb2: created ldb port %d, depth = %d, credits=%d" , qm_port_id, dequeue_depth, qm_port->credits);
@@ -1717,7 +1717,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,rte_spinlock_unlock (&handle->resource_lock); -DLB2_LOG_ERR ("dlb2: create ldb port failed!\n" ); +DLB2_LOG_ERR ("dlb2: create ldb port failed!" );return ret; }
@@ -1761,13 +1761,13 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,return -EINVAL ;if (dequeue_depth <DLB2_MIN_CQ_DEPTH ) { -DLB2_LOG_ERR ("dlb2: invalid dequeue_depth, must be %d-%d\n" , +DLB2_LOG_ERR ("dlb2: invalid dequeue_depth, must be %d-%d" ,DLB2_MIN_CQ_DEPTH ,DLB2_MAX_INPUT_QUEUE_DEPTH );return -EINVAL ; }if (enqueue_depth <DLB2_MIN_ENQUEUE_DEPTH ) { -DLB2_LOG_ERR ("dlb2: invalid enqueue_depth, must be at least %d\n" , +DLB2_LOG_ERR ("dlb2: invalid enqueue_depth, must be at least %d" ,DLB2_MIN_ENQUEUE_DEPTH );return -EINVAL ; }
@@ -1802,14 +1802,14 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, ret =dlb2_iface_dir_port_create (handle, &cfg, dlb2->poll_mode);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: dlb2_dir_port_create error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]); goto error_exit; } qm_port_id = cfg.response.id; -DLB2_LOG_DBG ("dlb2: ev_port %d uses qm DIR port %d <<<<<\n" , +DLB2_LOG_DBG ("dlb2: ev_port %d uses qm DIR port %d <<<<<" , ev_port->id, qm_port_id); qm_port = &ev_port->qm_port;
@@ -1827,7 +1827,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, ret =dlb2_init_qe_mem (qm_port, mz_name);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: init_qe_mem failed, ret=%d\n" , ret); +DLB2_LOG_ERR ("dlb2: init_qe_mem failed, ret=%d" , ret); goto error_exit; }
@@ -1881,7 +1881,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->credit_pool[DLB2_DIR_QUEUE ] = &dlb2->dir_credit_pool; qm_port->credit_pool[DLB2_LDB_QUEUE ] = &dlb2->ldb_credit_pool; - DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d,%d\n", + DLB2_LOG_DBG("dlb2: created dir port %d, depth = %d cr=%d,%d", qm_port_id, dequeue_depth, dir_credit_high_watermark,
@@ -1890,7 +1890,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->credits = credit_high_watermark; qm_port->credit_pool[DLB2_COMBINED_POOL ] = &dlb2->credit_pool; -DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d\n" , +DLB2_LOG_DBG ("dlb2: created dir port %d, depth = %d cr=%d" , qm_port_id, dequeue_depth, credit_high_watermark);
@@ -1916,7 +1916,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,rte_spinlock_unlock (&handle->resource_lock); -DLB2_LOG_ERR ("dlb2: create dir port failed!\n" ); +DLB2_LOG_ERR ("dlb2: create dir port failed!" );return ret; }
@@ -1932,7 +1932,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,int ret;if (dev ==NULL || port_conf ==NULL ) { -DLB2_LOG_ERR ("Null parameter\n" ); +DLB2_LOG_ERR ("Null parameter" );return -EINVAL ; }
@@ -1950,7 +1950,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev, ev_port = &dlb2->ev_ports[ev_port_id];/* configured? */ if (ev_port->setup_done) { -DLB2_LOG_ERR ("evport %d is already configured\n" , ev_port_id); +DLB2_LOG_ERR ("evport %d is already configured" , ev_port_id);return -EINVAL ; }
@@ -1982,7 +1982,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,if (port_conf->enqueue_depth > sw_credit_quanta || port_conf->enqueue_depth > hw_credit_quanta) { -DLB2_LOG_ERR ("Invalid port config. Enqueue depth %d must be <= credit quanta %d and batch size %d\n" , +DLB2_LOG_ERR ("Invalid port config. Enqueue depth %d must be <= credit quanta %d and batch size %d" , port_conf->enqueue_depth, sw_credit_quanta, hw_credit_quanta);
@@ -2004,7 +2004,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev, port_conf->dequeue_depth, port_conf->enqueue_depth);if (ret <0 ) { -DLB2_LOG_ERR ("Failed to create the lB port ve portId=%d\n" , +DLB2_LOG_ERR ("Failed to create the lB port ve portId=%d" , ev_port_id);return ret;
@@ -2015,7 +2015,7 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev, port_conf->dequeue_depth, port_conf->enqueue_depth);if (ret <0 ) { -DLB2_LOG_ERR ("Failed to create the DIR port\n" ); +DLB2_LOG_ERR ("Failed to create the DIR port" );return ret; } }
@@ -2082,14 +2082,14 @@ dlb2_hw_map_ldb_qid_to_port(struct dlb2_hw_dev *handle, ret =dlb2_iface_map_qid (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: map qid error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: map qid error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]); -DLB2_LOG_ERR ("dlb2: grp=%d, qm_port=%d, qm_qid=%d prio=%d\n" , +DLB2_LOG_ERR ("dlb2: grp=%d, qm_port=%d, qm_qid=%d prio=%d" , handle->domain_id, cfg.port_id, cfg.qid, cfg.priority); }else { -DLB2_LOG_DBG ("dlb2: mapped queue %d to qm_port %d\n" , +DLB2_LOG_DBG ("dlb2: mapped queue %d to qm_port %d" , qm_qid, qm_port_id); }
@@ -2117,7 +2117,7 @@ dlb2_event_queue_join_ldb(struct dlb2_eventdev *dlb2, first_avail = i; }if (first_avail ==-1 ) { -DLB2_LOG_ERR ("dlb2: qm_port %d has no available QID slots.\n" , +DLB2_LOG_ERR ("dlb2: qm_port %d has no available QID slots." , ev_port->qm_port.id);return -EINVAL ; }
@@ -2154,7 +2154,7 @@ dlb2_hw_create_dir_queue(struct dlb2_eventdev *dlb2, ret =dlb2_iface_dir_queue_create (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: create DIR event queue error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: create DIR event queue error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return -EINVAL ; }
@@ -2172,7 +2172,7 @@ dlb2_eventdev_dir_queue_setup(struct dlb2_eventdev *dlb2, qm_qid =dlb2_hw_create_dir_queue (dlb2, ev_queue, ev_port->qm_port.id);if (qm_qid <0 ) { -DLB2_LOG_ERR ("Failed to create the DIR queue\n" ); +DLB2_LOG_ERR ("Failed to create the DIR queue" );return qm_qid; }
@@ -2202,7 +2202,7 @@ dlb2_do_port_link(struct rte_eventdev *dev, err =dlb2_event_queue_join_ldb (dlb2, ev_port, ev_queue, prio);if (err) { -DLB2_LOG_ERR ("port link failure for %s ev_q %d, ev_port %d\n" , +DLB2_LOG_ERR ("port link failure for %s ev_q %d, ev_port %d" , ev_queue->qm_queue.is_directed ?"DIR" :"LDB" , ev_queue->id, ev_port->id);
@@ -2240,7 +2240,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port, queue_is_dir = ev_queue->qm_queue.is_directed;if (port_is_dir != queue_is_dir) { -DLB2_LOG_ERR ("%s queue %u can't link to %s port %u\n" , +DLB2_LOG_ERR ("%s queue %u can't link to %s port %u" , queue_is_dir ?"DIR" :"LDB" , ev_queue->id, port_is_dir ?"DIR" :"LDB" , ev_port->id);
@@ -2250,7 +2250,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,/* Check if there is space for the requested link */ if (!link_exists && index ==-1 ) { -DLB2_LOG_ERR ("no space for new link\n" ); +DLB2_LOG_ERR ("no space for new link" ); rte_errno = -ENOSPC ;return -1 ; }
@@ -2258,7 +2258,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,/* Check if the directed port is already linked */ if (ev_port->qm_port.is_directed && ev_port->num_links >0 && !link_exists) { -DLB2_LOG_ERR ("Can't link DIR port %d to >1 queues\n" , +DLB2_LOG_ERR ("Can't link DIR port %d to >1 queues" , ev_port->id); rte_errno = -EINVAL ;return -1 ;
@@ -2267,7 +2267,7 @@ dlb2_validate_port_link(struct dlb2_eventdev_port *ev_port,/* Check if the directed queue is already linked */ if (ev_queue->qm_queue.is_directed && ev_queue->num_links >0 && !link_exists) { -DLB2_LOG_ERR ("Can't link DIR queue %d to >1 ports\n" , +DLB2_LOG_ERR ("Can't link DIR queue %d to >1 ports" , ev_queue->id); rte_errno = -EINVAL ;return -1 ;
@@ -2289,14 +2289,14 @@ dlb2_eventdev_port_link(struct rte_eventdev *dev, void *event_port,RTE_SET_USED (dev);if (ev_port ==NULL ) { -DLB2_LOG_ERR ("dlb2: evport not setup\n" ); +DLB2_LOG_ERR ("dlb2: evport not setup" ); rte_errno = -EINVAL ;return 0 ; }if (!ev_port->setup_done && ev_port->qm_port.config_state !=DLB2_PREV_CONFIGURED ) { -DLB2_LOG_ERR ("dlb2: evport not setup\n" ); +DLB2_LOG_ERR ("dlb2: evport not setup" ); rte_errno = -EINVAL ;return 0 ; }
@@ -2305,13 +2305,13 @@ dlb2_eventdev_port_link(struct rte_eventdev *dev, void *event_port,* queues pointer. */ if (nb_links ==0 ) { -DLB2_LOG_DBG ("dlb2: nb_links is 0\n" ); +DLB2_LOG_DBG ("dlb2: nb_links is 0" );return 0 ;/* Ignore and return success */ } dlb2 = ev_port->dlb2; -DLB2_LOG_DBG ("Linking %u queues to %s port %d\n" , +DLB2_LOG_DBG ("Linking %u queues to %s port %d" , nb_links, ev_port->qm_port.is_directed ?"DIR" :"LDB" , ev_port->id);
@@ -2381,7 +2381,7 @@ dlb2_hw_unmap_ldb_qid_from_port(struct dlb2_hw_dev *handle, ret =dlb2_iface_unmap_qid (handle, &cfg);if (ret <0 ) -DLB2_LOG_ERR ("dlb2: unmap qid error, ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: unmap qid error, ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret;
@@ -2408,7 +2408,7 @@ dlb2_event_queue_detach_ldb(struct dlb2_eventdev *dlb2,* It blindly attempts to unmap all queues. */ if (i ==DLB2_MAX_NUM_QIDS_PER_LDB_CQ ) { -DLB2_LOG_DBG ("dlb2: ignoring LB QID %d not mapped for qm_port %d.\n" , +DLB2_LOG_DBG ("dlb2: ignoring LB QID %d not mapped for qm_port %d." , ev_queue->qm_queue.id, ev_port->qm_port.id);return 0 ;
@@ -2434,19 +2434,19 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,RTE_SET_USED (dev);if (!ev_port->setup_done) { -DLB2_LOG_ERR ("dlb2: evport %d is not configured\n" , +DLB2_LOG_ERR ("dlb2: evport %d is not configured" , ev_port->id); rte_errno = -EINVAL ;return 0 ; }if (queues ==NULL || nb_unlinks ==0 ) { -DLB2_LOG_DBG ("dlb2: queues is NULL or nb_unlinks is 0\n" ); +DLB2_LOG_DBG ("dlb2: queues is NULL or nb_unlinks is 0" );return 0 ;/* Ignore and return success */ }if (ev_port->qm_port.is_directed) { -DLB2_LOG_DBG ("dlb2: ignore unlink from dir port %d\n" , +DLB2_LOG_DBG ("dlb2: ignore unlink from dir port %d" , ev_port->id); rte_errno =0 ;return nb_unlinks;/* as if success */
@@ -2459,7 +2459,7 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,int ret, j;if (queues[i] >= dlb2->num_queues) { -DLB2_LOG_ERR ("dlb2: invalid queue id %d\n" , queues[i]); +DLB2_LOG_ERR ("dlb2: invalid queue id %d" , queues[i]); rte_errno = -EINVAL ;return i;/* return index of offending queue */ }
@@ -2477,7 +2477,7 @@ dlb2_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port, ret =dlb2_event_queue_detach_ldb (dlb2, ev_port, ev_queue);if (ret) { -DLB2_LOG_ERR ("unlink err=%d for port %d queue %d\n" , +DLB2_LOG_ERR ("unlink err=%d for port %d queue %d" , ret, ev_port->id, queues[i]); rte_errno = -ENOENT ;return i;/* return index of offending queue */
@@ -2504,7 +2504,7 @@ dlb2_eventdev_port_unlinks_in_progress(struct rte_eventdev *dev,RTE_SET_USED (dev);if (!ev_port->setup_done) { -DLB2_LOG_ERR ("dlb2: evport %d is not configured\n" , +DLB2_LOG_ERR ("dlb2: evport %d is not configured" , ev_port->id); rte_errno = -EINVAL ;return 0 ;
@@ -2516,7 +2516,7 @@ dlb2_eventdev_port_unlinks_in_progress(struct rte_eventdev *dev, ret =dlb2_iface_pending_port_unmaps (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: num_unlinks_in_progress ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: num_unlinks_in_progress ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -2609,7 +2609,7 @@ dlb2_eventdev_start(struct rte_eventdev *dev)rte_spinlock_lock (&dlb2->qm_instance.resource_lock);if (dlb2->run_state !=DLB2_RUN_STATE_STOPPED ) { -DLB2_LOG_ERR ("bad state %d for dev_start\n" , +DLB2_LOG_ERR ("bad state %d for dev_start" , (int )dlb2->run_state);rte_spinlock_unlock (&dlb2->qm_instance.resource_lock);return -EINVAL ;
@@ -2645,13 +2645,13 @@ dlb2_eventdev_start(struct rte_eventdev *dev) ret =dlb2_iface_sched_domain_start (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: sched_domain_start ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: sched_domain_start ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; } dlb2->run_state =DLB2_RUN_STATE_STARTED ; -DLB2_LOG_DBG ("dlb2: sched_domain_start completed OK\n" ); +DLB2_LOG_DBG ("dlb2: sched_domain_start completed OK" );return 0 ; }
@@ -2746,7 +2746,7 @@ dlb2_check_enqueue_hw_ldb_credits(struct dlb2_port *qm_port)DLB2_INC_STAT ( qm_port->ev_port->stats.traffic.tx_nospc_ldb_hw_credits,1 ); -DLB2_LOG_DBG ("ldb credits exhausted\n" ); +DLB2_LOG_DBG ("ldb credits exhausted" );return 1 ;/* credits exhausted */ } }
@@ -2765,7 +2765,7 @@ dlb2_check_enqueue_hw_dir_credits(struct dlb2_port *qm_port)DLB2_INC_STAT ( qm_port->ev_port->stats.traffic.tx_nospc_dir_hw_credits,1 ); -DLB2_LOG_DBG ("dir credits exhausted\n" ); +DLB2_LOG_DBG ("dir credits exhausted" );return 1 ;/* credits exhausted */ } }
@@ -2783,7 +2783,7 @@ dlb2_check_enqueue_hw_credits(struct dlb2_port *qm_port)if (unlikely (qm_port->cached_credits ==0 )) {DLB2_INC_STAT ( qm_port->ev_port->stats.traffic.tx_nospc_hw_credits,1 ); -DLB2_LOG_DBG ("credits exhausted\n" ); +DLB2_LOG_DBG ("credits exhausted" );return 1 ;/* credits exhausted */ } }
@@ -2817,7 +2817,7 @@ dlb2_consume_qe_immediate(struct dlb2_port *qm_port, int num)dlb2_movntdq_single (port_data->pp_addr, qe); -DLB2_LOG_DBG ("dlb2: consume immediate - %d QEs\n" , num); +DLB2_LOG_DBG ("dlb2: consume immediate - %d QEs" , num); qm_port->owed_tokens =0 ;
@@ -2888,9 +2888,9 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port, }switch (ev->sched_type) {case RTE_SCHED_TYPE_ORDERED : -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED\n" ); +DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ORDERED" );if (qm_queue->sched_type !=RTE_SCHED_TYPE_ORDERED ) { -DLB2_LOG_ERR ("dlb2: tried to send ordered event to unordered queue %d\n" , +DLB2_LOG_ERR ("dlb2: tried to send ordered event to unordered queue %d" , *queue_id); rte_errno = -EINVAL ;return 1 ;
@@ -2898,18 +2898,18 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port, *sched_type =DLB2_SCHED_ORDERED ;break ;case RTE_SCHED_TYPE_ATOMIC : -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ATOMIC\n" ); +DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_ATOMIC" ); *sched_type =DLB2_SCHED_ATOMIC ;break ;case RTE_SCHED_TYPE_PARALLEL : -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_PARALLEL\n" ); +DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_PARALLEL" );if (qm_queue->sched_type ==RTE_SCHED_TYPE_ORDERED ) *sched_type =DLB2_SCHED_ORDERED ;else *sched_type =DLB2_SCHED_UNORDERED ;break ;default : -DLB2_LOG_ERR ("Unsupported LDB sched type in put_qe\n" ); +DLB2_LOG_ERR ("Unsupported LDB sched type in put_qe" );DLB2_INC_STAT (ev_port->stats.tx_invalid,1 ); rte_errno = -EINVAL ;return 1 ;
@@ -2930,7 +2930,7 @@ dlb2_event_enqueue_prep(struct dlb2_eventdev_port *ev_port, } cached_credits = &qm_port->cached_credits; } -DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED\n" ); +DLB2_LOG_DBG ("dlb2: put_qe: RTE_SCHED_TYPE_DIRECTED" ); *sched_type =DLB2_SCHED_DIRECTED ; }
@@ -3156,7 +3156,7 @@ dlb2_event_release(struct dlb2_eventdev *dlb2,int i;if (port_id > dlb2->num_ports) { -DLB2_LOG_ERR ("Invalid port id %d in dlb2-event_release\n" , +DLB2_LOG_ERR ("Invalid port id %d in dlb2-event_release" , port_id); rte_errno = -EINVAL ;return ;
@@ -3213,7 +3213,7 @@ dlb2_event_release(struct dlb2_eventdev *dlb2, sw_credit_update:/* each release returns one credit */ if (unlikely (!ev_port->outstanding_releases)) { -DLB2_LOG_ERR ("%s: Outstanding releases underflowed.\n" , +DLB2_LOG_ERR ("%s: Outstanding releases underflowed." , __func__);return ; }
@@ -3367,7 +3367,7 @@ dlb2_process_dequeue_qes(struct dlb2_eventdev_port *ev_port,* buffer is a mbuf. */ if (unlikely (qe->error)) { -DLB2_LOG_ERR ("QE error bit ON\n" ); +DLB2_LOG_ERR ("QE error bit ON" );DLB2_INC_STAT (ev_port->stats.traffic.rx_drop,1 );dlb2_consume_qe_immediate (qm_port,1 );continue ;/* Ignore */
@@ -4281,7 +4281,7 @@ dlb2_get_ldb_queue_depth(struct dlb2_eventdev *dlb2, ret =dlb2_iface_get_ldb_queue_depth (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: get_ldb_queue_depth ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: get_ldb_queue_depth ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -4301,7 +4301,7 @@ dlb2_get_dir_queue_depth(struct dlb2_eventdev *dlb2, ret =dlb2_iface_get_dir_queue_depth (handle, &cfg);if (ret <0 ) { -DLB2_LOG_ERR ("dlb2: get_dir_queue_depth ret=%d (driver status: %s)\n" , +DLB2_LOG_ERR ("dlb2: get_dir_queue_depth ret=%d (driver status: %s)" , ret, dlb2_error_strings[cfg.response.status]);return ret; }
@@ -4392,7 +4392,7 @@ dlb2_drain(struct rte_eventdev *dev) }if (i == dlb2->num_ports) { -DLB2_LOG_ERR ("internal error: no LDB ev_ports\n" ); +DLB2_LOG_ERR ("internal error: no LDB ev_ports" );return ; }
@@ -4400,7 +4400,7 @@ dlb2_drain(struct rte_eventdev *dev)rte_event_port_unlink (dev_id, ev_port->id,NULL ,0 );if (rte_errno) { -DLB2_LOG_ERR ("internal error: failed to unlink ev_port %d\n" , +DLB2_LOG_ERR ("internal error: failed to unlink ev_port %d" , ev_port->id);return ; }
@@ -4418,7 +4418,7 @@ dlb2_drain(struct rte_eventdev *dev)/* Link the ev_port to the queue */ ret =rte_event_port_link (dev_id, ev_port->id, &qid, &prio,1 );if (ret !=1 ) { -DLB2_LOG_ERR ("internal error: failed to link ev_port %d to queue %d\n" , +DLB2_LOG_ERR ("internal error: failed to link ev_port %d to queue %d" , ev_port->id, qid);return ; }
@@ -4433,7 +4433,7 @@ dlb2_drain(struct rte_eventdev *dev)/* Unlink the ev_port from the queue */ ret =rte_event_port_unlink (dev_id, ev_port->id, &qid,1 );if (ret !=1 ) { -DLB2_LOG_ERR ("internal error: failed to unlink ev_port %d to queue %d\n" , +DLB2_LOG_ERR ("internal error: failed to unlink ev_port %d to queue %d" , ev_port->id, qid);return ; }
@@ -4448,11 +4448,11 @@ dlb2_eventdev_stop(struct rte_eventdev *dev)rte_spinlock_lock (&dlb2->qm_instance.resource_lock);if (dlb2->run_state ==DLB2_RUN_STATE_STOPPED ) { -DLB2_LOG_DBG ("Internal error: already stopped\n" ); +DLB2_LOG_DBG ("Internal error: already stopped" );rte_spinlock_unlock (&dlb2->qm_instance.resource_lock);return ; }else if (dlb2->run_state !=DLB2_RUN_STATE_STARTED ) { -DLB2_LOG_ERR ("Internal error: bad state %d for dev_stop\n" , +DLB2_LOG_ERR ("Internal error: bad state %d for dev_stop" , (int )dlb2->run_state);rte_spinlock_unlock (&dlb2->qm_instance.resource_lock);return ;
@@ -4608,7 +4608,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev, err =dlb2_iface_open (&dlb2->qm_instance, name);if (err <0 ) { -DLB2_LOG_ERR ("could not open event hardware device, err=%d\n" , +DLB2_LOG_ERR ("could not open event hardware device, err=%d" , err);return err; }
@@ -4616,14 +4616,14 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev, err =dlb2_iface_get_device_version (&dlb2->qm_instance, &dlb2->revision);if (err <0 ) { -DLB2_LOG_ERR ("dlb2: failed to get the device version, err=%d\n" , +DLB2_LOG_ERR ("dlb2: failed to get the device version, err=%d" , err);return err; } err =dlb2_hw_query_resources (dlb2);if (err) { -DLB2_LOG_ERR ("get resources err=%d for %s\n" , +DLB2_LOG_ERR ("get resources err=%d for %s" , err, name);return err; }
@@ -4646,7 +4646,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,break ; }if (ret) { -DLB2_LOG_ERR ("dlb2: failed to configure class of service, err=%d\n" , +DLB2_LOG_ERR ("dlb2: failed to configure class of service, err=%d" , err);return err; }
@@ -4654,7 +4654,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev, err =dlb2_iface_get_cq_poll_mode (&dlb2->qm_instance, &dlb2->poll_mode);if (err <0 ) { -DLB2_LOG_ERR ("dlb2: failed to get the poll mode, err=%d\n" , +DLB2_LOG_ERR ("dlb2: failed to get the poll mode, err=%d" , err);return err; }
@@ -4662,7 +4662,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,/* Complete xtstats runtime initialization */ err =dlb2_xstats_init (dlb2);if (err) { -DLB2_LOG_ERR ("dlb2: failed to init xstats, err=%d\n" , err); +DLB2_LOG_ERR ("dlb2: failed to init xstats, err=%d" , err);return err; }
@@ -4692,14 +4692,14 @@ dlb2_secondary_eventdev_probe(struct rte_eventdev *dev, err =dlb2_iface_open (&dlb2->qm_instance, name);if (err <0 ) { -DLB2_LOG_ERR ("could not open event hardware device, err=%d\n" , +DLB2_LOG_ERR ("could not open event hardware device, err=%d" , err);return err; } err =dlb2_hw_query_resources (dlb2);if (err) { -DLB2_LOG_ERR ("get resources err=%d for %s\n" , +DLB2_LOG_ERR ("get resources err=%d for %s" , err, name);return err; }
@@ -4741,9 +4741,8 @@ dlb2_parse_params(const char *params,struct rte_kvargs *kvlist =rte_kvargs_parse (params, args);if (kvlist ==NULL ) { -RTE_LOG (INFO ,PMD , -"Ignoring unsupported parameters when creating device '%s'\n" , - name); +DLB2_LOG_INFO ("Ignoring unsupported parameters when creating device '%s'" , + name); }else { int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG, set_numa_node,
Signature · 1 line
2.43.0
PATCH v5 14/18 event/dpaa, event/dpaa2: use dedicated logtype
In reply to Stephen HemmingerDo not use RTE_LOGTYPE_PMD.
--- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 ++-- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/event/dpaa/dpaa_eventdev.c +1 -1
@@ -1025,7 +1025,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue; eventdev->txa_enqueue_same_dest = dpaa_eventdev_txa_enqueue_same_dest; -RTE_LOG (INFO ,PMD ,"%s eventdev added" , name); +DPAA_EVENTDEV_INFO ("%s eventdev added" , name);/* For secondary processes, the primary has done all the work */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
drivers/event/dpaa2/dpaa2_eventdev.c +2 -2
@@ -1141,7 +1141,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev) priv->max_event_queues++; }while (dpcon_dev && dpci_dev); -RTE_LOG (INFO ,PMD ,"%s eventdev created\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev created" , name); done:event_dev_probing_finish (eventdev);
@@ -1178,7 +1178,7 @@ dpaa2_eventdev_destroy(const char *name) } priv->max_event_queues =0 ; -RTE_LOG (INFO ,PMD ,"%s eventdev cleaned\n" , name); +DPAA2_EVENTDEV_INFO ("%s eventdev cleaned" , name);return 0 ; }
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +3 -3
@@ -774,15 +774,15 @@ static void dpaa2_test_run(int (*setup)(void), void (*tdown)(void), int (*test)(void), const char *name) {if (setup () <0 ) { -RTE_LOG (INFO ,PMD ,"Error setting up test %s" , name); +DPAA2_EVENTDEV_INFO ("Error setting up test %s" , name); unsupported++; }else {if (test () <0 ) { failed++; -RTE_LOG (INFO ,PMD ,"%s Failed\n" , name); +DPAA2_EVENTDEV_INFO ("%s Failed" , name); }else { passed++; -RTE_LOG (INFO ,PMD ,"%s Passed" , name); +DPAA2_EVENTDEV_INFO ("%s Passed" , name); } }
Signature · 1 line
2.43.0
PATCH v5 15/18 event/skeleton: replace logtype PMD with dynamic type
In reply to Stephen HemmingerThe skeleton is supposed to match current best practices. Change it to use dynamic logtype.
--- drivers/event/skeleton/skeleton_eventdev.c | 4 ++-- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/event/skeleton/skeleton_eventdev.c +2 -2
@@ -457,8 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)const char *name; name =rte_vdev_device_name (vdev); -RTE_LOG (INFO ,PMD ,"Initializing %s on NUMA node %d\n" , name, -rte_socket_id ()); +PMD_DRV_LOG (INFO ,"Initializing %s on NUMA node %d" , name,rte_socket_id ());return skeleton_eventdev_create (name,rte_socket_id (), vdev); }
@@ -479,3 +478,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = { };RTE_PMD_REGISTER_VDEV (EVENTDEV_NAME_SKELETON_PMD , vdev_eventdev_skeleton_pmd); +RTE_LOG_REGISTER_DEFAULT (skeleton_eventdev_logtype,INFO );
drivers/event/skeleton/skeleton_eventdev.h +6 -2
@@ -8,9 +8,12 @@#include <eventdev_pmd_pci.h> #include <eventdev_pmd_vdev.h> +extern int skeleton_eventdev_logtype; +#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)#define PMD_DRV_FUNC_TRACE () PMD_DRV_LOG(DEBUG, ">>")#else #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -18,7 +21,8 @@#endif #define PMD_DRV_ERR(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args)struct skeleton_eventdev {uintptr_t reg_base;
Signature · 1 line
2.43.0
PATCH v5 16/18 net/nfb: use dynamic logtype
In reply to Stephen HemmingerAll drivers should be using dynamic logtype.
--- drivers/net/nfb/nfb.h | 5 +++++ drivers/net/nfb/nfb_ethdev.c | 24 ++++++++++-------------- drivers/net/nfb/nfb_rx.c | 9 ++++----- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 9 ++++----- drivers/net/nfb/nfb_tx.h | 2 +- 6 files changed, 25 insertions(+), 26 deletions(-)
drivers/net/nfb/nfb.h +5 -0
@@ -12,6 +12,11 @@#include <netcope/rxmac.h> #include <netcope/txmac.h> +extern int nfb_logtype; +#define NFB_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \ + __func__, ## args) +#include "nfb_rx.h" #include "nfb_tx.h"
drivers/net/nfb/nfb_ethdev.c +10 -14
@@ -12,11 +12,9 @@#include <ethdev_pci.h> #include <rte_kvargs.h> +#include "nfb.h" #include "nfb_stats.h" -#include "nfb_rx.h" -#include "nfb_tx.h" #include "nfb_rxmode.h" -#include "nfb.h" /** * Default MAC addr
@@ -192,8 +190,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) (&nfb_timestamp_dynfield_offset, &nfb_timestamp_rx_dynflag);if (ret !=0 ) { -RTE_LOG (ERR ,PMD ,"Cannot register Rx timestamp" -" field/flag %d\n" , ret); +NFB_LOG (ERR ,"Cannot register Rx timestamp field/flag %d" , ret);nfb_close (internals->nfb);return -rte_errno; }
@@ -520,7 +517,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)struct rte_ether_addr eth_addr_init;struct rte_kvargs *kvlist; -RTE_LOG (INFO ,PMD ,"Initializing NFB device (" PCI_PRI_FMT ")\n" , +NFB_LOG (INFO ,"Initializing NFB device (" PCI_PRI_FMT ")" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -536,7 +533,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) kvlist =rte_kvargs_parse (dev->device->devargs->args,VALID_KEYS );if (kvlist ==NULL ) { -RTE_LOG (ERR ,PMD ,"Failed to parse device arguments %s" , +NFB_LOG (ERR ,"Failed to parse device arguments %s" , dev->device->devargs->args);rte_kvargs_free (kvlist);return -EINVAL ;
@@ -551,14 +548,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)*/ internals->nfb =nfb_open (internals->nfb_dev);if (internals->nfb ==NULL ) { -RTE_LOG (ERR ,PMD ,"nfb_open(): failed to open %s" , +NFB_LOG (ERR ,"nfb_open(): failed to open %s" , internals->nfb_dev);return -EINVAL ; } data->nb_rx_queues =ndp_get_rx_queue_available_count (internals->nfb); data->nb_tx_queues =ndp_get_tx_queue_available_count (internals->nfb); -RTE_LOG (INFO ,PMD ,"Available NDP queues RX: %u TX: %u\n" , +NFB_LOG (INFO ,"Available NDP queues RX: %u TX: %u\n" , data->nb_rx_queues, data->nb_tx_queues); nfb_nc_rxmac_init(internals->nfb,
@@ -583,7 +580,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) data->mac_addrs =rte_zmalloc (data->name,sizeof (struct rte_ether_addr ) * mac_count,RTE_CACHE_LINE_SIZE );if (data->mac_addrs ==NULL ) { -RTE_LOG (ERR ,PMD ,"Could not alloc space for MAC address!\n" ); +NFB_LOG (ERR ,"Could not alloc space for MAC address" );nfb_close (internals->nfb);return -EINVAL ; }
@@ -601,8 +598,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) dev->data->dev_flags |=RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; -RTE_LOG (INFO ,PMD ,"NFB device (" -PCI_PRI_FMT ") successfully initialized\n" , +NFB_LOG (INFO ,"NFB device (" PCI_PRI_FMT ") successfully initialized" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -626,8 +622,7 @@ nfb_eth_dev_uninit(struct rte_eth_dev *dev)nfb_eth_dev_close (dev); -RTE_LOG (INFO ,PMD ,"NFB device (" -PCI_PRI_FMT ") successfully uninitialized\n" , +NFB_LOG (INFO ,"NFB device (" PCI_PRI_FMT ") successfully uninitialized" , pci_addr->domain, pci_addr->bus, pci_addr->devid, pci_addr->function);
@@ -690,3 +685,4 @@ static struct rte_pci_driver nfb_eth_driver = {RTE_PMD_REGISTER_PCI (RTE_NFB_DRIVER_NAME , nfb_eth_driver);RTE_PMD_REGISTER_PCI_TABLE (RTE_NFB_DRIVER_NAME , nfb_pci_id_table);RTE_PMD_REGISTER_KMOD_DEP (RTE_NFB_DRIVER_NAME ,"* nfb" ); +RTE_LOG_REGISTER_DEFAULT (nfb_logtype,NOTICE );
drivers/net/nfb/nfb_rx.c +4 -5
@@ -6,7 +6,6 @@#include <rte_kvargs.h> -#include "nfb_rx.h" #include "nfb.h" uint64_t nfb_timestamp_rx_dynflag;
@@ -19,7 +18,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)int ret;if (rxq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -40,7 +39,7 @@ nfb_eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rxq_id)int ret;if (rxq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -70,8 +69,8 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev, RTE_CACHE_LINE_SIZE, socket_id);if (rxq ==NULL ) { -RTE_LOG (ERR ,PMD ,"rte_zmalloc_socket() failed for rx queue id " -"%" PRIu16"!\n" , rx_queue_id); +NFB_LOG (ERR ,"rte_zmalloc_socket() failed for rx queue id %" PRIu16, + rx_queue_id);return -ENOMEM ; }
drivers/net/nfb/nfb_rx.h +1 -1
@@ -156,7 +156,7 @@ nfb_eth_ndp_rx(void *queue,struct rte_mbuf *mbufs[nb_pkts];if (unlikely (ndp->queue ==NULL || nb_pkts ==0 )) { -RTE_LOG (ERR ,PMD ,"RX invalid arguments!\n" ); +NFB_LOG (ERR ,"RX invalid arguments" );return 0 ; }
drivers/net/nfb/nfb_tx.c +4 -5
@@ -4,7 +4,6 @@* All rights reserved. */ -#include "nfb_tx.h" #include "nfb.h" int
@@ -14,7 +13,7 @@ nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)int ret;if (txq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"RX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"RX NDP queue is NULL" );return -EINVAL ; }
@@ -35,7 +34,7 @@ nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)int ret;if (txq->queue ==NULL ) { -RTE_LOG (ERR ,PMD ,"TX NDP queue is NULL!\n" ); +NFB_LOG (ERR ,"TX NDP queue is NULL" );return -EINVAL ; }
@@ -62,8 +61,8 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev, RTE_CACHE_LINE_SIZE, socket_id);if (txq ==NULL ) { -RTE_LOG (ERR ,PMD ,"rte_zmalloc_socket() failed for tx queue id " -"%" PRIu16"!\n" , tx_queue_id); +NFB_LOG (ERR ,"rte_zmalloc_socket() failed for tx queue id %" PRIu16, + tx_queue_id);return -ENOMEM ; }
drivers/net/nfb/nfb_tx.h +1 -1
@@ -140,7 +140,7 @@ nfb_eth_ndp_tx(void *queue,return 0 ;if (unlikely (ndp->queue ==NULL )) { -RTE_LOG (ERR ,PMD ,"TX invalid arguments!\n" ); +NFB_LOG (ERR ,"TX invalid arguments" );return 0 ; }
Signature · 1 line
2.43.0
PATCH v5 17/18 examples/fips_validation: replace use of PMD logtype
In reply to Stephen HemmingerReplace PMD with USER1 since that is already used in main
--- examples/fips_validation/fips_dev_self_test.c | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-)
examples/fips_validation/fips_dev_self_test.c +22 -22
@@ -1032,7 +1032,7 @@ prepare_cipher_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1040,7 +1040,7 @@ prepare_cipher_xform(uint8_t dev_id,if (rte_cryptodev_sym_capability_check_cipher (cap, cipher_xform->key.length, cipher_xform->iv.length) !=0 ) { -RTE_LOG (ERR ,PMD ,"PMD %s key length %u IV length %u\n" , +RTE_LOG (ERR ,USER1 ,"PMD %s key length %u IV length %u\n" ,rte_cryptodev_name_get (dev_id), cipher_xform->key.length, cipher_xform->iv.length);
@@ -1088,7 +1088,7 @@ prepare_auth_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1096,7 +1096,7 @@ prepare_auth_xform(uint8_t dev_id,if (rte_cryptodev_sym_capability_check_auth (cap, auth_xform->key.length, auth_xform->digest_length,0 ) !=0 ) { -RTE_LOG (ERR ,PMD ,"PMD %s key length %u Digest length %u\n" , +RTE_LOG (ERR ,USER1 ,"PMD %s key length %u Digest length %u\n" ,rte_cryptodev_name_get (dev_id), auth_xform->key.length, auth_xform->digest_length);
@@ -1147,7 +1147,7 @@ prepare_aead_xform(uint8_t dev_id, cap =rte_cryptodev_sym_capability_get (dev_id, &cap_idx);if (!cap) { -RTE_LOG (ERR ,PMD ,"Failed to get capability for cdev %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to get capability for cdev %u\n" , dev_id);return -EACCES ; }
@@ -1156,7 +1156,7 @@ prepare_aead_xform(uint8_t dev_id, aead_xform->key.length, aead_xform->digest_length, aead_xform->aad_length, aead_xform->iv.length) != 0) { - RTE_LOG(ERR, PMD, + RTE_LOG(ERR, USER1, "PMD %s key_len %u tag_len %u aad_len %u iv_len %u\n", rte_cryptodev_name_get(dev_id), aead_xform->key.length,
@@ -1195,7 +1195,7 @@ prepare_cipher_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf, len);if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1219,7 +1219,7 @@ prepare_auth_op(struct rte_crypto_op *op,uint8_t *dst;if (vec->input.len + vec->digest.len >RTE_MBUF_MAX_NB_SEGS ) { -RTE_LOG (ERR ,PMD ,"Error %i: Test data too long (%u).\n" , +RTE_LOG (ERR ,USER1 ,"Error %i: Test data too long (%u).\n" , -ENOMEM , vec->input.len + vec->digest.len);return -ENOMEM ; }
@@ -1229,7 +1229,7 @@ prepare_auth_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf, vec->input.len + vec->digest.len);if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1274,7 +1274,7 @@ prepare_aead_op(struct rte_crypto_op *op,memcpy (iv, vec->iv.data, vec->iv.len);if (len + vec->digest.len >RTE_MBUF_MAX_NB_SEGS ) { -RTE_LOG (ERR ,PMD ,"Error %i: Test data too long (%u).\n" , +RTE_LOG (ERR ,USER1 ,"Error %i: Test data too long (%u).\n" , -ENOMEM , len + vec->digest.len);return -ENOMEM ; }
@@ -1282,7 +1282,7 @@ prepare_aead_op(struct rte_crypto_op *op, dst = (uint8_t *)rte_pktmbuf_append (mbuf,RTE_ALIGN_CEIL (len + vec->digest.len,16 ));if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: MBUF too small\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: MBUF too small\n" , -ENOMEM );return -ENOMEM ; }
@@ -1303,7 +1303,7 @@ prepare_aead_op(struct rte_crypto_op *op, dst =rte_malloc (NULL , len,16 );if (!dst) { -RTE_LOG (ERR ,PMD ,"Error %i: Not enough memory\n" , -ENOMEM ); +RTE_LOG (ERR ,USER1 ,"Error %i: Not enough memory\n" , -ENOMEM );return -ENOMEM ; }
@@ -1474,24 +1474,24 @@ run_single_test(uint8_t dev_id, ret = test_ops->prepare_xform (dev_id, &xform, vec, dir, key, negative_test);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Error %i: Prepare Xform\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Prepare Xform\n" , ret);return ret; } sess =rte_cryptodev_sym_session_create (dev_id, &xform, env->sess_pool);if (!sess) { -RTE_LOG (ERR ,PMD ,"Error %i: Init session\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Init session\n" , ret);return ret; } ret = test_ops->prepare_op (env->op, env->mbuf, sess, dir, vec);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Error %i: Prepare op\n" , ret); +RTE_LOG (ERR ,USER1 ,"Error %i: Prepare op\n" , ret);return ret; }if (rte_cryptodev_enqueue_burst (dev_id,0 , &env->op,1 ) <1 ) { -RTE_LOG (ERR ,PMD ,"Error: Failed enqueue\n" ); +RTE_LOG (ERR ,USER1 ,"Error: Failed enqueue\n" );return ret; }
@@ -1622,7 +1622,7 @@ fips_dev_self_test(uint8_t dev_id, ret =fips_dev_auto_test_init (dev_id, &env);if (ret <0 ) { -RTE_LOG (ERR ,PMD ,"Failed to init self-test for PMD %u\n" , +RTE_LOG (ERR ,USER1 ,"Failed to init self-test for PMD %u\n" , dev_id);return ret; }
@@ -1644,7 +1644,7 @@ fips_dev_self_test(uint8_t dev_id, negative_test =0 ; } - RTE_LOG(INFO, PMD, "Testing (ID %u) %s %s%s...\n", + RTE_LOG(INFO, USER1, "Testing (ID %u) %s %s%s...\n", i, vec->name, j == self_test_dir_enc_auth_gen ?
@@ -1658,18 +1658,18 @@ fips_dev_self_test(uint8_t dev_id,if (!negative_test)break ; ret =-1 ; -RTE_LOG (ERR ,PMD ,"PMD %u Failed test %s %s\n" , +RTE_LOG (ERR ,USER1 ,"PMD %u Failed test %s %s\n" , dev_id, vec->name, j == self_test_dir_enc_auth_gen ?"Encrypt" :"Decrypt" ); goto error_exit;case -EACCES : -RTE_LOG (ERR ,PMD ,"Not supported by %s. Skip\n" , +RTE_LOG (ERR ,USER1 ,"Not supported by %s. Skip\n" ,rte_cryptodev_name_get (dev_id)); ret =0 ;break ;default : -RTE_LOG (ERR ,PMD ,"PMD %u Failed test %s %s\n" , +RTE_LOG (ERR ,USER1 ,"PMD %u Failed test %s %s\n" , dev_id, vec->name, j == self_test_dir_enc_auth_gen ?"Encrypt" :"Decrypt" );
@@ -1682,7 +1682,7 @@ fips_dev_self_test(uint8_t dev_id,fips_dev_auto_test_uninit (dev_id, &env);if (ret ==0 ) { -RTE_LOG (INFO ,PMD ,"PMD %u finished self-test successfully\n" , +RTE_LOG (INFO ,USER1 ,"PMD %u finished self-test successfully\n" , dev_id); }
Signature · 1 line
2.43.0
PATCH v5 18/18 log: mark PMD logtype as deprecated
In reply to Stephen HemmingerThis is temporary patch to help find all misuse use of PMD logtype
--- lib/log/log.c | 3 +++ lib/log/rte_log.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
lib/log/log.c +3 -0
@@ -352,6 +352,9 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, +/* avoid deprecated warning */ +#undef RTE_LOGTYPE_PMD +#define RTE_LOGTYPE_PMD 5 {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_PORT ,"lib.port" }, {RTE_LOGTYPE_TABLE ,"lib.table" },
lib/log/rte_log.h +1 -1
@@ -32,7 +32,7 @@ extern "C" {/* was RTE_LOGTYPE_RING */ /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ -#define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ +#define RTE_LOGTYPE_PMD RTE_DEPRECATED(RTE_LOGTYPE_PMD) 5/* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */
Signature · 1 line
2.43.0
Re: [PATCH v5 00/18] Replace uses of PMD logtype
In reply to Stephen HemmingerQuoted 24 lines · Stephen Hemminger
The generic
RTE_LOGTYPE_PMDis a leftover and should be removed. This replaces all uses in current tree. It leaves PMD logtype as deprecated because there maybe other uses in external projects leftover.This version does not use Depends-on: because CI system can't handle that and want to make sure no PMD left behind.
v5 - incorporate review feedback
David Marchand (1):
drivers: use dedicated logtypesStephen Hemminger (17):
common/sfc_efx: remove use of PMD logtype
mempool/dpaa2: use driver logtype not PMD
net/dpaa: use dedicated logtype not PMD
net/dpaa2: used dedicated logtype not PMD
net/mvpp2: use dedicated logtype
net/vmxnet3: used dedicated logtype not PMD
raw/cnxk: replace PMD logtype with dynamic type
crypto/scheduler: replace use of logtype PMD
crypto/ccp: do not use PMD logtype
Quoted 8 lines
crypto/caam_jr: use dedicated logtypecrypto/dpaa_sec,crypto/dpaa2_sec: use dedicated logtype event/dlb2: use dedicated logtype
event/dpaa, event/dpaa2: use dedicated logtype event/skeleton: replace logtype PMD with dynamic type net/nfb: use dynamic logtype examples/fips_validation: replace use of PMD logtype
log: mark PMD logtype as deprecated
It seems our CI has some gaps.
I found some PMD use in two drivers:drivers/crypto/armv8/rte_armv8_pmd.c: RTE_LOG(INFO, PMD,drivers/net/mvpp2/mrvl_ethdev.c: RTE_LOG(ERR, PMD,
Signature · 1 line
David Marchand
v6 cover Remove uses of PMD logtype
In reply to Stephen HemmingerThe generic RTE_LOGTYPE_PMD is a leftover and should be removed. This replaces all uses in current tree. It leaves PMD logtype as deprecated because there maybe other uses in external projects leftover.
This version does not use Depends-on: because CI system can't handle that and want to make sure no PMD left behind
v6 - add a couple of more places
remove PMD logtype in last patch
David Marchand (1):
drivers: use dedicated logtypes
Stephen Hemminger (19):
common/sfc_efx: remove use of PMD logtype mempool/dpaa2: use driver logtype not PMD net/dpaa: use dedicated logtype not PMD net/dpaa2: used dedicated logtype not PMD net/mrvl: do not use PMD logtype
net/mvpp2: use dedicated logtype
net/nfb: use dynamic logtype
net/vmxnet3: used dedicated logtype not PMD raw/cnxk: replace PMD logtype with dynamic type crypto/scheduler: replace use of logtype PMD crypto/armv8: do not use PMD logtype crypto/ccp: do not use PMD logtype crypto/caam_jr: use dedicated logtype crypto/dpaa_sec, crypto/dpaa2_sec: use dedicated logtype event/dlb2: use dedicated logtype
event/dpaa, event/dpaa2: use dedicated logtype event/skeleton: replace logtype PMD with dynamic type examples/fips_validation: replace use of PMD logtype
log: remove PMD log type
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 3 +- drivers/bus/cdx/cdx_logs.h | 3 +- drivers/bus/fslmc/fslmc_logs.h | 3 +- drivers/common/cnxk/roc_platform.h | 16 +- drivers/common/cpt/cpt_pmd_logs.h | 6 +- drivers/common/dpaax/caamflib/compat.h | 4 +- drivers/common/dpaax/dpaax_logs.h | 3 +- drivers/common/dpaax/version.map | 1 + drivers/common/idpf/idpf_common_logs.h | 5 +- drivers/common/sfc_efx/sfc_efx.c | 11 +- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- drivers/crypto/armv8/rte_armv8_pmd.c | 4 +- drivers/crypto/caam_jr/caam_jr.c | 46 ++- drivers/crypto/caam_jr/caam_jr_log.h | 15 +- drivers/crypto/caam_jr/caam_jr_uio.c | 4 +- drivers/crypto/ccp/rte_ccp_pmd.c | 13 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +- drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h | 3 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 30 +- drivers/crypto/dpaa_sec/dpaa_sec_log.h | 3 +- drivers/crypto/scheduler/scheduler_pmd.c | 4 +- drivers/dma/dpaa/dpaa_qdma_logs.h | 3 +- drivers/dma/dpaa2/dpaa2_qdma_logs.h | 3 +- drivers/event/dlb2/dlb2.c | 275 +++++++++--------- drivers/event/dlb2/dlb2_log.h | 3 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 4 +- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 3 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 6 +- drivers/event/skeleton/skeleton_eventdev.c | 4 +- drivers/event/skeleton/skeleton_eventdev.h | 8 +- drivers/mempool/dpaa/dpaa_mempool.c | 1 + drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 3 +- drivers/net/atlantic/atl_logs.h | 5 +- drivers/net/avp/avp_logs.h | 5 +- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 2 +- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 2 +- drivers/net/bnxt/bnxt_txr.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 8 +- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_pmd_logs.h | 3 +- drivers/net/dpaa2/dpaa2_sparser.c | 4 +- drivers/net/enetc/enetc_logs.h | 3 +- drivers/net/enetfec/enet_pmd_logs.h | 3 +- drivers/net/igc/igc_logs.h | 5 +- drivers/net/mana/mana.h | 3 +- drivers/net/mvpp2/mrvl_ethdev.c | 7 +- drivers/net/nfb/nfb.h | 5 + drivers/net/nfb/nfb_ethdev.c | 24 +- drivers/net/nfb/nfb_rx.c | 9 +- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 9 +- drivers/net/nfb/nfb_tx.h | 2 +- drivers/net/octeon_ep/otx_ep_common.h | 2 + drivers/net/octeon_ep/otx_ep_rxtx.c | 2 +- drivers/net/octeontx/octeontx_logs.h | 3 +- drivers/net/pfe/pfe_logs.h | 3 +- drivers/net/qede/qede_logs.h | 5 +- drivers/net/virtio/virtio_logs.h | 5 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_logs.h | 7 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx_test.c | 31 +- drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 6 + drivers/raw/cnxk_gpio/cnxk_gpio.c | 21 +- drivers/raw/cnxk_gpio/cnxk_gpio.h | 5 + drivers/raw/cnxk_gpio/cnxk_gpio_selftest.c | 17 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 3 +- .../raw/ifpga/base/osdep_rte/osdep_generic.h | 5 +- drivers/vdpa/ifc/base/ifcvf.c | 10 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 7 +- examples/fips_validation/fips_dev_self_test.c | 44 +-- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- 79 files changed, 420 insertions(+), 381 deletions(-)
Signature · 1 line
2.43.0