1 Star 0 Fork 72

叶青龙/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0260-net-virtio-support-private-dump.patch 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
From a247b89fe26e5bae41159dfa59475c04ae53e8e2 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 19 Jan 2023 12:30:55 +0000
Subject: net/virtio: support private dump
[ upstream commit 426858d6a9975a26539f0398037558dcb418947a ]
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/virtio/virtio_ethdev.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index b317649d7e..a38b15d01c 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1018,6 +1018,24 @@ virtio_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
}
+static int
+virtio_dev_priv_dump(struct rte_eth_dev *dev, FILE *f)
+{
+ struct virtio_hw *hw = dev->data->dev_private;
+
+ fprintf(f, "guest_features: 0x%" PRIx64 "\n", hw->guest_features);
+ fprintf(f, "vtnet_hdr_size: %u\n", hw->vtnet_hdr_size);
+ fprintf(f, "use_vec: rx-%u tx-%u\n", hw->use_vec_rx, hw->use_vec_tx);
+ fprintf(f, "use_inorder: rx-%u tx-%u\n", hw->use_inorder_rx, hw->use_inorder_tx);
+ fprintf(f, "intr_lsc: %u\n", hw->intr_lsc);
+ fprintf(f, "max_mtu: %u\n", hw->max_mtu);
+ fprintf(f, "max_rx_pkt_len: %zu\n", hw->max_rx_pkt_len);
+ fprintf(f, "max_queue_pairs: %u\n", hw->max_queue_pairs);
+ fprintf(f, "req_guest_features: 0x%" PRIx64 "\n", hw->req_guest_features);
+
+ return 0;
+}
+
/*
* dev_ops for virtio, bare necessities for basic operation
*/
@@ -1054,6 +1072,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.mac_addr_remove = virtio_mac_addr_remove,
.mac_addr_set = virtio_mac_addr_set,
.get_monitor_addr = virtio_get_monitor_addr,
+ .eth_dev_priv_dump = virtio_dev_priv_dump,
};
/*
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeqinglong01/dpdk.git
git@gitee.com:yeqinglong01/dpdk.git
yeqinglong01
dpdk
dpdk
master

搜索帮助