[v2,1/1] ml/cnxk: fix reading model and layer ID

Message ID 20231122183559.2373-1-syalavarthi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2,1/1] ml/cnxk: fix reading model and layer ID |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-compile-arm64-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Srikanth Yalavarthi Nov. 22, 2023, 6:35 p.m. UTC
  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 <syalavarthi@marvell.com>
---
v2:
  - restart upstream CI

 drivers/ml/cnxk/cn10k_ml_ops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon Nov. 23, 2023, 12:27 a.m. UTC | #1
22/11/2023 19:35, Srikanth Yalavarthi:
> 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 <syalavarthi@marvell.com>

Applied
  

Patch

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)) {