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 9970745F2A; Tue, 24 Dec 2024 08:37:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 882A3402DE; Tue, 24 Dec 2024 08:37:42 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 412DD402DD for ; Tue, 24 Dec 2024 08:37:40 +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 4BO7ApgJ003101; Mon, 23 Dec 2024 23:37:39 -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 kyxEnH7it0GJp35URYqU7t6d89gnyJ2VRpZ5SS1cyA=; b=G7i3cFHN0GNQFYkvE I15EBu9sp1yVblbclI3s4t8jP9KYLEbl6NNfRp5Sa8qAySw5Xvb5Ymo+hu/7If6I JcimeGCg8CifdlR/SEv0GcPborrLHIbruQ1VygigsmrScJXVAnDImDBe5X8g8JsT MfDHLjfq2o76DVKEoY0zhsC1f1/JbZpKcmm4z82A4lMKyL7SMZSxRGu85V9uRlO/ 6qcDiovAeky4RmmVOtXRlO0YuFm8bi6eHimDY0F8tRRPMRb/Ogb3nU/aOzsThSb/ TI8x3xdgBJhCrwhNBodDftIT47DiOI1MNVfpk4tygRDxAhMStm2HbiqVwj6R736B +uGSA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 43qrb80210-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Dec 2024 23:37:39 -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; Mon, 23 Dec 2024 23:37:38 -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; Mon, 23 Dec 2024 23:37:38 -0800 Received: from IN-lckQE5Rwctls.marvell.com (IN-lckQE5Rwctls.marvell.com [10.28.163.68]) by maili.marvell.com (Postfix) with ESMTP id 523D23F705D; Mon, 23 Dec 2024 23:37:35 -0800 (PST) From: Gowrishankar Muthukrishnan To: , Akhil Goyal , Maxime Coquelin , Chenbo Xia , Fan Zhang , Jay Zhou , Thomas Monjalon CC: , , Rajesh Mudimadugula Subject: [v1 02/16] crypto/virtio: remove redundant crypto queue free Date: Tue, 24 Dec 2024 13:07:00 +0530 Message-ID: <4aa6c428b83d4ad506f026d239483cac2cc84c71.1735025264.git.gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: mqjxSUaKR9xPKuawKeaiqeRqQF8pJpZh X-Proofpoint-GUID: mqjxSUaKR9xPKuawKeaiqeRqQF8pJpZh 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 From: Rajesh Mudimadugula 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 818798273f..92d77bbb45 100644 --- a/.mailmap +++ b/.mailmap @@ -1247,6 +1247,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.25.1