From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C126E41EB2; Thu, 16 Mar 2023 18:22:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9ADD642D73; Thu, 16 Mar 2023 18:22:25 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0440440DDC for ; Thu, 16 Mar 2023 18:22:23 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32GGkB3C007381 for ; Thu, 16 Mar 2023 10:22:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=o7fCIN6Jh1jp+m2oDBkq567tlDYzflUGHk3EWf6vdzQ=; b=Z2SxM0J8vUthOrKasKNMfXtSUx/pGNSrF5/tMuohWDKW/dHuGwrOV//RwRv6eY22F/Rz zkTJcqhEA2MR6zdOKCOAeyEyyNB0FQUO05iRqHUpMR7L4z9wHQQRJgol3vN0wBQ73Q9J mCw+sa76UMWqGnbrUMFtW3KGYnJRGcrTlVY0GvUga3NqCSO8Fi16P6SGMHxdf79rO8lD qK1ibii3t+t/Z/hcLDV4EqGPGWLj32Pkn5b2kePLLWpCxqpobDEkZKJROE+0B7ZrfI8N SjVr17/Y+B4YeQf82R2PmjN0PM9rUTzuENS/UF4orBhZh5F7CkTB+245Y16RwaXt3+32 bA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3pbs2u30ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 Mar 2023 10:22:23 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Mar 2023 10:22:21 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 16 Mar 2023 10:22:21 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id A89105C6937; Thu, 16 Mar 2023 10:22:17 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Prince Takkar CC: , , Subject: [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info Date: Thu, 16 Mar 2023 10:22:15 -0700 Message-ID: <20230316172215.20067-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230311115045.23320-1-syalavarthi@marvell.com> References: <20230311115045.23320-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: RFJsOZSEoQcRm_xI14YeQoR4HbUsbW-C X-Proofpoint-ORIG-GUID: RFJsOZSEoQcRm_xI14YeQoR4HbUsbW-C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_10,2023-03-16_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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