DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>,
	Anup Prabhu <aprabhu@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <ptakkar@marvell.com>
Subject: [PATCH 1/1] app/mldev: add check for model and filelist option
Date: Thu, 23 Mar 2023 09:21:11 -0700	[thread overview]
Message-ID: <20230323162111.5303-1-syalavarthi@marvell.com> (raw)

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 <syalavarthi@marvell.com>
---
 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) {
-- 
2.17.1


             reply	other threads:[~2023-03-23 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:21 Srikanth Yalavarthi [this message]
2023-07-06 16:40 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230323162111.5303-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ptakkar@marvell.com \
    --cc=sshankarnara@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).