DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: hemant.agrawal@nxp.com, Sachin Saxena <sachin.saxena@nxp.com>,
	Gagandeep Singh <g.singh@nxp.com>
Subject: [PATCH 1/3] crypto/dpaa_sec: remove cryptodev pointer from bus device
Date: Thu, 11 Jun 2026 15:07:35 +0200	[thread overview]
Message-ID: <20260611130738.1720628-2-david.marchand@redhat.com> (raw)
In-Reply-To: <20260611130738.1720628-1-david.marchand@redhat.com>

Calling rte_cryptodev_pmd_get_named_dev() is enough to retrieve the
crypto device object.

This leaves no user of the crypto_dev field in the dpaa device object.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/dpaa/bus_dpaa_driver.h | 1 -
 drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/dpaa/bus_dpaa_driver.h b/drivers/bus/dpaa/bus_dpaa_driver.h
index 5ddb52c419..6759792eea 100644
--- a/drivers/bus/dpaa/bus_dpaa_driver.h
+++ b/drivers/bus/dpaa/bus_dpaa_driver.h
@@ -82,7 +82,6 @@ struct rte_dpaa_device {
 	struct rte_device device;
 	union {
 		struct rte_eth_dev *eth_dev;
-		struct rte_cryptodev *crypto_dev;
 		struct rte_dma_dev *dmadev;
 	};
 	struct dpaa_device_id id;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 65bbd38b17..c53ee70853 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3773,7 +3773,6 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 				struct rte_dpaa_device *dpaa_dev)
 {
 	struct rte_cryptodev *cryptodev;
-	char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	int retval;
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
@@ -3786,14 +3785,11 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name);
-
-	cryptodev = rte_cryptodev_pmd_create(cryptodev_name, &dpaa_dev->device, &init_params);
+	cryptodev = rte_cryptodev_pmd_create(dpaa_dev->name, &dpaa_dev->device, &init_params);
 	if (cryptodev == NULL) {
 		DPAA_SEC_ERR("failed to create cryptodev vdev");
 		return -ENOMEM;
 	}
-	dpaa_dev->crypto_dev = cryptodev;
 
 	/* if sec device version is not configured */
 	if (!rta_get_sec_era()) {
@@ -3839,7 +3835,7 @@ cryptodev_dpaa_sec_remove(struct rte_dpaa_device *dpaa_dev)
 	struct rte_cryptodev *cryptodev;
 	int ret;
 
-	cryptodev = dpaa_dev->crypto_dev;
+	cryptodev = rte_cryptodev_pmd_get_named_dev(dpaa_dev->name);
 	if (cryptodev == NULL)
 		return -ENODEV;
 
-- 
2.53.0


  reply	other threads:[~2026-06-11 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 13:07 [PATCH 0/3] Cleanup rte_dpaa_device David Marchand
2026-06-11 13:07 ` David Marchand [this message]
2026-06-11 13:07 ` [PATCH 2/3] dma/dpaa: remove dmadev pointer from bus device David Marchand
2026-06-11 13:07 ` [PATCH 3/3] net/dpaa: remove ethdev " David Marchand
2026-06-25 11:23 ` [PATCH 0/3] Cleanup rte_dpaa_device David Marchand

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20260611130738.1720628-2-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=sachin.saxena@nxp.com \
    /path/to/YOUR_REPLY

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

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