app/testpmd: fix Tx/Rx descriptor query error log

Message ID 1616830494-46559-1-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix Tx/Rx descriptor query error log |

Checks

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

Commit Message

humin (Q) March 27, 2021, 7:34 a.m. UTC
  From: Hongbo Zheng <zhenghongbo3@huawei.com>

Currently in testpmd, if we input "show port 0 rxq 0 desc 9999 status"
and if rte_eth_rx_descriptor_status return a negative value, testpmd will
print "Invalid queueid = 0", seems user input an invalid queueid, while
the actual situation may be that 9999 is out of bounds, current
information is misleading to users.

This patch modify the Tx/Rx descriptor query error information in testpmd
by add offset information, now if we fail to query Tx/Rx descriptor,
testpmd will print "Invalid queueid = 0, offset = 9999", then we can check
our input.

Fixes: fae9aa717d6c ("app/testpmd: support checking descriptor status")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-pmd/cmdline.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Li, Xiaoyun March 29, 2021, 5:49 a.m. UTC | #1
Hi

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Saturday, March 27, 2021 15:35
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH] app/testpmd: fix Tx/Rx descriptor query error log
> 
> From: Hongbo Zheng <zhenghongbo3@huawei.com>
> 
> Currently in testpmd, if we input "show port 0 rxq 0 desc 9999 status"
> and if rte_eth_rx_descriptor_status return a negative value, testpmd will print
returns
> "Invalid queueid = 0", seems user input an invalid queueid, while the actual
Users input/ user inputs
> situation may be that 9999 is out of bounds, current information is misleading to
> users.
> 
> This patch modify the Tx/Rx descriptor query error information in testpmd by
modifies
> add offset information, now if we fail to query Tx/Rx descriptor, testpmd will
adding
> print "Invalid queueid = 0, offset = 9999", then we can check our input.

The commit log has grammar mistakes. And I think you can simply explain what the patch does like:
This patch adds more err info for Tx/Rx descriptor query command.

And the print should be "Invalid input: queue id = 0, desc id = 9999" because you still don't tell users if it's queue id err or desc id err.

BRs
Xiaoyun
> 
> Fixes: fae9aa717d6c ("app/testpmd: support checking descriptor status")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  app/test-pmd/cmdline.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 287d7a0..1a74a61 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -16633,7 +16633,8 @@ cmd_show_rx_tx_desc_status_parsed(void
> *parsed_result,
>  		rc = rte_eth_rx_descriptor_status(res->cmd_pid, res->cmd_qid,
>  					     res->cmd_did);
>  		if (rc < 0) {
> -			printf("Invalid queueid = %d\n", res->cmd_qid);
> +			printf("Invalid queueid = %d, offset = %d\n",
> +			       res->cmd_qid, res->cmd_did);
>  			return;
>  		}
>  		if (rc == RTE_ETH_RX_DESC_AVAIL)
> @@ -16646,7 +16647,8 @@ cmd_show_rx_tx_desc_status_parsed(void
> *parsed_result,
>  		rc = rte_eth_tx_descriptor_status(res->cmd_pid, res->cmd_qid,
>  					     res->cmd_did);
>  		if (rc < 0) {
> -			printf("Invalid queueid = %d\n", res->cmd_qid);
> +			printf("Invalid queueid = %d, offset = %d\n",
> +			       res->cmd_qid, res->cmd_did);
>  			return;
>  		}
>  		if (rc == RTE_ETH_TX_DESC_FULL)
> --
> 2.7.4
  
humin (Q) March 29, 2021, 6:47 a.m. UTC | #2
Hi, xiaoyun,
	All has been done in v2, please review it, thanks.

在 2021/3/29 13:49, Li, Xiaoyun 写道:
> Hi
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Saturday, March 27, 2021 15:35
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
>> Subject: [PATCH] app/testpmd: fix Tx/Rx descriptor query error log
>>
>> From: Hongbo Zheng <zhenghongbo3@huawei.com>
>>
>> Currently in testpmd, if we input "show port 0 rxq 0 desc 9999 status"
>> and if rte_eth_rx_descriptor_status return a negative value, testpmd will print
> returns
>> "Invalid queueid = 0", seems user input an invalid queueid, while the actual
> Users input/ user inputs
>> situation may be that 9999 is out of bounds, current information is misleading to
>> users.
>>
>> This patch modify the Tx/Rx descriptor query error information in testpmd by
> modifies
>> add offset information, now if we fail to query Tx/Rx descriptor, testpmd will
> adding
>> print "Invalid queueid = 0, offset = 9999", then we can check our input.
> 
> The commit log has grammar mistakes. And I think you can simply explain what the patch does like:
> This patch adds more err info for Tx/Rx descriptor query command.
> 
> And the print should be "Invalid input: queue id = 0, desc id = 9999" because you still don't tell users if it's queue id err or desc id err.
> 
> BRs
> Xiaoyun
>>
>> Fixes: fae9aa717d6c ("app/testpmd: support checking descriptor status")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   app/test-pmd/cmdline.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
>> 287d7a0..1a74a61 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -16633,7 +16633,8 @@ cmd_show_rx_tx_desc_status_parsed(void
>> *parsed_result,
>>   		rc = rte_eth_rx_descriptor_status(res->cmd_pid, res->cmd_qid,
>>   					     res->cmd_did);
>>   		if (rc < 0) {
>> -			printf("Invalid queueid = %d\n", res->cmd_qid);
>> +			printf("Invalid queueid = %d, offset = %d\n",
>> +			       res->cmd_qid, res->cmd_did);
>>   			return;
>>   		}
>>   		if (rc == RTE_ETH_RX_DESC_AVAIL)
>> @@ -16646,7 +16647,8 @@ cmd_show_rx_tx_desc_status_parsed(void
>> *parsed_result,
>>   		rc = rte_eth_tx_descriptor_status(res->cmd_pid, res->cmd_qid,
>>   					     res->cmd_did);
>>   		if (rc < 0) {
>> -			printf("Invalid queueid = %d\n", res->cmd_qid);
>> +			printf("Invalid queueid = %d, offset = %d\n",
>> +			       res->cmd_qid, res->cmd_did);
>>   			return;
>>   		}
>>   		if (rc == RTE_ETH_TX_DESC_FULL)
>> --
>> 2.7.4
> 
> .
>
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 287d7a0..1a74a61 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -16633,7 +16633,8 @@  cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
 		rc = rte_eth_rx_descriptor_status(res->cmd_pid, res->cmd_qid,
 					     res->cmd_did);
 		if (rc < 0) {
-			printf("Invalid queueid = %d\n", res->cmd_qid);
+			printf("Invalid queueid = %d, offset = %d\n",
+			       res->cmd_qid, res->cmd_did);
 			return;
 		}
 		if (rc == RTE_ETH_RX_DESC_AVAIL)
@@ -16646,7 +16647,8 @@  cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
 		rc = rte_eth_tx_descriptor_status(res->cmd_pid, res->cmd_qid,
 					     res->cmd_did);
 		if (rc < 0) {
-			printf("Invalid queueid = %d\n", res->cmd_qid);
+			printf("Invalid queueid = %d, offset = %d\n",
+			       res->cmd_qid, res->cmd_did);
 			return;
 		}
 		if (rc == RTE_ETH_TX_DESC_FULL)