From: Rajesh Mudimadugula <rmudimadugul@marvell.com>
To: <dev@dpdk.org>
Cc: <jianjay.zhou@huawei.com>,
Rajesh Mudimadugula <rmudimadugul@marvell.com>,
sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>,
Akhil Goyal <gakhil@marvell.com>,
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>,
Anoob Joseph <anoobj@marvell.com>
Subject: [PATCH] crypto/virtio: remove redundant crypto queue free
Date: Wed, 27 Nov 2024 13:34:15 +0000 [thread overview]
Message-ID: <20241127133415.1077670-1-rmudimadugul@marvell.com> (raw)
Remove multiple invocations of virtio_crypto_queue_release,
and set virtio crypto queue as null upon free to avoid
segfaults.
Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpdk/+/138957
Base-Builds: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Akhil Goyal <gakhil@marvell.com>
Reviewed-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Reviewed-by: Anoob Joseph <anoobj@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 7334ad58a9..66e275c262 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1246,6 +1246,7 @@ Rahul Gupta <rahul.gupta@broadcom.com>
Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Rahul Shah <rahul.r.shah@intel.com>
Raja Zidane <rzidane@nvidia.com>
+Rajesh Mudimadugula <rmudimadugul@marvell.com>
Rajesh Ravi <rajesh.ravi@broadcom.com>
Rakesh Kudurumalla <rkudurumalla@marvell.com> <rkudurumalla@caviumnetworks.com>
Ralf Hoffmann <ralf.hoffmann@allegro-packets.com>
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 643921dc02..98415af123 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -478,10 +478,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
@@ -613,6 +616,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;
}
@@ -760,8 +764,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)
@@ -776,9 +778,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
next reply other threads:[~2024-11-27 13:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 13:34 Rajesh Mudimadugula [this message]
2024-11-27 14:12 ` [PATCH v2] " Rajesh Mudimadugula
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=20241127133415.1077670-1-rmudimadugul@marvell.com \
--to=rmudimadugul@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=gmuthukrishn@marvell.com \
--cc=jianjay.zhou@huawei.com \
--cc=sa_ip-toolkits-jenkins@marvell.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).