1 Star 0 Fork 32

shafeipaozi/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0158-add-udp-poll.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
From 776ff89196c1fb5bc0193ea746119e40f80fed46 Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Fri, 22 Mar 2024 08:31:28 +0000
Subject: [PATCH] add udp poll
---
src/lstack/core/lstack_lwip.c | 8 ++++++++
src/lstack/core/lstack_protocol_stack.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index a604a62..c5161b4 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -1307,6 +1307,14 @@ void netif_poll(struct netif *netif)
/* processes on same node handshake packet use this function */
err_t netif_loop_output(struct netif *netif, struct pbuf *p)
{
+ if (p != NULL) {
+ const struct ip_hdr *iphdr;
+ iphdr = (const struct ip_hdr *)p->payload;
+ if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
+ return udp_netif_loop_output(netif, p);
+ }
+ }
+
struct tcp_pcb *pcb = p->pcb;
struct pbuf *head = NULL;
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index 7c4af64..138ac2b 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -491,6 +491,10 @@ int stack_polling(uint32_t wakeup_tick)
}
}
+ if (cfg->udp_enable) {
+ udp_netif_poll(&stack->netif);
+ }
+
#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
/* run to completion mode currently does not support kni */
/* KNI requests are generally low-rate I/Os,
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/gazelle.git
git@gitee.com:shafeipaozi/gazelle.git
shafeipaozi
gazelle
gazelle
master

搜索帮助