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 E900646010; Tue, 7 Jan 2025 18:36:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81A2540150; Tue, 7 Jan 2025 18:36:52 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6B2BF4014F; Tue, 7 Jan 2025 18:36:51 +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 507HHk6m013366; Tue, 7 Jan 2025 09:36:50 -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=W2f5sF+iooyq5v3IX+Yrp4b FQB/mL5cZ9SiqeBbrzws=; b=gzpU87RaHBoX7G5OvcRG5/8lXEOqHkVQBIzhMxy +TjjQCbRiWit+JloqDrn/dFG5q+8Rh3KkW1JyxEpTsioOO/975NeLs/1JgiVlSMp eJLRLUi3qDepHzGl8Ta8QwPgWTvw6ZYDFhC5zzpIYFILnMdM9dRU3RbTGevFlWlC 1r3tq1F//OS6Q87kBBeYaSDqVGLo46i3cVlxHYioyvXbU+wp0o6TK6rgWN0NwbZJ UkjC7Kf9Xv9+hnz7gOkdOH54hi0pvNKL0ZGB6HaXv8RxQgUPKvt+PSyvZnyoDZA6 I8BG6Yq3e5tj8gyFw3f4Q+G9cR/su2pDx4zPhDf/W9kSN/Q== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4418hvr1dv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Jan 2025 09:36:50 -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; Tue, 7 Jan 2025 09:36:49 -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; Tue, 7 Jan 2025 09:36:49 -0800 Received: from IN-lckQE5Rwctls.marvell.com (IN-lckQE5Rwctls.marvell.com [10.28.163.68]) by maili.marvell.com (Postfix) with ESMTP id 590D53F703F; Tue, 7 Jan 2025 09:36:46 -0800 (PST) From: Gowrishankar Muthukrishnan To: , Akhil Goyal , Maxime Coquelin , Chenbo Xia , Fan Zhang , Jay Zhou CC: , , Gowrishankar Muthukrishnan , Subject: [PATCH] crypto/virtio: fix dataqueues iteration Date: Tue, 7 Jan 2025 23:06:02 +0530 Message-ID: <20250107173605.1814-1-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: kYrDgQAiSkb6SYbzpSCTuHbZIdgZHOym X-Proofpoint-ORIG-GUID: kYrDgQAiSkb6SYbzpSCTuHbZIdgZHOym 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 Fix dataqueues iteration using nb_queue_pairs info available in device data instead of max dataqueues as dataqueue count might have been changed in device configuration. Fixes: 6f0175ff53e0 ("crypto/virtio: support basic PMD ops") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan --- drivers/crypto/virtio/virtio_cryptodev.c | 3 +-- drivers/crypto/virtio/virtio_rxtx.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c index 98415af123..b4a6fae9e0 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -848,9 +848,8 @@ static void virtio_crypto_dev_free_mbufs(struct rte_cryptodev *dev) { uint32_t i; - struct virtio_crypto_hw *hw = dev->data->dev_private; - for (i = 0; i < hw->max_dataqueues; i++) { + for (i = 0; i < dev->data->nb_queue_pairs; i++) { VIRTIO_CRYPTO_INIT_LOG_DBG("Before freeing dataq[%d] used " "and unused buf", i); VIRTQUEUE_DUMP((struct virtqueue *) diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index 48b5f4ebbb..d02486661f 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -419,12 +419,11 @@ virtio_crypto_dataq_start(struct rte_cryptodev *dev) * - Setup vring structure for data queues */ uint16_t i; - struct virtio_crypto_hw *hw = dev->data->dev_private; PMD_INIT_FUNC_TRACE(); /* Start data vring. */ - for (i = 0; i < hw->max_dataqueues; i++) { + for (i = 0; i < dev->data->nb_queue_pairs; i++) { virtio_crypto_vring_start(dev->data->queue_pairs[i]); VIRTQUEUE_DUMP((struct virtqueue *)dev->data->queue_pairs[i]); } -- 2.25.1