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 7A68E43382; Wed, 22 Nov 2023 17:37:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6988C410FC; Wed, 22 Nov 2023 17:37:13 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EB30D40265 for ; Wed, 22 Nov 2023 17:37:11 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AMGYgGn024041 for ; Wed, 22 Nov 2023 08:37:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Orj/CacvtgtJfnRRUK+wHbC45Dul0GED1bj6iHC0KkQ=; b=FO9dYMqS5li7tKOCkPiGqMLOlKtIvNtTQct4MbOL6vA4InS6U7//orU2bUzGsr4ZbtYM oFpJaLAwnp1EL7JNV5kTT1z5dx7S4l4nK/W7czRgkDE6er+SxPvXWOx1nE5dw8GSrQac 1ed/qUc4yivlQ23VYbBwDS+YaDd0td1iJdKwunavBQjHEfa2GxEARHtMtl3bDjOVsMou fydR8Cg5G3RgS8HMMRpsQsoWMBpyU9D0txk1WqZSd0PeQytBKpseHzL5zAUkcm6aQKY8 /otoEKDWQGyBR6RFIT9taCEtWfqe14JpH5cX0tcZP9tEfnC75bkuXdur0tKr1Pw1uYuw Vg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uewnw664u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 22 Nov 2023 08:37:11 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 22 Nov 2023 08:37:09 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 22 Nov 2023 08:37:09 -0800 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id E0C4C3F7040; Wed, 22 Nov 2023 08:37:08 -0800 (PST) From: Srikanth Yalavarthi To: Srikanth Yalavarthi CC: , , , , Subject: [PATCH 1/1] ml/cnxk: fix reading model and layer ID Date: Wed, 22 Nov 2023 08:37:05 -0800 Message-ID: <20231122163706.758-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: ThHgIHYrfOCHz2VEeFPYjzyzraDRP5fB X-Proofpoint-ORIG-GUID: ThHgIHYrfOCHz2VEeFPYjzyzraDRP5fB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-22_12,2023-11-22_01,2023-05-22_02 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 Using model_id from op structure as layer index for TVM models with multiple MRVL layers is incorrect. This patch fixes the issue by reading the layer index from the job descriptor structure. Fixes: 31cc30b5f088 ("ml/cnxk: update model start/stop functions") Signed-off-by: Srikanth Yalavarthi --- drivers/ml/cnxk/cn10k_ml_ops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c index b9d30278c61..7f7e5efceac 100644 --- a/drivers/ml/cnxk/cn10k_ml_ops.c +++ b/drivers/ml/cnxk/cn10k_ml_ops.c @@ -1191,13 +1191,15 @@ cn10k_ml_result_update(struct cnxk_ml_dev *cnxk_mldev, int qp_id, void *request) uint64_t fw_latency; uint16_t model_id; uint16_t layer_id; + uint16_t idx; req = (struct cnxk_ml_req *)request; result = &req->cn10k_req.result; op = req->op; if (likely(result->error_code == 0)) { - model_id = cnxk_mldev->index_map[op->model_id].model_id; - layer_id = cnxk_mldev->index_map[op->model_id].layer_id; + idx = req->cn10k_req.jd.hdr.model_id; + model_id = cnxk_mldev->index_map[idx].model_id; + layer_id = cnxk_mldev->index_map[idx].layer_id; model = cnxk_mldev->mldev->data->models[model_id]; layer = &model->layer[layer_id]; if (likely(qp_id >= 0)) { -- 2.42.0