From 444ec3de0b4036c11c89cbe218f90afaade81e99 Mon Sep 17 00:00:00 2001 From: bitcoffee Date: Sat, 19 Aug 2023 23:24:02 +0800 Subject: [PATCH] fix miss btf in ko and ebpf program over limit Signed-off-by: bitcoffee --- ...x-miss-btf-in-ko-and-ebpf-over-limit.patch | 61 +++++++++++++++++++ Kmesh.spec | 11 +++- 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 0001-fix-miss-btf-in-ko-and-ebpf-over-limit.patch diff --git a/0001-fix-miss-btf-in-ko-and-ebpf-over-limit.patch b/0001-fix-miss-btf-in-ko-and-ebpf-over-limit.patch new file mode 100644 index 0000000..bbfa77a --- /dev/null +++ b/0001-fix-miss-btf-in-ko-and-ebpf-over-limit.patch @@ -0,0 +1,61 @@ +From edfaf1e0e1615e4713bea70cdde990d4972867c5 Mon Sep 17 00:00:00 2001 +From: bitcoffee +Date: Sat, 19 Aug 2023 21:24:25 +0800 +Subject: [PATCH] repair two errors in openEuler2309 + +1.ko miss btf info +2.ebpf program over 512 limit bytes + +Signed-off-by: bitcoffee +--- + bpf/kmesh/include/kmesh_common.h | 2 +- + build.sh | 1 + + kmesh.spec | 4 ++-- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/bpf/kmesh/include/kmesh_common.h b/bpf/kmesh/include/kmesh_common.h +index bc090f4..c91fc20 100644 +--- a/bpf/kmesh/include/kmesh_common.h ++++ b/bpf/kmesh/include/kmesh_common.h +@@ -49,7 +49,7 @@ extern struct bpf_mem_ptr *bpf_get_msg_header_element(const char *src) __ksym; + #define BPF_LOGTYPE_ROUTER_CONFIG BPF_DEBUG_OFF + #define BPF_LOGTYPE_COMMON BPF_DEBUG_OFF + +-#define BPF_DATA_MAX_LEN 226 /* this value should be ++#define BPF_DATA_MAX_LEN 220 /* this value should be + small that make compile success */ + #define BPF_INNER_MAP_DATA_LEN 100 + +diff --git a/build.sh b/build.sh +index a266e19..f9a20e2 100755 +--- a/build.sh ++++ b/build.sh +@@ -11,6 +11,7 @@ function prepare() { + + export PATH=$PATH:$ROOT_DIR/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/ + cp $ROOT_DIR/depends/include/5.10.0-60.18.0.50.oe2203/bpf_helper_defs_ext.h $ROOT_DIR/bpf/include/ ++ cp /sys/kernel/btf/vmlinux /usr/lib/modules/`uname -r`/build/ + } + + function install() { +diff --git a/kmesh.spec b/kmesh.spec +index 9001991..aedecd3 100644 +--- a/kmesh.spec ++++ b/kmesh.spec +@@ -8,11 +8,11 @@ License: ASL 2.0 + URL: https://gitee.com/openeuler + Source0: %{name}-%{version}.tar.gz + +-BuildRequires: make ++BuildRequires: make dwarves + BuildRequires: protobuf protobuf-c protobuf-c-devel + BuildRequires: golang >= 1.16 + BuildRequires: clang >= 10.0.1 llvm >= 10.0.1 +-BuildRequires: libbpf-devel kernel-devel >= 5.10 ++BuildRequires: libbpf-devel kernel-devel >= 6.4 + BuildRequires: libboundscheck + + Requires: bpftool +-- +2.33.0 + diff --git a/Kmesh.spec b/Kmesh.spec index 6456469..cceb478 100644 --- a/Kmesh.spec +++ b/Kmesh.spec @@ -1,16 +1,16 @@ Name: Kmesh Version: 0.3.0 -Release: 3 +Release: 4 Summary: %{name} is a eBPF-based service mesh kernel solution License: ASL 2.0 and GPL-2.0 URL: https://gitee.com/openeuler/%{name} Source0: https://gitee.com/openeuler/%{name}/archive/refs/tags/%{version}.tar.gz -BuildRequires: cmake make pkgconf dracut +BuildRequires: cmake make pkgconf dracut dwarves BuildRequires: protobuf protobuf-c protobuf-c-devel BuildRequires: golang >= 1.16 BuildRequires: clang >= 10.0.1 llvm >= 10.0.1 -BuildRequires: libbpf-devel kernel-devel >= 5.10 +BuildRequires: libbpf-devel kernel-devel >= 6.4 BuildRequires: libboundscheck BuildRequires: uname-build-checks @@ -18,6 +18,8 @@ Requires: bpftool Requires: libbpf Requires: libboundscheck +Patch0001: 0001-fix-miss-btf-in-ko-and-ebpf-over-limit.patch + %description %{name} is a eBPF-based service mesh kernel solution. @@ -111,6 +113,9 @@ rm -rf %{buildroot} %attr(0500,root,root) /usr/bin/kmesh-stop-post.sh %changelog +* Fri Aug 25 2023 bitcoffee - 0.3.0-4 +- fix miss btf in ko and ebpf over limit + * Fri Aug 18 2023 JofDiamonds - 0.3.0-3 - update spec -- Gitee