[PATCH v1 1/1] app/mldev: report device not found as error

Srikanth Yalavarthi syalavarthi at marvell.com
Wed Aug 30 17:51:20 CEST 2023


Report ML device not found as error, instead of panic.

Signed-off-by: Srikanth Yalavarthi <syalavarthi at marvell.com>
---
 app/test-mldev/ml_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-mldev/ml_main.c b/app/test-mldev/ml_main.c
index 940e609c9a8..56941b1afb0 100644
--- a/app/test-mldev/ml_main.c
+++ b/app/test-mldev/ml_main.c
@@ -25,8 +25,10 @@ main(int argc, char **argv)
 	argv += ret;
 
 	mldevs = rte_ml_dev_count();
-	if (!mldevs)
-		rte_panic("no mldev devices found\n");
+	if (!mldevs) {
+		ml_err("no mldev devices found\n");
+		goto error;
+	}
 
 	/* set default values for options */
 	ml_options_default(&opt);
-- 
2.41.0



More information about the dev mailing list