代码拉取完成,页面将自动刷新
From 3d63cb611a0b7a3cde0bb9e74b0ec83501966c51 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Sun, 18 Dec 2022 18:50:33 +0800
Subject: [PATCH 2/2] add prefetch
---
src/core/pbuf.c | 7 +++++++
src/core/tcp_out.c | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index 404c8a7..ad75aa6 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -83,6 +83,9 @@
#if LWIP_CHECKSUM_ON_COPY
#include "lwip/inet_chksum.h"
#endif
+#if USE_LIBOS
+#include <rte_prefetch.h>
+#endif
#include <string.h>
@@ -750,6 +753,10 @@ pbuf_free(struct pbuf *p)
/* de-allocate all consecutive pbufs from the head of the chain that
* obtain a zero reference count after decrementing*/
while (p != NULL) {
+#if USE_LIBOS
+ if (p->next)
+ rte_prefetch0(p->next);
+#endif
LWIP_PBUF_REF_T ref;
SYS_ARCH_DECL_PROTECT(old_level);
/* Since decrementing ref cannot be guaranteed to be a single machine operation
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
index 55053d8..3c4dc4b 100644
--- a/src/core/tcp_out.c
+++ b/src/core/tcp_out.c
@@ -82,6 +82,7 @@
#if USE_LIBOS
#include "lwipsock.h"
+#include <rte_prefetch.h>
#if CHECKSUM_GEN_TCP_HW
#include "dpdk_cksum.h"
#endif
@@ -1762,6 +1763,11 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif
}
#endif
+#if USE_LIBOS
+ /* pbuf into mbuf. ref dpdk_common.h */
+ rte_prefetch0((uint8_t *)(seg->p) - sizeof(struct rte_mbuf) - sizeof(uint64_t) * 2);
+#endif
+
/* Set retransmission timer running if it is not currently enabled
This must be set before checking the route. */
if (pcb->rtime < 0) {
--
2.8.4.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。