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 8445C45F2A for ; Tue, 24 Dec 2024 08:38:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3A15402DE; Tue, 24 Dec 2024 08:38:24 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 42433402DE; Tue, 24 Dec 2024 08:38:23 +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 4BO7ApJX003098; Mon, 23 Dec 2024 23:38:22 -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=R puh6ca4zZTpxE5UQlbOxQ5KsVbBji8MV8T4iH2NN7g=; b=NJdbNw3bk6KzifyBE 4Tl9O+Q/RZR7/tk0FpGCh6HeTheGNoogNqMRRrTILbFgmaoUuNCRugcr6hB8bUWM fNE018ZTZf4amM7/D98VqW/mUU9lPGirgPNMLRn9QPB0H8HVtO1jOkg2z6rR703r XWaKajCnhp2GLkbWxrb6b4Fq44rieKjFFzUz3x2GSWCmCzzEim5Rp6vccVrosUAr VgnutqFa3dEniLCWUJdl5St1M969sOjLspv1gncdBxfbX6h++9rPvBf/Tq7yF4UG 8lB/ZHHWiHCn40bHllUdrwJhtvcIUOpPxMvwiOQfCwptJ0Gl0Elc7kPzluiiN3rx lAFqw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 43qrb8025u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Dec 2024 23:38:22 -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:38:21 -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:38:21 -0800 Received: from IN-lckQE5Rwctls.marvell.com (IN-lckQE5Rwctls.marvell.com [10.28.163.68]) by maili.marvell.com (Postfix) with ESMTP id 4643E3F705D; Mon, 23 Dec 2024 23:38:18 -0800 (PST) From: Gowrishankar Muthukrishnan To: , Akhil Goyal , Maxime Coquelin , Chenbo Xia , Fan Zhang , Jay Zhou CC: , , Rajesh Mudimadugula , Gowrishankar Muthukrishnan , Subject: [v1 09/16] crypto/virtio: fix dataqueues iteration Date: Tue, 24 Dec 2024 13:07:07 +0530 Message-ID: <3f6a6ec3e530fc448859f59cf6a28eaf71d1476b.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: LYIZ71mYMizFXs_tHyvzJ4_5-z95zdYE X-Proofpoint-GUID: LYIZ71mYMizFXs_tHyvzJ4_5-z95zdYE 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 f9a3f1e13a..afeab5a816 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -863,9 +863,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 d00af8b7ce..c456dc327e 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -612,12 +612,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