From b6126451d9485a411b0d85b7f48d9a56814862f0 Mon Sep 17 00:00:00 2001 From: yangchenguang Date: Mon, 14 Aug 2023 10:12:12 +0800 Subject: [PATCH] Add loongarch64 support Signed-off-by: yangchenguang --- add-loongarch64-support.patch | 29 +++++++++++++++++++++++++++++ oncn-bwm.spec | 9 +++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 add-loongarch64-support.patch diff --git a/add-loongarch64-support.patch b/add-loongarch64-support.patch new file mode 100644 index 0000000..f85934a --- /dev/null +++ b/add-loongarch64-support.patch @@ -0,0 +1,29 @@ +From 4d1df98b2498b5270680b6be19634aa4ac2fa7d4 Mon Sep 17 00:00:00 2001 +From: herengui +Date: Sat, 13 May 2023 09:37:27 +0800 +Subject: [PATCH] add loongarch64 support + +Signed-off-by: herengui +--- + bpf/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/bpf/CMakeLists.txt b/bpf/CMakeLists.txt +index d081520..1249348 100644 +--- a/bpf/CMakeLists.txt ++++ b/bpf/CMakeLists.txt +@@ -5,6 +5,10 @@ message(STATUS "Enter bpf folder") + include_directories("/usr/include/bpf/") + set(CMAKE_C_COMPILER "clang") + +-set(CMAKE_C_FLAGS "-g -Wall -O2 -Werror --target=bpf -D__x86_64__ -fPIC -D_FORTIFY_SOURCE=2 -ftrapv") ++if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64") ++ set(CMAKE_C_FLAGS "-g -Wall -O2 -Werror --target=bpf -D__loongarch_lp64 -fPIC -D_FORTIFY_SOURCE=2 -ftrapv") ++else() ++ set(CMAKE_C_FLAGS "-g -Wall -O2 -Werror --target=bpf -D__x86_64__ -fPIC -D_FORTIFY_SOURCE=2 -ftrapv") ++endif() + add_library(bwm_tc OBJECT bwm_tc) + add_library(bwm_prio_kern OBJECT bwm_prio_kern) +-- +2.39.2 + diff --git a/oncn-bwm.spec b/oncn-bwm.spec index d03fa20..bcc6dc4 100644 --- a/oncn-bwm.spec +++ b/oncn-bwm.spec @@ -1,6 +1,6 @@ Name: oncn-bwm Version: 1.1 -Release: 3 +Release: 4 Summary: Pod bandwidth management in mixed deployment scenarios of online and offline services License: GPL-2.0 URL: https://gitee.com/src-openeuler/oncn-bwm @@ -13,6 +13,8 @@ Requires: iproute libbpf Requires(preun): bpftool Requires: libboundscheck +Patch1000: add-loongarch64-support.patch + Patch9001: 0001-adapt-libbpf-0.8.1.patch Patch9002: 0002-clean-code-and-use-securec-function.patch Patch9003: 0003-fix-offline-packets-block.patch @@ -32,7 +34,7 @@ devel tools for oncn-bwm %build mkdir build && cd build && -cmake .. +%cmake .. make %install @@ -94,6 +96,9 @@ fi %changelog +* Mon Aug 14 2023 yangchenguang - 1.1-4 +- Add loogarch64 support + * Mon May 22 2023 supercharge - 1.1-3 - fix offline packets block -- Gitee