ml/cnxk: fix updating error code and message
Checks
Commit Message
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(-)
Comments
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.
> -----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.
>
>
@@ -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;
}