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 B7FB341E72; Sat, 11 Mar 2023 12:50:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F25F40E2D; Sat, 11 Mar 2023 12:50:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id C141740DDC for ; Sat, 11 Mar 2023 12:50:53 +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 32BAwaC0024966 for ; Sat, 11 Mar 2023 03:50:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=IhkTZsydmqIvtfZNPERuYaOWxZowcNRdRhiwsVPYkf4=; b=YMEmHBl6vdfH5SKzWfdxG+tkWgFxaRaHqiQAuUR39LyS3nsH3XIiTUPYSpJytvEdubh9 qR8cLcISJMwMXTalU9VwFrLv6AaShszrzK1LOOTTICrWjdTN7tvM1YcI32yCXYn9Q/xb 8xAOJXFtLuywsQBZpEOp2omHGvkrAbTupqlv8tk7IxkehhEB67GBBwDiwJ8k/YuT0Byk 39q4CicsnF2wlDL50rfkn7X0ATA5VefK9PgVHav8Fjt/+C6GoZos2bR2rSQJfpXhSsWa Thkv1UYf3MWqOu8OtU5riiLdc2zR8sfyKB1MMnN/XtNFE0+AxKdRWogjjyVqh/ylnR1r Vw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3p80k7dxt8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 11 Mar 2023 03:50:52 -0800 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; Sat, 11 Mar 2023 03:50:50 -0800 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; Sat, 11 Mar 2023 03:50:50 -0800 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 3EFD45E6861; Sat, 11 Mar 2023 03:50:50 -0800 (PST) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Prince Takkar CC: , , , Subject: [PATCH] ml/cnxk: fix updating error code and message Date: Sat, 11 Mar 2023 03:50:45 -0800 Message-ID: <20230311115045.23320-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: JXuTwGnpFgLzxWvzRp85_P_FKk2_-G4R X-Proofpoint-ORIG-GUID: JXuTwGnpFgLzxWvzRp85_P_FKk2_-G4R 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-11_04,2023-03-10_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 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 --- 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