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

Message ID 20230830155120.29505-1-syalavarthi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v1,1/1] app/mldev: report device not found as error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Srikanth Yalavarthi Aug. 30, 2023, 3:51 p.m. UTC
  Report ML device not found as error, instead of panic.

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

Comments

Anup Prabhu Oct. 3, 2023, 6 a.m. UTC | #1
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, August 30, 2023 9:21 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Anup Prabhu <aprabhu@marvell.com>;
> Prince Takkar <ptakkar@marvell.com>
> Subject: [PATCH v1 1/1] app/mldev: report device not found as error
> 
> Report ML device not found as error, instead of panic.
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
>  app/test-mldev/ml_main.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
Acked-by: Anup Prabhu <aprabhu@marvell.com>
  
Shivah Shankar Shankar Narayan Rao Oct. 5, 2023, 2:21 p.m. UTC | #2
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, August 30, 2023 9:21 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Anup Prabhu <aprabhu@marvell.com>;
> Prince Takkar <ptakkar@marvell.com>
> Subject: [PATCH v1 1/1] app/mldev: report device not found as error
> 
> Report ML device not found as error, instead of panic.
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Shivah Shankar S <sshankarnara@marvell.com>
  
Thomas Monjalon Nov. 14, 2023, 7:44 p.m. UTC | #3
05/10/2023 16:21, Shivah Shankar Shankar Narayan Rao:
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > 
> > Report ML device not found as error, instead of panic.
> > 
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Acked-by: Shivah Shankar S <sshankarnara@marvell.com>

Applied, thanks.
  

Patch

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);