20 Star 0 Fork 32

openEuler-RISC-V/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0011-fix-evetns-err.patch 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-16 22:23 . fix gazelle test issue
From 7f3dbd7145d683c22e70d69ec8799a49cb837415 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Wed, 9 Mar 2022 17:44:50 +0800
Subject: [PATCH 11/34] fix evetns err
---
src/lstack/core/lstack_lwip.c | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 87d99d3..3b97bb8 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -317,14 +317,16 @@ ssize_t write_stack_data(struct lwip_sock *sock, const void *buf, size_t len)
send_pkt++;
}
- if (NETCONN_IS_DATAOUT(sock)) {
- sock->have_event = true;
- sock->events |= EPOLLOUT;
- rte_ring_mp_enqueue(sock->weakup->event_ring, (void *)sock);
- sem_post(&sock->weakup->event_sem);
- sock->stack->stats.write_events++;
- } else {
- sock->have_event = false;
+ if ((sock->epoll_events & EPOLLOUT)) {
+ if (NETCONN_IS_DATAOUT(sock)) {
+ sock->have_event = true;
+ sock->events |= EPOLLOUT;
+ rte_ring_mp_enqueue(sock->weakup->event_ring, (void *)sock);
+ sem_post(&sock->weakup->event_sem);
+ sock->stack->stats.write_events++;
+ } else {
+ sock->have_event = false;
+ }
}
if (rte_ring_free_count(sock->stack->send_idle_ring) > USED_IDLE_WATERMARK && !sock->stack->in_replenish) {
@@ -518,14 +520,16 @@ ssize_t read_stack_data(int32_t fd, void *buf, size_t len, int32_t flags)
}
}
- if (NETCONN_IS_DATAIN(sock)) {
- sock->have_event = true;
- sock->events |= EPOLLIN;
- rte_ring_mp_enqueue(sock->weakup->event_ring, (void *)sock);
- sem_post(&sock->weakup->event_sem);
- sock->stack->stats.read_events++;
- } else {
- sock->have_event = false;
+ if ((sock->epoll_events & EPOLLIN)) {
+ if (NETCONN_IS_DATAIN(sock)) {
+ sock->have_event = true;
+ sock->events |= EPOLLIN;
+ rte_ring_mp_enqueue(sock->weakup->event_ring, (void *)sock);
+ sem_post(&sock->weakup->event_sem);
+ sock->stack->stats.read_events++;
+ } else {
+ sock->have_event = false;
+ }
}
if (recvd == 0) {
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-risc-v/gazelle.git
git@gitee.com:openeuler-risc-v/gazelle.git
openeuler-risc-v
gazelle
gazelle
master

搜索帮助