From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <aprabhu@marvell.com>,
<ptakkar@marvell.com>, <jerinj@marvell.com>
Subject: [PATCH 1/1] ml/cnxk: fix reading model and layer ID
Date: Wed, 22 Nov 2023 08:37:05 -0800 [thread overview]
Message-ID: <20231122163706.758-1-syalavarthi@marvell.com> (raw)
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>
---
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
next reply other threads:[~2023-11-22 16:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 16:37 Srikanth Yalavarthi [this message]
2023-11-22 18:35 ` [PATCH v2 " Srikanth Yalavarthi
2023-11-23 0:27 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231122163706.758-1-syalavarthi@marvell.com \
--to=syalavarthi@marvell.com \
--cc=aprabhu@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=ptakkar@marvell.com \
--cc=sshankarnara@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).