* [PATCH 1/1] app/mldev: add check for model and filelist option
@ 2023-03-23 16:21 Srikanth Yalavarthi
2023-07-06 16:40 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-23 16:21 UTC (permalink / raw)
To: Srikanth Yalavarthi, Anup Prabhu; +Cc: dev, sshankarnara, ptakkar
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] app/mldev: add check for model and filelist option
2023-03-23 16:21 [PATCH 1/1] app/mldev: add check for model and filelist option Srikanth Yalavarthi
@ 2023-07-06 16:40 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2023-07-06 16:40 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: Anup Prabhu, dev, sshankarnara, ptakkar
23/03/2023 17:21, Srikanth Yalavarthi:
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-06 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 16:21 [PATCH 1/1] app/mldev: add check for model and filelist option Srikanth Yalavarthi
2023-07-06 16:40 ` Thomas Monjalon
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).