1 Star 0 Fork 32

yc555/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0048-add-tx-package-timeout.patch 1011 Bytes
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2023-11-18 17:35 . sync modif mem
From 80eccdd1bb639a1ea8c186c8c2b7f451b0b38a7e Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Tue, 31 Oct 2023 11:44:29 +0000
Subject: [PATCH] add tx package timeout
---
src/lstack/netif/lstack_vdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lstack/netif/lstack_vdev.c b/src/lstack/netif/lstack_vdev.c
index 81b48dc..62abe80 100644
--- a/src/lstack/netif/lstack_vdev.c
+++ b/src/lstack/netif/lstack_vdev.c
@@ -142,10 +142,11 @@ static uint32_t vdev_tx_xmit(struct protocol_stack *stack, struct rte_mbuf **pkt
stack->stats.tx_prepare_fail++;
LSTACK_LOG(INFO, LSTACK, "rte_eth_tx_prepare failed\n");
}
+ const uint32_t tbegin = sys_now();
do {
sent_pkts += rte_eth_tx_burst(stack->port_id, stack->queue_id, &pkts[sent_pkts], nr_pkts - sent_pkts);
- } while (sent_pkts < nr_pkts);
+ } while (sent_pkts < nr_pkts && (ENQUEUE_RING_RETRY_TIMEOUT > sys_now() - tbegin));
return sent_pkts;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangchen555/gazelle_1.git
git@gitee.com:yangchen555/gazelle_1.git
yangchen555
gazelle_1
gazelle_1
master

搜索帮助