DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ml/cnxk: fix updating error code and message
@ 2023-03-11 11:50 Srikanth Yalavarthi
  2023-03-16 17:01 ` Thomas Monjalon
  2023-03-16 17:22 ` [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info Srikanth Yalavarthi
  0 siblings, 2 replies; 5+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-11 11:50 UTC (permalink / raw)
  To: Srikanth Yalavarthi, Prince Takkar; +Cc: dev, sshankarnara, aprabhu, pshukla

Error code reported by applications is incorrect, as the value
is not being set by error get function. For error subtype not
supported by driver, the error message reported is incorrect.

Fixes: 57c37b852f2c ("ml/cnxk: support firmware error code query")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 drivers/ml/cnxk/cn10k_ml_ops.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 5b77e47322..7d5eb97668 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -2210,7 +2210,10 @@ cn10k_ml_op_error_get(struct rte_ml_dev *dev, struct rte_ml_op *op, struct rte_m
 	/* Copy sub error message */
 	if (error_code->s.etype == ML_ETYPE_HW_NONFATAL) {
 		strcat(msg, " : ");
-		strcat(msg, ml_stype_db_hw_nf[error_code->s.stype].msg);
+		if (error_code->s.stype < PLT_DIM(ml_stype_db_hw_nf))
+			strcat(msg, ml_stype_db_hw_nf[error_code->s.stype].msg);
+		else
+			strcat(msg, "UNKNOWN ERROR");
 	}
 
 	if (error_code->s.etype == ML_ETYPE_DRIVER) {
@@ -2219,6 +2222,7 @@ cn10k_ml_op_error_get(struct rte_ml_dev *dev, struct rte_ml_op *op, struct rte_m
 	}
 
 	plt_strlcpy(error->message, msg, sizeof(error->message));
+	error->errcode = error_code->u64;
 
 	return 0;
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-19 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 11:50 [PATCH] ml/cnxk: fix updating error code and message Srikanth Yalavarthi
2023-03-16 17:01 ` Thomas Monjalon
2023-03-16 17:23   ` [EXT] " Srikanth Yalavarthi
2023-03-16 17:22 ` [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info Srikanth Yalavarthi
2023-03-19 16:51   ` Thomas Monjalon

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