1 Star 0 Fork 32

compile_success/gazelle_3

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0028-ethdev-fix-arp-unicast-packets-cannot-be-transmitted.patch 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2023-11-04 11:56 . sync bond6
From aa2e11540cf897d2b1051ab33245e8c988618aaa Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Thu, 26 Oct 2023 17:45:56 +0800
Subject: [PATCH] ethdev: fix arp unicast packets cannot be transmitted to
current procotol stack
---
src/lstack/core/lstack_protocol_stack.c | 8 ++++++++
src/lstack/netif/lstack_ethdev.c | 11 ++---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index 0726054..511d2b9 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -837,6 +837,14 @@ void stack_broadcast_arp(struct rte_mbuf *mbuf, struct protocol_stack *cur_stack
return;
}
}
+ ret = dpdk_alloc_pktmbuf(stack->rxtx_pktmbuf_pool, &mbuf_copy, 1);
+ if (ret != 0) {
+ stack->stats.rx_allocmbuf_fail++;
+ return;
+ }
+ copy_mbuf(mbuf_copy, mbuf);
+ kni_handle_tx(mbuf_copy);
+ return;
}
void stack_broadcast_clean_epoll(struct wakeup_poll *wakeup)
diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
index 30c3c9a..f2353f8 100644
--- a/src/lstack/netif/lstack_ethdev.c
+++ b/src/lstack/netif/lstack_ethdev.c
@@ -780,15 +780,8 @@ int32_t gazelle_eth_dev_poll(struct protocol_stack *stack, uint8_t use_ltran_fla
struct rte_ether_hdr *ethh = rte_pktmbuf_mtod(stack->pkts[i], struct rte_ether_hdr *);
if (unlikely(RTE_BE16(RTE_ETHER_TYPE_ARP) == ethh->ether_type)) {
stack_broadcast_arp(stack->pkts[i], stack);
-#if DPDK_VERSION_1911
- if (!rte_is_broadcast_ether_addr(&ethh->d_addr)) {
-#else /* DPDK_VERSION_1911 */
- if (!rte_is_broadcast_ether_addr(&ethh->dst_addr)) {
-#endif /* DPDK_VERSION_1911 */
- // copy arp into other process
- transfer_arp_to_other_process(stack->pkts[i]);
- transfer_type = TRANSFER_KERNEL;
- }
+ /* copy arp into other process */
+ transfer_arp_to_other_process(stack->pkts[i]);
} else {
if (get_global_cfg_params()->tuple_filter && stack->queue_id == 0) {
transfer_type = distribute_pakages(stack->pkts[i]);
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/compile_success/gazelle_3.git
git@gitee.com:compile_success/gazelle_3.git
compile_success
gazelle_3
gazelle_3
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385