代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b902a2a2f392ab945bedf7d2d9eb22f6a0aa032c Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Wed, 15 Nov 2023 19:15:13 +0800
Subject: [PATCH] ethdev: mbuf data start pointer pbuf->payload
---
src/lstack/netif/lstack_ethdev.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
index da16e85..1d04684 100644
--- a/src/lstack/netif/lstack_ethdev.c
+++ b/src/lstack/netif/lstack_ethdev.c
@@ -809,10 +809,7 @@ static err_t eth_dev_output(struct netif *netif, struct pbuf *pbuf)
struct rte_mbuf *pre_mbuf = NULL;
struct rte_mbuf *first_mbuf = NULL;
struct pbuf *first_pbuf = pbuf;
- uint16_t header_len = 0;
- if (likely(first_pbuf != NULL)) {
- header_len = first_pbuf->l2_len + first_pbuf->l3_len + first_pbuf->l4_len;
- }
+ void *buf_addr;
while (likely(pbuf != NULL)) {
struct rte_mbuf *mbuf = pbuf_to_mbuf(pbuf);
@@ -821,26 +818,23 @@ static err_t eth_dev_output(struct netif *netif, struct pbuf *pbuf)
mbuf->pkt_len = pbuf->tot_len;
mbuf->ol_flags = pbuf->ol_flags;
mbuf->next = NULL;
+ buf_addr = rte_pktmbuf_mtod(mbuf, void *);
+
+ /*
+ * |rte_mbuf | mbuf_private | data_off | data |
+ * ^ ^
+ * buf_addr payload
+ * m->buf_addr pointer pbuf->payload
+ */
+ mbuf->data_off += (uint8_t *)pbuf->payload - (uint8_t *)buf_addr;
if (first_mbuf == NULL) {
first_mbuf = mbuf;
first_pbuf = pbuf;
first_mbuf->nb_segs = 1;
- if (pbuf->header_off > 0) {
- mbuf->data_off -= header_len;
- pbuf->header_off = 0;
- }
} else {
first_mbuf->nb_segs++;
pre_mbuf->next = mbuf;
- if (pbuf->header_off == 0) {
- mbuf->data_off += header_len;
- pbuf->header_off = header_len;
- }
- }
-
- if (first_pbuf->l4_len == 8) {
- mbuf->data_off += 12;
}
if (likely(first_mbuf->pkt_len > MBUF_MAX_LEN)) {
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。