From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44E8F43751; Thu, 21 Dec 2023 17:50:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 087D742EAB; Thu, 21 Dec 2023 17:49:15 +0100 (CET) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 8065242E83 for ; Thu, 21 Dec 2023 17:49:09 +0100 (CET) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5cdbc4334edso544858a12.3 for ; Thu, 21 Dec 2023 08:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1703177349; x=1703782149; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xh4D2SpLkvfLLARfsIRBCrzMRJLDTHlNSrfuOw2/GqA=; b=epZeBrN9usUfjTWj3UJe80+fkLX0ijVzTex5mWzzAMtYttTMswOmJ5MXYX2v17oQWQ ji1GE0riO6L89cZRdV8qSePvn5xPKOF697VJjTUWPm3zUinfgYuKR71djfdAyEde/POH YQzpj14u+CQbdvfafJ9n1ZT6E7RzvgcQJdWKycdSmNeXpHEc3tLSQkevjMioDLR7QZj5 p6/xwF9oIJmDTQ8GqGurLj94cQ1MgSHrtny0cX9gwCOV+CAmhUWTzewaprqJRZpXyjsb TzhDaFc+6VKeEsfPKhnNOr7mqhpFm73SRP0Rz08you6NAJoml8SbGyBTgsGBibkgJ700 1m2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703177349; x=1703782149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xh4D2SpLkvfLLARfsIRBCrzMRJLDTHlNSrfuOw2/GqA=; b=LQGXuXUgksyXtf9DuD7133BTKmOfdCk1o451+GMmZlczp0pgq47oGDDl2rIHDrcs6Y VIhbvBEgpxu/EHDcTIYy8B6dJLYk6hb0yOqm0+Lze3obchGdsVIY1o+OnsfzhHmhH63Y Cvg1uG65oU/9NthbHeLDVWnftON9Rvm6HubfuiYZtgRqWqNKvY5e08yoiiOZWX/yCLBC bRhn5mjJyb6QeoRaoNZUzNMFqbPd/WScbG1HHA2SkV0KIX4LOpD31o20lZsWGbrMh7N4 faHwfw3crmKOCqChaEmTHoN2tJuXWX1AfaKeapQK4yM+lHQq8L0S2LEbDTSnKqxGtqqt 5otA== X-Gm-Message-State: AOJu0Yz89LRW83WIag2nBToZga58pA/Vd5Sl3va8anBj+6Gw+H2xX0el 6VohWZbwUEhiLfV2EnNICHHMZxqNfA8yKTpUoauopg== X-Google-Smtp-Source: AGHT+IFHw5ptRz6J8S6zgDNbudtLkIS1a2RZfV0iRUMKG/2R0JTw58PfCyVuwP36yaqQwh6te6EIxA== X-Received: by 2002:a05:6a20:3cab:b0:193:f809:ecd7 with SMTP id b43-20020a056a203cab00b00193f809ecd7mr1329845pzj.14.1703177348760; Thu, 21 Dec 2023 08:49:08 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id g20-20020a63e614000000b0058901200bbbsm1842456pgh.40.2023.12.21.08.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:49:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Gagandeep Singh , Hemant Agrawal , Akhil Goyal Subject: [PATCH v5 11/18] crypto/caam_jr: use dedicated logtype Date: Thu, 21 Dec 2023 08:46:28 -0800 Message-ID: <20231221164841.125006-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221164841.125006-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231221164841.125006-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The driver has macro and logtype but not used in a couple places. Also, remove extraneous newlines. Fixes: af7c9b5e9ce7 ("crypto/caam_jr: introduce basic driver") Signed-off-by: Stephen Hemminger --- 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(-) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index b55258689b49..d3b42d8e1b91 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -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 diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h index 8f6aa50e2a4a..3d32b75e3a01 100644 --- a/drivers/crypto/caam_jr/caam_jr_log.h +++ b/drivers/crypto/caam_jr/caam_jr_log.h @@ -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(" >>") diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c b/drivers/crypto/caam_jr/caam_jr_uio.c index 583ba3b523af..4d9acfbe9196 100644 --- a/drivers/crypto/caam_jr/caam_jr_uio.c +++ b/drivers/crypto/caam_jr/caam_jr_uio.c @@ -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; } -- 2.43.0