代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1c7616769fc09d9443cfd39816fa35b4b0ddd33d Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Mon, 5 Jun 2023 10:27:41 +0800
Subject: app/testpmd: fix segment fault with invalid queue ID
[ upstream commit 53191add2203e943c46af0b86002613f22b734b3 ]
When input queue ID is invalid, it will lead to
Segmentation fault, like:
dpdk-testpmd -a 0000:01:00.0 -- -i
testpmd> show port 0 txq/rxq 99 desc 0 status
Segmentation fault
dpdk-testpmd -a 0000:01:00.0 -- -i
testpmd> show port 0 rxq 99 desc used count
Segmentation fault
This patch fixes it.
Fixes: fae9aa717d6c ("app/testpmd: support checking descriptor status")
Fixes: 3f9acb5c83bb ("ethdev: avoid non-dataplane checks in Rx queue count")
Cc: stable@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
app/test-pmd/cmdline.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0d9c7d449c..bc770f3d56 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -17315,12 +17315,13 @@ cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
struct cmd_show_rx_tx_desc_status_result *res = parsed_result;
int rc;
- if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
- fprintf(stderr, "invalid port id %u\n", res->cmd_pid);
- return;
- }
-
if (!strcmp(res->cmd_keyword, "rxq")) {
+ if (rte_eth_dev_is_valid_rxq(res->cmd_pid, res->cmd_qid) != 0) {
+ fprintf(stderr,
+ "Invalid input: port id = %d, queue id = %d\n",
+ res->cmd_pid, res->cmd_qid);
+ return;
+ }
rc = rte_eth_rx_descriptor_status(res->cmd_pid, res->cmd_qid,
res->cmd_did);
if (rc < 0) {
@@ -17336,6 +17337,12 @@ cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
else
printf("Desc status = UNAVAILABLE\n");
} else if (!strcmp(res->cmd_keyword, "txq")) {
+ if (rte_eth_dev_is_valid_txq(res->cmd_pid, res->cmd_qid) != 0) {
+ fprintf(stderr,
+ "Invalid input: port id = %d, queue id = %d\n",
+ res->cmd_pid, res->cmd_qid);
+ return;
+ }
rc = rte_eth_tx_descriptor_status(res->cmd_pid, res->cmd_qid,
res->cmd_did);
if (rc < 0) {
@@ -17415,8 +17422,10 @@ cmd_show_rx_queue_desc_used_count_parsed(void *parsed_result,
struct cmd_show_rx_queue_desc_used_count_result *res = parsed_result;
int rc;
- if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
- fprintf(stderr, "invalid port id %u\n", res->cmd_pid);
+ if (rte_eth_dev_is_valid_rxq(res->cmd_pid, res->cmd_qid) != 0) {
+ fprintf(stderr,
+ "Invalid input: port id = %d, queue id = %d\n",
+ res->cmd_pid, res->cmd_qid);
return;
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。