diff mbox series

app/testpmd: log reason of port start failure

Message ID 20210311104835.3278164-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series app/testpmd: log reason of port start failure | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko March 11, 2021, 10:48 a.m. UTC
Provide a bit more diagnostics information when port start fails.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 app/test-pmd/testpmd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Li, Xiaoyun March 12, 2021, 1:49 a.m. UTC | #1
> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Thursday, March 11, 2021 18:49
> To: Li, Xiaoyun <xiaoyun.li@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] app/testpmd: log reason of port start failure
> 
> Provide a bit more diagnostics information when port start fails.
> 
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>  app/test-pmd/testpmd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 98c3248c01..96d2e0fcec 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2626,8 +2626,10 @@ start_port(portid_t pid)
>  		cnt_pi++;
> 
>  		/* start port */
> -		if (rte_eth_dev_start(pi) < 0) {
> -			printf("Fail to start port %d\n", pi);
> +		diag = rte_eth_dev_start(pi);
> +		if (diag < 0) {
> +			printf("Fail to start port %d: %s\n", pi,
> +			       rte_strerror(-diag));
> 
>  			/* Fail to setup rx queue, return */
>  			if (rte_atomic16_cmpset(&(port->port_status),
> --
> 2.30.1

Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Ferruh Yigit March 12, 2021, 2:35 p.m. UTC | #2
On 3/12/2021 1:49 AM, Li, Xiaoyun wrote:
> 
> 
>> -----Original Message-----
>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> Sent: Thursday, March 11, 2021 18:49
>> To: Li, Xiaoyun <xiaoyun.li@intel.com>
>> Cc: dev@dpdk.org
>> Subject: [PATCH] app/testpmd: log reason of port start failure
>>
>> Provide a bit more diagnostics information when port start fails.
>>
>> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> ---
> 
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
> 

Applied to dpdk-next-net/main, thanks.
diff mbox series

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 98c3248c01..96d2e0fcec 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2626,8 +2626,10 @@  start_port(portid_t pid)
 		cnt_pi++;
 
 		/* start port */
-		if (rte_eth_dev_start(pi) < 0) {
-			printf("Fail to start port %d\n", pi);
+		diag = rte_eth_dev_start(pi);
+		if (diag < 0) {
+			printf("Fail to start port %d: %s\n", pi,
+			       rte_strerror(-diag));
 
 			/* Fail to setup rx queue, return */
 			if (rte_atomic16_cmpset(&(port->port_status),