sync add riscv64 support
(cherry picked from commit 22a02ba0fb00d50e5caf26896d7feb94ebcfb3b3)
This commit is contained in:
parent
c47c87ac24
commit
4ca1056721
82
0177-fix-mbuf-leak-in-dpdk-23.11-due-to-kni-removed.patch
Normal file
82
0177-fix-mbuf-leak-in-dpdk-23.11-due-to-kni-removed.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 27af442164cce5ccb7df65435f76262ebb2d810e Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Thu, 9 May 2024 15:27:48 +0800
|
||||
Subject: [PATCH] fix mbuf leak in dpdk-23.11 due to kni removed
|
||||
|
||||
---
|
||||
src/lstack/core/lstack_dpdk.c | 3 +++
|
||||
src/lstack/core/lstack_protocol_stack.c | 3 ++-
|
||||
src/lstack/netif/lstack_ethdev.c | 2 ++
|
||||
src/ltran/ltran_forward.c | 5 ++++-
|
||||
4 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
|
||||
index 016276a..ec35f9c 100644
|
||||
--- a/src/lstack/core/lstack_dpdk.c
|
||||
+++ b/src/lstack/core/lstack_dpdk.c
|
||||
@@ -321,6 +321,9 @@ int32_t fill_mbuf_to_ring(struct rte_mempool *mempool, struct rte_ring *ring, ui
|
||||
ret = gazelle_ring_sp_enqueue(ring, (void **)free_buf, batch);
|
||||
if (ret == 0) {
|
||||
LSTACK_LOG(ERR, LSTACK, "cannot enqueue to ring, count: %u\n", batch);
|
||||
+ for (int i = 0; i < batch; i++) {
|
||||
+ rte_pktmbuf_free(free_buf[i]);
|
||||
+ }
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
|
||||
index 04d54c5..892c16d 100644
|
||||
--- a/src/lstack/core/lstack_protocol_stack.c
|
||||
+++ b/src/lstack/core/lstack_protocol_stack.c
|
||||
@@ -937,16 +937,17 @@ void stack_broadcast_arp(struct rte_mbuf *mbuf, struct protocol_stack *cur_stack
|
||||
|
||||
ret = rpc_call_arp(&stack->rpc_queue, mbuf_copy);
|
||||
if (ret != 0) {
|
||||
+ rte_pktmbuf_free(mbuf_copy);
|
||||
return;
|
||||
}
|
||||
}
|
||||
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
|
||||
ret = dpdk_alloc_pktmbuf(cur_stack->rxtx_mbuf_pool, &mbuf_copy, 1, true);
|
||||
if (ret != 0) {
|
||||
cur_stack->stats.rx_allocmbuf_fail++;
|
||||
return;
|
||||
}
|
||||
copy_mbuf(mbuf_copy, mbuf);
|
||||
-#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
|
||||
kni_handle_tx(mbuf_copy);
|
||||
#endif
|
||||
return;
|
||||
diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
|
||||
index 23edc19..048ea92 100644
|
||||
--- a/src/lstack/netif/lstack_ethdev.c
|
||||
+++ b/src/lstack/netif/lstack_ethdev.c
|
||||
@@ -173,6 +173,8 @@ int32_t eth_dev_poll(void)
|
||||
} else if (transfer_type == TRANSFER_KERNEL) {
|
||||
#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
|
||||
kni_handle_tx(stack->pkts[i]);
|
||||
+#else
|
||||
+ rte_pktmbuf_free(stack->pkts[i]);
|
||||
#endif
|
||||
} else {
|
||||
/* transfer to other thread */
|
||||
diff --git a/src/ltran/ltran_forward.c b/src/ltran/ltran_forward.c
|
||||
index a5756d7..d27f073 100644
|
||||
--- a/src/ltran/ltran_forward.c
|
||||
+++ b/src/ltran/ltran_forward.c
|
||||
@@ -424,8 +424,11 @@ forward_to_kni:
|
||||
#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
|
||||
if (get_ltran_config()->dpdk.kni_switch == GAZELLE_ON) {
|
||||
enqueue_rx_packet(get_kni_stack(), m);
|
||||
- }
|
||||
+ } else
|
||||
#endif
|
||||
+ {
|
||||
+ rte_pktmbuf_free(m);
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
48
0178-add-riscv64-support.patch
Normal file
48
0178-add-riscv64-support.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From c17a61a4e7872af8eabdf213f71ff8aad84687ad Mon Sep 17 00:00:00 2001
|
||||
From: laokz <zhangkai@iscas.ac.cn>
|
||||
Date: Thu, 9 May 2024 18:44:28 +0800
|
||||
Subject: [PATCH] add riscv64 support
|
||||
|
||||
---
|
||||
src/lstack/Makefile | 2 +-
|
||||
src/ltran/CMakeLists.txt | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/Makefile b/src/lstack/Makefile
|
||||
index d2c039d..ace33bd 100644
|
||||
--- a/src/lstack/Makefile
|
||||
+++ b/src/lstack/Makefile
|
||||
@@ -109,7 +109,7 @@ else
|
||||
$(LIB_PATH)/librte_net_virtio.so \
|
||||
$(LIB_PATH)/librte_telemetry.so \
|
||||
$(LIB_PATH)/librte_pcapng.so
|
||||
- ifneq ($(ARCH), loongarch64)
|
||||
+ ifeq ($(filter loongarch64 riscv64, $(ARCH)),)
|
||||
LIBRTE_LIB += $(LIB_PATH)/librte_net_i40e.so
|
||||
endif
|
||||
endif
|
||||
diff --git a/src/ltran/CMakeLists.txt b/src/ltran/CMakeLists.txt
|
||||
index 2eb7d70..fee3a94 100644
|
||||
--- a/src/ltran/CMakeLists.txt
|
||||
+++ b/src/ltran/CMakeLists.txt
|
||||
@@ -54,7 +54,7 @@ if (DPDK_VERSION STREQUAL "19.11")
|
||||
else()
|
||||
set(DPDK_LINK_FLAGS "-Wl,-lrte_net_bond -Wl,-lrte_net_hinic -Wl,-lrte_net_ixgbe \
|
||||
-Wl,-lpcap -Wl,-lrte_net_pcap -Wl,-lrte_net_virtio -Wl,-lrte_pcapng -Wl,-lrte_telemetry")
|
||||
- if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64")
|
||||
+ if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64|riscv64")
|
||||
set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lrte_net_i40e")
|
||||
endif()
|
||||
endif()
|
||||
@@ -82,7 +82,7 @@ target_compile_options(ltran PRIVATE -fno-strict-aliasing -D__ARM_FEATURE_CRC32=
|
||||
-Wdeprecated -Wwrite-strings -Wno-implicit-fallthrough -D_FORTIFY_SOURCE=2 -Wno-error=deprecated-declarations)
|
||||
|
||||
# gcc coredump in openEuler-20.03-LTS-XX aarch64 when add -march=native
|
||||
-if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "sw_64|aarch64|ppc64le" )
|
||||
+if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "sw_64|aarch64|ppc64le|riscv64" )
|
||||
target_compile_options(ltran PRIVATE -march=native -Wcast-align)
|
||||
endif()
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: gazelle
|
||||
Version: 1.0.2
|
||||
Release: 35
|
||||
Release: 36
|
||||
Summary: gazelle is a high performance user-mode stack
|
||||
License: MulanPSL-2.0
|
||||
URL: https://gitee.com/openeuler/gazelle
|
||||
@ -193,6 +193,8 @@ Patch9173: 0173-gazellectl-add-lwip-stats_proto-print.patch
|
||||
Patch9174: 0174-CFG-set-multicast-IP-assert.patch
|
||||
Patch9175: 0175-cfg-devices-must-be-in-bond_slave_mac-for-BONDING_MO.patch
|
||||
Patch9176: 0176-CFG-fix-multicast-IP-assert-error.patch
|
||||
Patch9177: 0177-fix-mbuf-leak-in-dpdk-23.11-due-to-kni-removed.patch
|
||||
Patch9178: 0178-add-riscv64-support.patch
|
||||
|
||||
%description
|
||||
%{name} is a high performance user-mode stack.
|
||||
@ -234,6 +236,10 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
|
||||
%config(noreplace) %{conf_path}/ltran.conf
|
||||
|
||||
%changelog
|
||||
* Fri May 10 CST yangchen555 <yangchen145@huawei.com> - 1.0.2-36
|
||||
- add riscv64 support
|
||||
- fix mbuf leak in dpdk-23.11 due to kni removed
|
||||
|
||||
* Thu May 9 2024 yinbin6 <yinbin8@huawei.com> - 1.0.2-35
|
||||
- CFG:fix multicast IP assert error
|
||||
- cfg: devices must be in bond_slave_mac for BONDING_MODE_ACTIVE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user