patch 'crypto/virtio: fix redundant queue free' has been queued to stable release 23.11.4

Xueming Li xuemingl at nvidia.com
Tue Feb 18 13:34:16 CET 2025


Hi,

FYI, your patch has been queued to stable release 23.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
Please shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=90eb624eb6120756bd3ab64b2a0350406203840e

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 90eb624eb6120756bd3ab64b2a0350406203840e Mon Sep 17 00:00:00 2001
From: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Date: Wed, 27 Nov 2024 14:12:48 +0000
Subject: [PATCH] crypto/virtio: fix redundant queue free
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 89241aba832c044a9efb99329cfaa9faff8a6c4e ]

Remove multiple invocations of virtio_crypto_queue_release,
and set virtio crypto queue as null upon free to avoid
segfaults.

Fixes: 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")

Signed-off-by: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 .mailmap                                 |  1 +
 drivers/crypto/virtio/virtio_cryptodev.c | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.mailmap b/.mailmap
index 75440baa40..658de81358 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1185,6 +1185,7 @@ Rahul Gupta <rahul.gupta at broadcom.com>
 Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
 Rahul Shah <rahul.r.shah at intel.com>
 Raja Zidane <rzidane at nvidia.com>
+Rajesh Mudimadugula <rmudimadugul at marvell.com>
 Rajesh Ravi <rajesh.ravi at broadcom.com>
 Rakesh Kudurumalla <rkudurumalla at marvell.com> <rkudurumalla at caviumnetworks.com>
 Ralf Hoffmann <ralf.hoffmann at allegro-packets.com>
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index c0d3178b71..0c3af3e3b0 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -479,10 +479,13 @@ virtio_crypto_free_queues(struct rte_cryptodev *dev)

 	/* control queue release */
 	virtio_crypto_queue_release(hw->cvq);
+	hw->cvq = NULL;

 	/* data queue release */
-	for (i = 0; i < hw->max_dataqueues; i++)
+	for (i = 0; i < hw->max_dataqueues; i++) {
 		virtio_crypto_queue_release(dev->data->queue_pairs[i]);
+		dev->data->queue_pairs[i] = NULL;
+	}
 }

 static int
@@ -614,6 +617,7 @@ virtio_crypto_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
 	}

 	virtio_crypto_queue_release(vq);
+	dev->data->queue_pairs[queue_pair_id] = NULL;
 	return 0;
 }

@@ -761,8 +765,6 @@ crypto_virtio_create(const char *name, struct rte_pci_device *pci_dev,
 static int
 virtio_crypto_dev_uninit(struct rte_cryptodev *cryptodev)
 {
-	struct virtio_crypto_hw *hw = cryptodev->data->dev_private;
-
 	PMD_INIT_FUNC_TRACE();

 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
@@ -777,9 +779,6 @@ virtio_crypto_dev_uninit(struct rte_cryptodev *cryptodev)
 	cryptodev->enqueue_burst = NULL;
 	cryptodev->dequeue_burst = NULL;

-	/* release control queue */
-	virtio_crypto_queue_release(hw->cvq);
-
 	rte_free(cryptodev->data);
 	cryptodev->data = NULL;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-18 19:39:01.496296798 +0800
+++ 0021-crypto-virtio-fix-redundant-queue-free.patch	2025-02-18 19:39:00.468244075 +0800
@@ -1 +1 @@
-From 89241aba832c044a9efb99329cfaa9faff8a6c4e Mon Sep 17 00:00:00 2001
+From 90eb624eb6120756bd3ab64b2a0350406203840e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 89241aba832c044a9efb99329cfaa9faff8a6c4e ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 8524952d24..e428ed3dec 100644
+index 75440baa40..658de81358 100644
@@ -24 +26 @@
-@@ -1252,6 +1252,7 @@ Rahul Gupta <rahul.gupta at broadcom.com>
+@@ -1185,6 +1185,7 @@ Rahul Gupta <rahul.gupta at broadcom.com>
@@ -33 +35 @@
-index 643921dc02..98415af123 100644
+index c0d3178b71..0c3af3e3b0 100644
@@ -36 +38 @@
-@@ -478,10 +478,13 @@ virtio_crypto_free_queues(struct rte_cryptodev *dev)
+@@ -479,10 +479,13 @@ virtio_crypto_free_queues(struct rte_cryptodev *dev)
@@ -51 +53 @@
-@@ -613,6 +616,7 @@ virtio_crypto_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
+@@ -614,6 +617,7 @@ virtio_crypto_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
@@ -59 +61 @@
-@@ -760,8 +764,6 @@ crypto_virtio_create(const char *name, struct rte_pci_device *pci_dev,
+@@ -761,8 +765,6 @@ crypto_virtio_create(const char *name, struct rte_pci_device *pci_dev,
@@ -68 +70 @@
-@@ -776,9 +778,6 @@ virtio_crypto_dev_uninit(struct rte_cryptodev *cryptodev)
+@@ -777,9 +779,6 @@ virtio_crypto_dev_uninit(struct rte_cryptodev *cryptodev)


More information about the stable mailing list