* [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
* Re: [PATCH] ml/cnxk: fix updating error code and message
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
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2023-03-16 17:01 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: Prince Takkar, dev, sshankarnara, aprabhu, pshukla
11/03/2023 12:50, Srikanth Yalavarthi:
> Error code reported by applications is incorrect, as the value
Which error is reported by applications?
In general, errors are reported by drivers.
> is not being set by error get function. For error subtype not
> supported by driver, the error message reported is incorrect.
I really fail to understand this explanation.
Are they 2 different issues?
Please help to understand with a better message.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info
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:22 ` Srikanth Yalavarthi
2023-03-19 16:51 ` Thomas Monjalon
1 sibling, 1 reply; 5+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-16 17:22 UTC (permalink / raw)
To: Srikanth Yalavarthi, Prince Takkar; +Cc: dev, sshankarnara, aprabhu
In the rte_ml_op_error_get driver function, the errcode
field of rte_ml_op_error structure is not being updated.
This is causing an incorrect or junk value being reported
as errcode to caller.
For error subtype not supported by driver, the error
message reported is incorrect or junk.
Fixes: 57c37b852f2c ("ml/cnxk: support firmware error code query")
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
v2:
* updated commit message
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
* RE: [EXT] Re: [PATCH] ml/cnxk: fix updating error code and message
2023-03-16 17:01 ` Thomas Monjalon
@ 2023-03-16 17:23 ` Srikanth Yalavarthi
0 siblings, 0 replies; 5+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-16 17:23 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Prince Takkar, dev, Shivah Shankar Shankar Narayan Rao,
Anup Prabhu, Parijat Shukla, Srikanth Yalavarthi
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 16 March 2023 22:32
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: Prince Takkar <ptakkar@marvell.com>; dev@dpdk.org; Shivah Shankar
> Shankar Narayan Rao <sshankarnara@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>; Parijat Shukla <pshukla@marvell.com>
> Subject: [EXT] Re: [PATCH] ml/cnxk: fix updating error code and message
>
> External Email
>
> ----------------------------------------------------------------------
> 11/03/2023 12:50, Srikanth Yalavarthi:
> > Error code reported by applications is incorrect, as the value
>
> Which error is reported by applications?
> In general, errors are reported by drivers.
>
> > is not being set by error get function. For error subtype not
> > supported by driver, the error message reported is incorrect.
>
> I really fail to understand this explanation.
> Are they 2 different issues?
> Please help to understand with a better message.
Submitted v2 patch with updated commit message.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info
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
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2023-03-19 16:51 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: Prince Takkar, dev, sshankarnara, aprabhu
16/03/2023 18:22, Srikanth Yalavarthi:
> In the rte_ml_op_error_get driver function, the errcode
> field of rte_ml_op_error structure is not being updated.
> This is causing an incorrect or junk value being reported
> as errcode to caller.
>
> For error subtype not supported by driver, the error
> message reported is incorrect or junk.
>
> Fixes: 57c37b852f2c ("ml/cnxk: support firmware error code query")
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Applied, thanks.
^ 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).