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 1611645DB7; Wed, 27 Nov 2024 15:12:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E74B7402AB; Wed, 27 Nov 2024 15:12:58 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D7F0E4025D for ; Wed, 27 Nov 2024 15:12:57 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4ARD8un3030021; Wed, 27 Nov 2024 06:12:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=U NgxiTXHJ0XdMeCbGs41UViQNvrF5MI56aZnpqeAcus=; b=Ml9CQTEpDEPl61va6 AhYbPLVysoKbO6yoXJ0baMA7lh+iys2f+vbbuecO8RfRSmbv0Dht4fMtMvCUCDeO G+ZvPF9UtkS4IzbNFgMfU+OrLORWWUjArTHlC32rTKCFrFWmEKHvvoQpFWyaI7Rf fcjm5sK0sHl5JlDDI4uOn5ejP7NQnElke5uNDQvsDyWQ2zQ1vyKduXGNkknYSEGR WOmuU+dDHzOF0VcU1PPCbyD0vCVZYV53zmPIWE4kkm7yAnEZNdYjsxWF7Q80ropQ aMEZ5dWO4GGm06bjC3IAoRglmnp+yg+sbYqYktq/97OiPfdDWqXLqyR6ZsHddW16 9oLwA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 436427r429-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Nov 2024 06:12:52 -0800 (PST) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.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 06:12:51 -0800 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 27 Nov 2024 06:12:51 -0800 Received: from transport-1.marvell.com (unknown [10.106.48.36]) by maili.marvell.com (Postfix) with ESMTP id 152E83F7093; Wed, 27 Nov 2024 06:12:51 -0800 (PST) From: Rajesh Mudimadugula To: CC: , , Rajesh Mudimadugula Subject: [PATCH v2] crypto/virtio: remove redundant crypto queue free Date: Wed, 27 Nov 2024 14:12:48 +0000 Message-ID: <20241127141248.1078678-1-rmudimadugul@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127133415.1077670-1-rmudimadugul@marvell.com> References: <20241127133415.1077670-1-rmudimadugul@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: hRfIbVEGanmn9O63RqnpFBN39iG8ZhaJ X-Proofpoint-GUID: hRfIbVEGanmn9O63RqnpFBN39iG8ZhaJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 --- .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