From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B98CDA04A5; Wed, 17 Jun 2020 08:31:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7BDCA14583; Wed, 17 Jun 2020 08:31:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 568F1FFA for ; Wed, 17 Jun 2020 08:31:16 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05H6PrIP010519; Tue, 16 Jun 2020 23:31:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=RMENcVOKMZGCAEQZS+xUbZKwngLkDNJ8Gtqf2h2a8Gg=; b=uPXRMQpbTHKbzGpwkhch+YW9ApT/4sozda/WRRR/XFHcK18MSA7yfPLkx66egzzsaNY9 mRA1uJA71Phc9B1OUSugtyY1cY4o/zbatbDBkHQQwRk8nvSsR+1Hg7f1fpN628hekUdl NPgq8T4kATKWKI4HgZ/BCsSa1d3ZZmDF35JScwf/A0RMpwbE5zgOYLf1ezi2PApeRabk Ecr/F6t/7W6RvvXr4crky3xKZvyjMCJ2J9diuqOs+GibgUPCb84tE3VkwBOpiD9BtdbS Xw/QA9WLWNcB/tnl39k69Zk6LevsA/YOny0XzlhN+ngS8h2HkokM22wggryaBlSWnfDj NA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 31q658jmyy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 16 Jun 2020 23:31:15 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 23:31:13 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 16 Jun 2020 23:31:13 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 9BEA43F703F; Tue, 16 Jun 2020 23:31:08 -0700 (PDT) From: To: , Declan Doherty , Pablo de Lara , Gagandeep Singh , "Hemant Agrawal" , Akhil Goyal , "Michael Shamis" , Liron Himi , "Nagadheeraj Rottela" , Srikanth Jampala , Anoob Joseph , Ankur Dwivedi , "Fan Zhang" , Jay Zhou CC: , , , Jerin Jacob Date: Wed, 17 Jun 2020 12:00:42 +0530 Message-ID: <20200617063047.1555518-9-jerinj@marvell.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200617063047.1555518-1-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-16_13:2020-06-16, 2020-06-16 signatures=0 Subject: [dpdk-dev] [PATCH 08/13] drivers/crypto: use log register macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Use log register macro to avoid the code duplication in the log registration process. Signed-off-by: Jerin Jacob --- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 8 +--- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 8 +--- drivers/crypto/caam_jr/caam_jr.c | 8 +--- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 11 +----- drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +---- drivers/crypto/kasumi/rte_kasumi_pmd.c | 6 +-- drivers/crypto/mvsam/rte_mrvl_pmd.c | 7 +--- drivers/crypto/nitrox/nitrox_logs.c | 9 +---- drivers/crypto/null/null_crypto_pmd.c | 7 +--- drivers/crypto/octeontx/otx_cryptodev.c | 10 +---- drivers/crypto/octeontx2/otx2_cryptodev.c | 12 +----- drivers/crypto/openssl/rte_openssl_pmd.c | 7 +--- .../scheduler/rte_cryptodev_scheduler.c | 8 +--- drivers/crypto/snow3g/rte_snow3g_pmd.c | 7 +--- drivers/crypto/virtio/virtio_cryptodev.c | 39 ++++--------------- drivers/crypto/zuc/rte_zuc_pmd.c | 7 +--- 16 files changed, 23 insertions(+), 141 deletions(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index d213d05b9..1d2a0ce00 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -13,8 +13,6 @@ #include "aesni_gcm_pmd_private.h" -int aesni_gcm_logtype_driver; - static uint8_t cryptodev_driver_id; /* setup session handlers */ @@ -889,8 +887,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_gcm_crypto_drv, aesni_gcm_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(aesni_gcm_init_log) -{ - aesni_gcm_logtype_driver = rte_log_register("pmd.crypto.aesni_gcm"); -} +RTE_LOG_REGISTER(aesni_gcm_logtype_driver, pmd.crypto.aesni_gcm, NOTICE); diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 2d688f4d3..9d0d9f4d7 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -15,8 +15,6 @@ #include "aesni_mb_pmd_private.h" -int aesni_mb_logtype_driver; - #define AES_CCM_DIGEST_MIN_LEN 4 #define AES_CCM_DIGEST_MAX_LEN 16 #define HMAC_MAX_BLOCK_SIZE 128 @@ -1744,8 +1742,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD, RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_mb_crypto_drv, cryptodev_aesni_mb_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(aesni_mb_init_log) -{ - aesni_mb_logtype_driver = rte_log_register("pmd.crypto.aesni_mb"); -} +RTE_LOG_REGISTER(aesni_mb_logtype_driver, pmd.crypto.aesni_mb, NOTICE); diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index caf238677..49a35d614 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -35,7 +35,6 @@ #endif #define CRYPTODEV_NAME_CAAM_JR_PMD crypto_caam_jr static uint8_t cryptodev_driver_id; -int caam_jr_logtype; /* Lists the states possible for the SEC user space driver. */ enum sec_driver_state_e { @@ -2477,9 +2476,4 @@ RTE_INIT(caam_jr_init) sec_job_rings_init(); } -RTE_INIT(caam_jr_init_log) -{ - caam_jr_logtype = rte_log_register("pmd.crypto.caam"); - if (caam_jr_logtype >= 0) - rte_log_set_level(caam_jr_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(caam_jr_logtype, pmd.crypto.caam, NOTICE); diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 63e7d930a..12f833136 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -58,8 +58,6 @@ static uint8_t cryptodev_driver_id; -int dpaa2_logtype_sec; - #ifdef RTE_LIBRTE_SECURITY static inline int build_proto_compound_sg_fd(dpaa2_sec_session *sess, @@ -3918,11 +3916,4 @@ static struct cryptodev_driver dpaa2_sec_crypto_drv; RTE_PMD_REGISTER_DPAA2(CRYPTODEV_NAME_DPAA2_SEC_PMD, rte_dpaa2_sec_driver); RTE_PMD_REGISTER_CRYPTO_DRIVER(dpaa2_sec_crypto_drv, rte_dpaa2_sec_driver.driver, cryptodev_driver_id); - -RTE_INIT(dpaa2_sec_init_log) -{ - /* Bus level logs */ - dpaa2_logtype_sec = rte_log_register("pmd.crypto.dpaa2"); - if (dpaa2_logtype_sec >= 0) - rte_log_set_level(dpaa2_logtype_sec, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(dpaa2_logtype_sec, pmd.crypto.dpaa2, NOTICE); diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 66ee0ba0c..d9fa8bb36 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -43,8 +43,6 @@ #include #include -int dpaa_logtype_sec; - static uint8_t cryptodev_driver_id; static __thread struct rte_crypto_op **dpaa_sec_ops; @@ -3520,10 +3518,4 @@ static struct cryptodev_driver dpaa_sec_crypto_drv; RTE_PMD_REGISTER_DPAA(CRYPTODEV_NAME_DPAA_SEC_PMD, rte_dpaa_sec_driver); RTE_PMD_REGISTER_CRYPTO_DRIVER(dpaa_sec_crypto_drv, rte_dpaa_sec_driver.driver, cryptodev_driver_id); - -RTE_INIT(dpaa_sec_init_log) -{ - dpaa_logtype_sec = rte_log_register("pmd.crypto.dpaa"); - if (dpaa_logtype_sec >= 0) - rte_log_set_level(dpaa_logtype_sec, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(dpaa_logtype_sec, pmd.crypto.dpaa, NOTICE); diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c index 73077e3d9..c3f0dfc2f 100644 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c @@ -17,7 +17,6 @@ #define KASUMI_MAX_BURST 4 #define BYTE_LEN 8 -int kasumi_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ @@ -639,7 +638,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD, RTE_PMD_REGISTER_CRYPTO_DRIVER(kasumi_crypto_drv, cryptodev_kasumi_pmd_drv.driver, cryptodev_driver_id); -RTE_INIT(kasumi_init_log) -{ - kasumi_logtype_driver = rte_log_register("pmd.crypto.kasumi"); -} +RTE_LOG_REGISTER(kasumi_logtype_driver, pmd.crypto.kasumi, NOTICE); diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c index 63782ce97..aaa40dced 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c @@ -19,7 +19,6 @@ #define MRVL_PMD_MAX_NB_SESS_ARG ("max_nb_sessions") #define MRVL_PMD_DEFAULT_MAX_NB_SESSIONS 2048 -int mrvl_logtype_driver; static uint8_t cryptodev_driver_id; struct mrvl_pmd_init_params { @@ -1020,8 +1019,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(mrvl_crypto_drv, cryptodev_mrvl_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(crypto_mrvl_init_log) -{ - mrvl_logtype_driver = rte_log_register("pmd.crypto.mvsam"); -} +RTE_LOG_REGISTER(mrvl_logtype_driver, pmd.crypto.mvsam, NOTICE); diff --git a/drivers/crypto/nitrox/nitrox_logs.c b/drivers/crypto/nitrox/nitrox_logs.c index 007056cb4..26395159a 100644 --- a/drivers/crypto/nitrox/nitrox_logs.c +++ b/drivers/crypto/nitrox/nitrox_logs.c @@ -4,11 +4,4 @@ #include -int nitrox_logtype; - -RTE_INIT(nitrox_init_log) -{ - nitrox_logtype = rte_log_register("pmd.crypto.nitrox"); - if (nitrox_logtype >= 0) - rte_log_set_level(nitrox_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(nitrox_logtype, pmd.crypto.nitrox, NOTICE); diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index 7b0b9d42b..e04042e75 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -10,7 +10,6 @@ #include "null_crypto_pmd_private.h" static uint8_t cryptodev_driver_id; -int null_logtype_driver; /** verify and set session parameters */ int @@ -249,8 +248,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(null_crypto_drv, cryptodev_null_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(null_init_log) -{ - null_logtype_driver = rte_log_register("pmd.crypto.null"); -} +RTE_LOG_REGISTER(null_logtype_driver, pmd.crypto.null, INFO); diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c index ddece1311..5ce1cf82f 100644 --- a/drivers/crypto/octeontx/otx_cryptodev.c +++ b/drivers/crypto/octeontx/otx_cryptodev.c @@ -15,7 +15,6 @@ #include "cpt_pmd_logs.h" uint8_t otx_cryptodev_driver_id; -int otx_cpt_logtype; static struct rte_pci_id pci_id_cpt_table[] = { { @@ -112,11 +111,4 @@ RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX_PMD, pci_id_cpt_table); RTE_PMD_REGISTER_KMOD_DEP(CRYPTODEV_NAME_OCTEONTX_PMD, "vfio-pci"); RTE_PMD_REGISTER_CRYPTO_DRIVER(otx_cryptodev_drv, otx_cryptodev_pmd.driver, otx_cryptodev_driver_id); - -RTE_INIT(otx_cpt_init_log) -{ - /* Bus level logs */ - otx_cpt_logtype = rte_log_register("pmd.crypto.octeontx"); - if (otx_cpt_logtype >= 0) - rte_log_set_level(otx_cpt_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(otx_cpt_logtype, pmd.crypto.octeontx, NOTICE); diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c index 6ffbc2eb7..50cbb13d8 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev.c @@ -22,8 +22,6 @@ #include "cpt_common.h" #include "cpt_pmd_logs.h" -int otx2_cpt_logtype; - uint8_t otx2_cryptodev_driver_id; static struct rte_pci_id pci_id_cpt_table[] = { @@ -146,17 +144,9 @@ static struct rte_pci_driver otx2_cryptodev_pmd = { static struct cryptodev_driver otx2_cryptodev_drv; -RTE_INIT(otx2_cpt_init_log); RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_OCTEONTX2_PMD, otx2_cryptodev_pmd); RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX2_PMD, pci_id_cpt_table); RTE_PMD_REGISTER_KMOD_DEP(CRYPTODEV_NAME_OCTEONTX2_PMD, "vfio-pci"); RTE_PMD_REGISTER_CRYPTO_DRIVER(otx2_cryptodev_drv, otx2_cryptodev_pmd.driver, otx2_cryptodev_driver_id); - -RTE_INIT(otx2_cpt_init_log) -{ - /* Bus level logs */ - otx2_cpt_logtype = rte_log_register("pmd.crypto.octeontx2"); - if (otx2_cpt_logtype >= 0) - rte_log_set_level(otx2_cpt_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(otx2_cpt_logtype, pmd.crypto.octeontx2, NOTICE); diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index bb9fb877a..7d3959f55 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -18,7 +18,6 @@ #define DES_BLOCK_SIZE 8 -int openssl_logtype_driver; static uint8_t cryptodev_driver_id; #if (OPENSSL_VERSION_NUMBER < 0x10100000L) @@ -2279,8 +2278,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_OPENSSL_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(openssl_crypto_drv, cryptodev_openssl_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(openssl_init_log) -{ - openssl_logtype_driver = rte_log_register("pmd.crypto.openssl"); -} +RTE_LOG_REGISTER(openssl_logtype_driver, pmd.crypto.openssl, INFO); diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 1fef88f11..730504dab 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -10,8 +10,6 @@ #include "rte_cryptodev_scheduler.h" #include "scheduler_pmd_private.h" -int scheduler_logtype_driver; - /** update the scheduler pmd's capability with attaching device's * capability. * For each device to be attached, the scheduler's capability should be @@ -578,7 +576,5 @@ rte_cryptodev_scheduler_option_get(uint8_t scheduler_id, return (*sched_ctx->ops.option_get)(dev, option_type, option); } -RTE_INIT(scheduler_init_log) -{ - scheduler_logtype_driver = rte_log_register("pmd.crypto.scheduler"); -} + +RTE_LOG_REGISTER(scheduler_logtype_driver, pmd.crypto.scheduler, INFO); diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index c939064d5..558e01e70 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -16,7 +16,6 @@ #define SNOW3G_MAX_BURST 8 #define BYTE_LEN 8 -int snow3g_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ @@ -653,8 +652,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(snow3g_crypto_drv, cryptodev_snow3g_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(snow3g_init_log) -{ - snow3g_logtype_driver = rte_log_register("pmd.crypto.snow3g"); -} +RTE_LOG_REGISTER(snow3g_logtype_driver, pmd.crypto.snow3g, INFO); diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c index cdf43b0e0..31a5f1072 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -17,12 +17,6 @@ #include "virtio_crypto_algs.h" #include "virtio_crypto_capabilities.h" -int virtio_crypto_logtype_init; -int virtio_crypto_logtype_session; -int virtio_crypto_logtype_rx; -int virtio_crypto_logtype_tx; -int virtio_crypto_logtype_driver; - static int virtio_crypto_dev_configure(struct rte_cryptodev *dev, struct rte_cryptodev_config *config); static int virtio_crypto_dev_start(struct rte_cryptodev *dev); @@ -1489,29 +1483,10 @@ RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_VIRTIO_PMD, rte_virtio_crypto_driver); RTE_PMD_REGISTER_CRYPTO_DRIVER(virtio_crypto_drv, rte_virtio_crypto_driver.driver, cryptodev_virtio_driver_id); - -RTE_INIT(virtio_crypto_init_log) -{ - virtio_crypto_logtype_init = rte_log_register("pmd.crypto.virtio.init"); - if (virtio_crypto_logtype_init >= 0) - rte_log_set_level(virtio_crypto_logtype_init, RTE_LOG_NOTICE); - - virtio_crypto_logtype_session = - rte_log_register("pmd.crypto.virtio.session"); - if (virtio_crypto_logtype_session >= 0) - rte_log_set_level(virtio_crypto_logtype_session, - RTE_LOG_NOTICE); - - virtio_crypto_logtype_rx = rte_log_register("pmd.crypto.virtio.rx"); - if (virtio_crypto_logtype_rx >= 0) - rte_log_set_level(virtio_crypto_logtype_rx, RTE_LOG_NOTICE); - - virtio_crypto_logtype_tx = rte_log_register("pmd.crypto.virtio.tx"); - if (virtio_crypto_logtype_tx >= 0) - rte_log_set_level(virtio_crypto_logtype_tx, RTE_LOG_NOTICE); - - virtio_crypto_logtype_driver = - rte_log_register("pmd.crypto.virtio.driver"); - if (virtio_crypto_logtype_driver >= 0) - rte_log_set_level(virtio_crypto_logtype_driver, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(virtio_crypto_logtype_init, pmd.crypto.virtio.init, NOTICE); +RTE_LOG_REGISTER(virtio_crypto_logtype_session, pmd.crypto.virtio.session, + NOTICE); +RTE_LOG_REGISTER(virtio_crypto_logtype_rx, pmd.crypto.virtio.rx, NOTICE); +RTE_LOG_REGISTER(virtio_crypto_logtype_tx, pmd.crypto.virtio.tx, NOTICE); +RTE_LOG_REGISTER(virtio_crypto_logtype_driver, pmd.crypto.virtio.driver, + NOTICE); diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c index df8d6f6bb..20cb5a160 100644 --- a/drivers/crypto/zuc/rte_zuc_pmd.c +++ b/drivers/crypto/zuc/rte_zuc_pmd.c @@ -14,7 +14,6 @@ #define ZUC_MAX_BURST 16 #define BYTE_LEN 8 -int zuc_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ @@ -580,8 +579,4 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ZUC_PMD, "socket_id="); RTE_PMD_REGISTER_CRYPTO_DRIVER(zuc_crypto_drv, cryptodev_zuc_pmd_drv.driver, cryptodev_driver_id); - -RTE_INIT(zuc_init_log) -{ - zuc_logtype_driver = rte_log_register("pmd.crypto.zuc"); -} +RTE_LOG_REGISTER(zuc_logtype_driver, pmd.crypto.zuc, INFO); -- 2.26.2