代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 05bfdb54fc744d835c8b3b50b54d220fe7e87277 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Mon, 7 Mar 2022 21:10:06 +0800
Subject: [PATCH] reduce copy in send
---
src/core/pbuf.c | 5 +++++
src/include/lwip/pbuf.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index 27afc28..cd6b558 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -281,6 +281,10 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
}
/* If pbuf is to be allocated in RAM, allocate memory for it. */
+#if USE_LIBOS
+ /* alloc mbuf to reduce copy in sending */
+ p = lwip_alloc_pbuf(layer, length, type);
+#else
p = (struct pbuf *)mem_malloc(alloc_len);
if (p == NULL) {
return NULL;
@@ -289,6 +293,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
length, length, type, 0);
LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned",
((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
+#endif
break;
}
default:
diff --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h
index e5daf96..3894574 100644
--- a/src/include/lwip/pbuf.h
+++ b/src/include/lwip/pbuf.h
@@ -272,6 +272,9 @@ void pbuf_free_ooseq(void);
/* Initializes the pbuf module. This call is empty for now, but may not be in future. */
#define pbuf_init()
+#if USE_LIBOS
+struct pbuf *lwip_alloc_pbuf(pbuf_layer l, u16_t length, pbuf_type type);
+#endif
struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type);
struct pbuf *pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type);
#if LWIP_SUPPORT_CUSTOM_PBUF
--
2.30.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。