From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 863B945DB7; Wed, 27 Nov 2024 14:34:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53536402AB; Wed, 27 Nov 2024 14:34:22 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4FA964025D for ; Wed, 27 Nov 2024 14:34:21 +0100 (CET) Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AR8qr8J022285; Wed, 27 Nov 2024 05:34:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=K+Ptw32j7c1VG1+Vxesowm8 O1xqsgIRNQMRwJk0rcso=; b=iebC9b85z6rPRjU6zZRBJ0EAAbVFVUsiQNfO00A coQ9nQuSKY5RxqXGsYR7muS54LiOgca4RaVBcx/4s6sdd+RT73e1hmRvaK88Wa5e 5VYXctJ/G8pjSHDZxsbG11L6VIHYigrBWerXajWlZ2oqjRh03zWHlkx9fsSjApiO k8A4w5lXlaObM+OhCUc28dTO3FZKdeBLmpShWwnMkXol6YnNy10egABxgYQm0M6V 8wc69kMzmqLEVWpfFBTHGHdZbUf+1LTkMqBmXaSBnNofLwJpndAzymUW4mso9MNs B33TtRWEN1cGUPhDuxE17F0KJlxkM6+vOrJG3XKO74eeKow== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4360a4ggbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Nov 2024 05:34:19 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 27 Nov 2024 05:34:18 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 27 Nov 2024 05:34:18 -0800 Received: from transport-1.marvell.com (unknown [10.106.48.36]) by maili.marvell.com (Postfix) with ESMTP id 325F13F7054; Wed, 27 Nov 2024 05:34:18 -0800 (PST) From: Rajesh Mudimadugula To: CC: , Rajesh Mudimadugula , sa_ip-toolkits-Jenkins , Akhil Goyal , Gowrishankar Muthukrishnan , Anoob Joseph Subject: [PATCH] crypto/virtio: remove redundant crypto queue free Date: Wed, 27 Nov 2024 13:34:15 +0000 Message-ID: <20241127133415.1077670-1-rmudimadugul@marvell.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: duZdAO6enT1vnfzW9NEI5QmDO6DXV9tS X-Proofpoint-ORIG-GUID: duZdAO6enT1vnfzW9NEI5QmDO6DXV9tS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpdk/+/138957 Base-Builds: sa_ip-toolkits-Jenkins Tested-by: sa_ip-toolkits-Jenkins Reviewed-by: Akhil Goyal Reviewed-by: Gowrishankar Muthukrishnan Reviewed-by: Anoob Joseph --- .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 Lakkireddy Rahul Shah Raja Zidane +Rajesh Mudimadugula Rajesh Ravi Rakesh Kudurumalla Ralf Hoffmann 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