代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 24754f47cefc0284aeea0d122698789c51ff050d Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Thu, 22 Dec 2022 23:19:09 +0800
Subject: [PATCH 3/4] fix-send-pkts-bluk-err
---
src/lstack/include/lstack_protocol_stack.h | 2 ++
src/lstack/netif/lstack_ethdev.c | 16 ++++++----------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/lstack/include/lstack_protocol_stack.h b/src/lstack/include/lstack_protocol_stack.h
index c706afc..de3d312 100644
--- a/src/lstack/include/lstack_protocol_stack.h
+++ b/src/lstack/include/lstack_protocol_stack.h
@@ -29,8 +29,10 @@
#define SOCK_SEND_RING_SIZE (32)
#define SOCK_SEND_REPLENISH_THRES (16)
#define WAKEUP_MAX_NUM (32)
+
#define STACK_SEND_MAX 2048
#define STACK_SEND_MASK (STACK_SEND_MAX - 1)
+#define STACK_SEND_INDEX(index) ((index) & STACK_SEND_MASK)
struct rte_mempool;
struct rte_ring;
diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
index 5729ebf..4426b1a 100644
--- a/src/lstack/netif/lstack_ethdev.c
+++ b/src/lstack/netif/lstack_ethdev.c
@@ -149,20 +149,16 @@ int32_t gazelle_eth_dev_poll(struct protocol_stack *stack, bool use_ltran_flag,
static void add_send_pkt(struct protocol_stack *stack, struct rte_mbuf *mbuf)
{
- if (stack->send_end + 1 != stack->send_start) {
- stack->send_pkts[stack->send_end & STACK_SEND_MASK] = mbuf;
- stack->send_end++;
- return;
- }
-
- stack->stats.send_pkts_fail++;
do {
- stack_send_pkts(stack);
- if (stack->send_end + 1 != stack->send_start) {
- stack->send_pkts[stack->send_end & STACK_SEND_MASK] = mbuf;
+ if (STACK_SEND_INDEX(stack->send_end + 1) != STACK_SEND_INDEX(stack->send_start)) {
+ stack->send_pkts[STACK_SEND_INDEX(stack->send_end)] = mbuf;
stack->send_end++;
return;
}
+
+ stack_send_pkts(stack);
+
+ stack->stats.send_pkts_fail++;
} while (1);
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。