DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rajesh Mudimadugula <rmudimadugul@marvell.com>
To: <dev@dpdk.org>
Cc: <jianjay.zhou@huawei.com>,
	Rajesh Mudimadugula <rmudimadugul@marvell.com>
Subject: [PATCH] crypto/virtio: fix driver ID for virtio
Date: Wed, 28 May 2025 10:53:47 +0000	[thread overview]
Message-ID: <20250528105347.2014993-1-rmudimadugul@marvell.com> (raw)

This patch corrects driver id for virtio and virtio_user
pmds.

Fixes: 25500d4b8076 ("crypto/virtio: support device init")

Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
---
 drivers/crypto/virtio/virtio_cryptodev.c      | 4 ++--
 drivers/crypto/virtio/virtio_user_cryptodev.c | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index fa215fe528..ca06cf2e37 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -550,7 +550,6 @@ crypto_virtio_dev_init(struct rte_cryptodev *cryptodev, uint64_t features,
 {
 	struct virtio_crypto_hw *hw;
 
-	cryptodev->driver_id = cryptodev_virtio_driver_id;
 	cryptodev->dev_ops = &virtio_crypto_dev_ops;
 
 	cryptodev->enqueue_burst = virtio_crypto_pkt_tx_burst;
@@ -599,6 +598,7 @@ crypto_virtio_create(const char *name, struct rte_pci_device *pci_dev,
 	if (cryptodev == NULL)
 		return -ENODEV;
 
+	cryptodev->driver_id = cryptodev_virtio_driver_id;
 	if (crypto_virtio_dev_init(cryptodev, VIRTIO_CRYPTO_PMD_GUEST_FEATURES,
 			pci_dev) < 0)
 		return -1;
@@ -1666,7 +1666,7 @@ virtio_crypto_dev_info_get(struct rte_cryptodev *dev,
 	PMD_INIT_FUNC_TRACE();
 
 	if (info != NULL) {
-		info->driver_id = cryptodev_virtio_driver_id;
+		info->driver_id = dev->driver_id;
 		info->feature_flags = dev->feature_flags;
 		info->max_nb_queue_pairs = hw->max_dataqueues;
 		/* No limit of number of sessions */
diff --git a/drivers/crypto/virtio/virtio_user_cryptodev.c b/drivers/crypto/virtio/virtio_user_cryptodev.c
index 992e8fb43b..4daa188e1d 100644
--- a/drivers/crypto/virtio/virtio_user_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_user_cryptodev.c
@@ -26,6 +26,8 @@
 
 #define virtio_user_get_dev(hwp) container_of(hwp, struct virtio_user_dev, hw)
 
+uint8_t cryptodev_virtio_user_driver_id;
+
 static void
 virtio_user_read_dev_config(struct virtio_crypto_hw *hw, size_t offset,
 		     void *dst, int length __rte_unused)
@@ -460,6 +462,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev)
 		goto end;
 	}
 
+	cryptodev->driver_id = cryptodev_virtio_user_driver_id;
 	if (crypto_virtio_dev_init(cryptodev, VIRTIO_USER_CRYPTO_PMD_GUEST_FEATURES,
 			NULL) < 0) {
 		PMD_INIT_LOG(ERR, "crypto_virtio_dev_init fails");
@@ -563,8 +566,6 @@ static struct rte_vdev_driver virtio_user_driver = {
 
 static struct cryptodev_driver virtio_crypto_drv;
 
-uint8_t cryptodev_virtio_user_driver_id;
-
 RTE_PMD_REGISTER_VDEV(crypto_virtio_user, virtio_user_driver);
 RTE_PMD_REGISTER_CRYPTO_DRIVER(virtio_crypto_drv,
 	virtio_user_driver.driver,
-- 
2.34.1


             reply	other threads:[~2025-05-28 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 10:53 Rajesh Mudimadugula [this message]
2025-06-03 14:42 ` [EXTERNAL] " Akhil Goyal

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=20250528105347.2014993-1-rmudimadugul@marvell.com \
    --to=rmudimadugul@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jianjay.zhou@huawei.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;
as well as URLs for NNTP newsgroup(s).