1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0261-net-vhost-support-private-dump.patch 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
From 423959cfe25c9dc231b80f3df59318585df3a023 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 19 Jan 2023 12:30:56 +0000
Subject: net/vhost: support private dump
[ upstream commit 47b9fb64c15d60e1c8c2c8f6e63824fd2cada428 ]
This patch implements eth_dev_priv_dump callback which could use for
debugging.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/vhost/rte_eth_vhost.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 070f0e6dfd..b120341d0c 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1429,6 +1429,23 @@ vhost_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
return 0;
}
+static int
+vhost_dev_priv_dump(struct rte_eth_dev *dev, FILE *f)
+{
+ struct pmd_internal *internal = dev->data->dev_private;
+
+ fprintf(f, "iface_name: %s\n", internal->iface_name);
+ fprintf(f, "flags: 0x%" PRIx64 "\n", internal->flags);
+ fprintf(f, "disable_flags: 0x%" PRIx64 "\n", internal->disable_flags);
+ fprintf(f, "max_queues: %u\n", internal->max_queues);
+ fprintf(f, "vid: %d\n", internal->vid);
+ fprintf(f, "started: %d\n", rte_atomic32_read(&internal->started));
+ fprintf(f, "dev_attached: %d\n", rte_atomic32_read(&internal->dev_attached));
+ fprintf(f, "vlan_strip: %d\n", internal->vlan_strip);
+
+ return 0;
+}
+
static const struct eth_dev_ops ops = {
.dev_start = eth_dev_start,
.dev_stop = eth_dev_stop,
@@ -1449,6 +1466,7 @@ static const struct eth_dev_ops ops = {
.rx_queue_intr_enable = eth_rxq_intr_enable,
.rx_queue_intr_disable = eth_rxq_intr_disable,
.get_monitor_addr = vhost_get_monitor_addr,
+ .eth_dev_priv_dump = vhost_dev_priv_dump,
};
static int
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助