代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a36114ed036f8c4976dfe3d47f0ee29c9f214fc5 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 21 Oct 2022 15:36:57 +0800
Subject: [PATCH 181/189] dmadev: support telemetry dump dmadev
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch supports telemetry dump dmadev.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
lib/dmadev/rte_dmadev.c | 43 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index 174d4c40ae..ea1cb815b4 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -985,6 +985,45 @@ dmadev_handle_dev_stats(const char *cmd __rte_unused,
return 0;
}
+#ifndef RTE_EXEC_ENV_WINDOWS
+static int
+dmadev_handle_dev_dump(const char *cmd __rte_unused,
+ const char *params,
+ struct rte_tel_data *d)
+{
+ char *buf, *end_param;
+ int dev_id, ret;
+ FILE *f;
+
+ if (params == NULL || strlen(params) == 0 || !isdigit(*params))
+ return -EINVAL;
+
+ dev_id = strtoul(params, &end_param, 0);
+ if (*end_param != '\0')
+ RTE_DMA_LOG(WARNING, "Extra parameters passed to dmadev telemetry command, ignoring");
+
+ buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
+ if (buf == NULL)
+ return -ENOMEM;
+
+ f = fmemopen(buf, RTE_TEL_MAX_SINGLE_STRING_LEN - 1, "w+");
+ if (f == NULL) {
+ free(buf);
+ return -EINVAL;
+ }
+
+ ret = rte_dma_dump(dev_id, f);
+ fclose(f);
+ if (ret == 0) {
+ rte_tel_data_start_dict(d);
+ rte_tel_data_string(d, buf);
+ }
+
+ free(buf);
+ return ret;
+}
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
RTE_INIT(dmadev_init_telemetry)
{
rte_telemetry_register_cmd("/dmadev/list", dmadev_handle_dev_list,
@@ -993,4 +1032,8 @@ RTE_INIT(dmadev_init_telemetry)
"Returns information for a dmadev. Parameters: int dev_id");
rte_telemetry_register_cmd("/dmadev/stats", dmadev_handle_dev_stats,
"Returns the stats for a dmadev vchannel. Parameters: int dev_id, vchan_id (Optional if only one vchannel)");
+#ifndef RTE_EXEC_ENV_WINDOWS
+ rte_telemetry_register_cmd("/dmadev/dump", dmadev_handle_dev_dump,
+ "Returns dump information for a dmadev. Parameters: int dev_id");
+#endif
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。