[PATCH 1/3] crypto/dpaa_sec: remove cryptodev pointer from bus device
David Marchand
david.marchand at redhat.com
Thu Jun 11 15:07:35 CEST 2026
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 at 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
More information about the dev
mailing list