[dpdk-dev] [PATCH] app/testpmd: fix Tx/Rx descriptor query error log
Min Hu (Connor)
humin29 at huawei.com
Sat Mar 27 08:34:54 CET 2021
From: Hongbo Zheng <zhenghongbo3 at 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 at dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3 at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at 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
More information about the dev
mailing list