1 Star 0 Fork 32

吴昌盛/gazelle-tar

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0164-rpc-dont-send.patch 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2022-12-18 19:57 . pkts-bulk-send-to-nic and rpc-dont-send
From 4b7dd71bd8ab1023b73b2c157719d6a939d75b49 Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Sun, 18 Dec 2022 19:36:52 +0800
Subject: [PATCH 2/2] rpc-dont-send
---
src/common/dpdk_common.h | 4 +++-
src/lstack/core/lstack_lwip.c | 12 +-----------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/common/dpdk_common.h b/src/common/dpdk_common.h
index a0c304c..63d651d 100644
--- a/src/common/dpdk_common.h
+++ b/src/common/dpdk_common.h
@@ -25,7 +25,9 @@
#define PTR_TO_PRIVATE(mbuf) RTE_PTR_ADD(mbuf, sizeof(struct rte_mbuf))
/* Layout:
- * | rte_mbuf | pbuf | custom_free_function | tcp_seg | payload |
+ * | rte_mbuf | gazelle_prive | pbuf | custom_free_function | tcp_seg | payload |
+ * rte_prefetch0 in lwip project,tcp_out.c,tcp_output_segment use constants
+ sizeof(struct rte_mbuf) + GAZELLE_MBUFF_PRIV_SIZE = 128 + 16
**/
struct pbuf;
static inline struct rte_mbuf *pbuf_to_mbuf(struct pbuf *p)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index c04ed27..ae6c98d 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -573,7 +573,6 @@ static inline bool do_lwip_send(struct protocol_stack *stack, int32_t fd, struct
void stack_send(struct rpc_msg *msg)
{
int32_t fd = msg->args[MSG_ARG_0].i;
- int32_t flags = msg->args[MSG_ARG_2].i;
struct protocol_stack *stack = (struct protocol_stack *)msg->args[MSG_ARG_3].p;
struct lwip_sock *sock = get_socket(fd);
@@ -583,22 +582,13 @@ void stack_send(struct rpc_msg *msg)
}
__atomic_store_n(&sock->in_send, 0, __ATOMIC_RELEASE);
- rte_mb();
-
- if (!NETCONN_IS_DATAOUT(sock) || sock->errevent > 0) {
- return;
- }
-
- bool replenish_again = do_lwip_send(stack, fd, sock, flags);
/* have remain data or replenish again add sendlist */
- if (NETCONN_IS_DATAOUT(sock) || replenish_again) {
+ if (sock->errevent == 0 && NETCONN_IS_DATAOUT(sock)) {
if (list_is_null(&sock->send_list)) {
list_add_node(&stack->send_list, &sock->send_list);
__atomic_store_n(&sock->in_send, 1, __ATOMIC_RELEASE);
}
-
- stack->stats.send_self_rpc++;
}
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-changsheng/gazelle-tar.git
git@gitee.com:wu-changsheng/gazelle-tar.git
wu-changsheng
gazelle-tar
gazelle-tar
master

搜索帮助