From patchwork Thu Mar 23 16:21:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srikanth Yalavarthi X-Patchwork-Id: 125460 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F3D44281F; Thu, 23 Mar 2023 17:21:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29F8C40689; Thu, 23 Mar 2023 17:21:20 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6C7794021E for ; Thu, 23 Mar 2023 17:21:18 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32NBG8WI024016 for ; Thu, 23 Mar 2023 09:21:17 -0700 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=/CfVgXorhPJx+gVuj9awo3+8RsSz0feZ+f5JJ/KsfQs=; b=Ke1JlwafjJ6PNWUoKT1Y9txQiRQUo0CZFeGue+9pXaj4CiF8dXOtQOYFQ2jBOd01MBpF dsWv1J2nOEIrrgvirT+XgSWk0H1pqfQx1fmNvNyA5niKeYzzhrd2fcr4J0+u5M6D3oi0 ZNqAGDmN4wcfBi9Zk3p15+uISdJyWCB2iT4VnVuMhUeie74QCUvvzwRUgQFpK1y746Qm XaX1HG2ZfXtR7622DdmZWgsJUAVy2/ep66v4z1+juCBL3/orkVmMMVbmLBEQWIHf+WWv ew34SPZ13zER4s2vZIQ1wSp4DoyM6XTHn6NMgayMp4AWVq71IHZx0RfIiqyyriKhJd7/ vg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pg9urcj7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 09:21:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 23 Mar 2023 09:21:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 23 Mar 2023 09:21:15 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 6C56F3F7090; Thu, 23 Mar 2023 09:21:15 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Anup Prabhu CC: , , Subject: [PATCH 1/1] app/mldev: add check for model and filelist option Date: Thu, 23 Mar 2023 09:21:11 -0700 Message-ID: <20230323162111.5303-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Proofpoint-GUID: sGKqUB6EYMEMxvJt9gjleGWzuc_V8Xez X-Proofpoint-ORIG-GUID: sGKqUB6EYMEMxvJt9gjleGWzuc_V8Xez 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-22_21,2023-03-23_02,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 Application currently doesn't check for empty models list and filelist entries. This causes the app to report an incorrect error messages and test status when the lists are empty. Fixes: bbd272edcb14 ("app/mldev: add ordered inferences") Fixes: f6661e6d9a3a ("app/mldev: validate model operations") Signed-off-by: Srikanth Yalavarthi --- app/test-mldev/test_inference_common.c | 6 ++++++ app/test-mldev/test_model_ops.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c index c8cd80d69f..410e63bca4 100644 --- a/app/test-mldev/test_inference_common.c +++ b/app/test-mldev/test_inference_common.c @@ -344,6 +344,12 @@ test_inference_opt_check(struct ml_options *opt) if (ret != 0) return ret; + /* check for at least one filelist */ + if (opt->nb_filelist == 0) { + ml_err("Filelist empty, need at least one filelist to run the test\n"); + return -EINVAL; + } + /* check file availability */ for (i = 0; i < opt->nb_filelist; i++) { if (access(opt->filelist[i].model, F_OK) == -1) { diff --git a/app/test-mldev/test_model_ops.c b/app/test-mldev/test_model_ops.c index 5bbbcb1a6c..9de13247ae 100644 --- a/app/test-mldev/test_model_ops.c +++ b/app/test-mldev/test_model_ops.c @@ -30,6 +30,12 @@ test_model_ops_opt_check(struct ml_options *opt) if (ret != 0) return ret; + /* check for at least one model */ + if (opt->nb_filelist == 0) { + ml_err("Models list empty, need at least one model to run the test\n"); + return -EINVAL; + } + /* check model file availability */ for (i = 0; i < opt->nb_filelist; i++) { if (access(opt->filelist[i].model, F_OK) == -1) {