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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 17 18:03:50 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/19/25. So 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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8d2f28691561ee61e933df70b750f9b1fad0dc4a

Thanks.

Luca Boccassi

---
>From 8d2f28691561ee61e933df70b750f9b1fad0dc4a 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

[ 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 8eb97ded9f..9b6f5f770d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1137,6 +1137,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 4854820ba6..b696cedb49 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.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-17 16:13:17.491893186 +0000
+++ 0017-crypto-virtio-fix-redundant-queue-free.patch	2025-02-17 16:13:16.798441593 +0000
@@ -1 +1 @@
-From 89241aba832c044a9efb99329cfaa9faff8a6c4e Mon Sep 17 00:00:00 2001
+From 8d2f28691561ee61e933df70b750f9b1fad0dc4a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 89241aba832c044a9efb99329cfaa9faff8a6c4e ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 8524952d24..e428ed3dec 100644
+index 8eb97ded9f..9b6f5f770d 100644
@@ -24 +25 @@
-@@ -1252,6 +1252,7 @@ Rahul Gupta <rahul.gupta at broadcom.com>
+@@ -1137,6 +1137,7 @@ Rahul Gupta <rahul.gupta at broadcom.com>
@@ -33 +34 @@
-index 643921dc02..98415af123 100644
+index 4854820ba6..b696cedb49 100644
@@ -36 +37 @@
-@@ -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 +52 @@
-@@ -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 +60 @@
-@@ -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 +69 @@
-@@ -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