1 Star 0 Fork 32

yc555/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0208-virtio-mode-actual_queue_num.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
From 0613a7275ed2ed0aefc2f8419adeaadd8fd87de9 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Sat, 29 Jun 2024 17:35:37 +0800
Subject: [PATCH] virtio: mode actual_queue_num
---
src/lstack/core/lstack_virtio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_virtio.c b/src/lstack/core/lstack_virtio.c
index ad3088d..bc42bb9 100644
--- a/src/lstack/core/lstack_virtio.c
+++ b/src/lstack/core/lstack_virtio.c
@@ -298,9 +298,11 @@ int virtio_port_create(int lstack_net_port)
return retval;
}
+ uint16_t actual_queue_num = (g_virtio_instance.rx_queue_num < g_virtio_instance.tx_queue_num) ?
+ g_virtio_instance.rx_queue_num : g_virtio_instance.tx_queue_num;
retval = snprintf(portargs, sizeof(portargs),
"path=/dev/vhost-net,queues=%u,queue_size=%u,iface=%s,mac=" RTE_ETHER_ADDR_PRT_FMT,
- VIRTIO_MAX_QUEUE_NUM, VIRTIO_TX_RX_RING_SIZE, VIRTIO_USER_NAME, RTE_ETHER_ADDR_BYTES(&addr));
+ actual_queue_num, VIRTIO_TX_RX_RING_SIZE, VIRTIO_USER_NAME, RTE_ETHER_ADDR_BYTES(&addr));
if (retval < 0) {
LSTACK_LOG(ERR, LSTACK, "virtio portargs snprintf failed ret=%d \n", retval);
return retval;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangchen555/gazelle_1.git
git@gitee.com:yangchen555/gazelle_1.git
yangchen555
gazelle_1
gazelle_1
master

搜索帮助