From 407abd2522072828167121a969f31504bd9c4b1d Mon Sep 17 00:00:00 2001 From: lec-bit Date: Mon, 21 Oct 2024 21:50:29 +0800 Subject: [PATCH 01/19] update Signed-off-by: lec-bit --- Makefile | 2 +- bpf/include/bpf_helper_defs_ext.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c99e50b9f..68d1c62ee 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ TMP_FILES := bpf/kmesh/bpf2go/bpf2go.go \ bpf/kmesh/ads/include/config.h \ bpf/include/bpf_helper_defs_ext.h \ -.PHONY: all data daemon +.PHONY: all data controller all: data controller data: diff --git a/bpf/include/bpf_helper_defs_ext.h b/bpf/include/bpf_helper_defs_ext.h index 77547010b..7bd9549b8 100644 --- a/bpf/include/bpf_helper_defs_ext.h +++ b/bpf/include/bpf_helper_defs_ext.h @@ -10,9 +10,9 @@ * By default, these IDs are in the 5.10 kernel with kmesh kernel patches. */ -static void *(*bpf_strncpy)(char *dst, __u32 dst_size, char *src) = (void *)210; -static void *(*bpf_strnstr)(void *s1, void *s2, __u32 size) = (void *)211; -static __u64 (*bpf_strnlen)(char *buff, __u32 size) = (void *)212; +static void *(*bpf_strncpy)(char *dst, __u32 dst_size, char *src) = (void *)171; +static void *(*bpf_strnstr)(void *s1, void *s2, __u32 size) = (void *)172; +static __u64 (*bpf_strnlen)(char *buff, __u32 size) = (void *)173; static __u64 (*bpf__strncmp)(const char *s1, __u32 s1_size, const char *s2) = (void *)174; -static long (*bpf_parse_header_msg)(struct bpf_mem_ptr *msg) = (void *)213; -static void *(*bpf_get_msg_header_element)(void *name) = (void *)214; +static long (*bpf_parse_header_msg)(struct bpf_mem_ptr *msg) = (void *)175; +static void *(*bpf_get_msg_header_element)(void *name) = (void *)176; From 23fe7a88ba7dd1ea351d2692e09b54e169691d3e Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 23 Oct 2024 06:59:59 +0800 Subject: [PATCH 02/19] update Signed-off-by: lec-bit --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 68d1c62ee..0a0e5fd49 100644 --- a/Makefile +++ b/Makefile @@ -72,21 +72,22 @@ TMP_FILES := bpf/kmesh/bpf2go/bpf2go.go \ bpf/kmesh/ads/include/config.h \ bpf/include/bpf_helper_defs_ext.h \ -.PHONY: all data controller -all: data controller +.PHONY: all kmesh-bpf kmesh-ko all-binary +all: kmesh-bpf kmesh-ko all-binary -data: +kmesh-bpf: $(QUIET) find $(ROOT_DIR)/mk -name "*.pc" | xargs sed -i "s#^prefix=.*#prefix=${ROOT_DIR}#g" $(QUIET) make -C api/v2-c $(QUIET) make -C bpf/deserialization_to_bpf_map $(QUIET) $(GO) generate bpf/kmesh/bpf2go/bpf2go.go - +kmesh-ko: + $(QUIET) find $(ROOT_DIR)/mk -name "*.pc" | xargs sed -i "s#^prefix=.*#prefix=${ROOT_DIR}#g" $(call printlog, BUILD, "kernel") $(QUIET) make -C kernel/ko_src -controller: +all-binary: $(QUIET) find $(ROOT_DIR)/mk -name "*.pc" | xargs sed -i "s#^prefix=.*#prefix=${ROOT_DIR}#g" $(call printlog, BUILD, $(APPS1)) $(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \ From 494793cbf9ecc8358b9176108214c1f582eafce5 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 30 Oct 2024 08:30:23 +0800 Subject: [PATCH 03/19] update Signed-off-by: lec-bit --- Makefile | 5 +++++ common/config/.golangci.yaml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 0a0e5fd49..60010385a 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,10 @@ kmeshctl: gen-proto: $(QUIET) make -C api gen-proto +.PHONY: gen-bpf2go +gen-bpf2go: + $(QUIET) $(GO) generate bpf/kmesh/bpf2go/bpf2go.go + .PHONY: tidy tidy: go mod tidy @@ -122,6 +126,7 @@ tidy: .PHONY: gen gen: tidy\ gen-proto \ + gen-bpf2go \ format .PHONY: gen-check diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 28ba74414..4f299ea3a 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -80,6 +80,8 @@ issues: exclude-files: - ".*\\.pb\\.go" - ".*\\.gen\\.go" + - ".*_bpfeb\\.go" + - ".*_bpfel\\.go" exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ From 3d9c743a7970cdbe0e16a9d53aba953a8f9f3a94 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 30 Oct 2024 10:05:30 +0800 Subject: [PATCH 04/19] support make gen bpf2go Signed-off-by: lec-bit --- Makefile | 3 +- bpf/kmesh/ads/include/kmesh_common.h | 5 --- build.sh | 51 +----------------------- kmesh_compile_env_pre.sh | 58 ++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 59 deletions(-) diff --git a/Makefile b/Makefile index 60010385a..51b3aa9e0 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,8 @@ gen-proto: .PHONY: gen-bpf2go gen-bpf2go: - $(QUIET) $(GO) generate bpf/kmesh/bpf2go/bpf2go.go + @bash -c 'source ./kmesh_compile_env_pre.sh; set_enhanced_kernel_env; prepare' + $(GO) generate bpf/kmesh/bpf2go/bpf2go.go .PHONY: tidy tidy: diff --git a/bpf/kmesh/ads/include/kmesh_common.h b/bpf/kmesh/ads/include/kmesh_common.h index 2df13531a..019cad971 100644 --- a/bpf/kmesh/ads/include/kmesh_common.h +++ b/bpf/kmesh/ads/include/kmesh_common.h @@ -28,11 +28,6 @@ val; \ }) -struct bpf_mem_ptr { - void *ptr; - __u32 size; -}; - #if !ENHANCED_KERNEL static inline int bpf__strncmp(const char *dst, int n, const char *src) { diff --git a/build.sh b/build.sh index 869a79b48..ed9c5dea4 100755 --- a/build.sh +++ b/build.sh @@ -1,55 +1,6 @@ #!/bin/bash ROOT_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]})) - -# adjust the range of BPF code compilation based on the kernel is enhanced -function bpf_compile_range_adjust() { - if [ "$ENHANCED_KERNEL" == "enhanced" ]; then - sed -i '/ads\/tracepoint\.c/s/\(.*\)generate/\/\/go:generate/' bpf/kmesh/bpf2go/bpf2go.go - sed -i '/ads\/sockops\.c/s/\(.*\)generate/\/\/go:generate/' bpf/kmesh/bpf2go/bpf2go.go - else - sed -i '/ads\/tracepoint\.c/s/\(.*\)generate/\/\/not go:generate/' bpf/kmesh/bpf2go/bpf2go.go - sed -i '/ads\/sockops\.c/s/\(.*\)generate/\/\/not go:generate/' bpf/kmesh/bpf2go/bpf2go.go - fi -} - -function set_enhanced_kernel_env() { - # we use /usr/include/linux/bpf.h to determine the runtime environment’s - # support for kmesh. Considering the case of online image compilation, a - # variable KERNEL_HEADER_LINUX_BPF is used here to specify the path of the - # source of macro definition. - # When using an online compiled image, /usr/include/linux/bpf.h in host - # machine will be mounted to config/linux-bpf.h. - # Otherwise, /usr/include/linux/bpf.h from the current compilation - # environment will be obtained - export KERNEL_HEADER_LINUX_BPF=$ROOT_DIR/config/linux-bpf.h - if [ ! -f "$KERNEL_HEADER_LINUX_BPF" ]; then - export KERNEL_HEADER_LINUX_BPF=/usr/include/linux/bpf.h - fi - - if grep -q "FN(parse_header_msg)" $KERNEL_HEADER_LINUX_BPF; then - export ENHANCED_KERNEL="enhanced" - else - export ENHANCED_KERNEL="unenhanced" - fi -} - -function prepare() { - bash kmesh_compile_env_pre.sh - bash kmesh_macros_env.sh - bash kmesh_bpf_env.sh - if [ "$(arch)" == "x86_64" ]; then - export EXTRA_CDEFINE="-D__x86_64__" - export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu:$C_INCLUDE_PATH - fi - - if [ "$(arch)" == "aarch64" ]; then - export C_INCLUDE_PATH=/usr/include/aarch64-linux-gnu:$C_INCLUDE_PATH - fi - export EXTRA_GOFLAGS="-gcflags=\"-N -l\" -buildmode=pie" - export EXTRA_CFLAGS="-O0 -g" - - bpf_compile_range_adjust -} +source ./kmesh_compile_env_pre.sh function install() { mkdir -p /etc/kmesh diff --git a/kmesh_compile_env_pre.sh b/kmesh_compile_env_pre.sh index 97e2bb6e3..b37504e99 100644 --- a/kmesh_compile_env_pre.sh +++ b/kmesh_compile_env_pre.sh @@ -55,6 +55,58 @@ function adapt_include_env { if [ "${SKIP_DEPENDENCY_INSTALL}" != "true" ]; then dependency_pkg_install fi -fix_libbpf_bug -adapt_low_version_kernel -adapt_include_env + +function kmesh_set_env(){ + if [ "$(arch)" == "x86_64" ]; then + export EXTRA_CDEFINE="-D__x86_64__" + export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu:$C_INCLUDE_PATH + fi + + if [ "$(arch)" == "aarch64" ]; then + export C_INCLUDE_PATH=/usr/include/aarch64-linux-gnu:$C_INCLUDE_PATH + fi + export EXTRA_GOFLAGS="-gcflags=\"-N -l\" -buildmode=pie" + export EXTRA_CFLAGS="-O0 -g" +} + +# adjust the range of BPF code compilation based on the kernel is enhanced +function bpf_compile_range_adjust() { + if [ "$ENHANCED_KERNEL" == "enhanced" ]; then + sed -i '/ads\/tracepoint\.c/s/\(.*\)generate/\/\/go:generate/' bpf/kmesh/bpf2go/bpf2go.go + sed -i '/ads\/sockops\.c/s/\(.*\)generate/\/\/go:generate/' bpf/kmesh/bpf2go/bpf2go.go + else + sed -i '/ads\/tracepoint\.c/s/\(.*\)generate/\/\/not go:generate/' bpf/kmesh/bpf2go/bpf2go.go + sed -i '/ads\/sockops\.c/s/\(.*\)generate/\/\/not go:generate/' bpf/kmesh/bpf2go/bpf2go.go + fi +} + +function set_enhanced_kernel_env() { + # we use /usr/include/linux/bpf.h to determine the runtime environment’s + # support for kmesh. Considering the case of online image compilation, a + # variable KERNEL_HEADER_LINUX_BPF is used here to specify the path of the + # source of macro definition. + # When using an online compiled image, /usr/include/linux/bpf.h in host + # machine will be mounted to config/linux-bpf.h. + # Otherwise, /usr/include/linux/bpf.h from the current compilation + # environment will be obtained + export KERNEL_HEADER_LINUX_BPF=$ROOT_DIR/config/linux-bpf.h + if [ ! -f "$KERNEL_HEADER_LINUX_BPF" ]; then + export KERNEL_HEADER_LINUX_BPF=/usr/include/linux/bpf.h + fi + + if grep -q "FN(parse_header_msg)" $KERNEL_HEADER_LINUX_BPF; then + export ENHANCED_KERNEL="enhanced" + else + export ENHANCED_KERNEL="unenhanced" + fi +} + +function prepare() { + fix_libbpf_bug + adapt_low_version_kernel + adapt_include_env + kmesh_set_env + bash kmesh_macros_env.sh + bash kmesh_bpf_env.sh + bpf_compile_range_adjust +} From 064b17cc04418a5bc9aba3346a493e5654adddea Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 30 Oct 2024 14:18:35 +0800 Subject: [PATCH 05/19] support make gen bpf2go file Signed-off-by: lec-bit --- Makefile | 3 +-- bpf/kmesh/ads/include/kmesh_common.h | 5 +++++ hack/gen_bpf2go.sh | 23 +++++++++++++++++++++++ hack/gen_bpf2go_exec.sh | 13 +++++++++++++ kmesh_compile_env_pre.sh | 8 ++++---- 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100755 hack/gen_bpf2go.sh create mode 100755 hack/gen_bpf2go_exec.sh diff --git a/Makefile b/Makefile index 51b3aa9e0..467c474a0 100644 --- a/Makefile +++ b/Makefile @@ -117,8 +117,7 @@ gen-proto: .PHONY: gen-bpf2go gen-bpf2go: - @bash -c 'source ./kmesh_compile_env_pre.sh; set_enhanced_kernel_env; prepare' - $(GO) generate bpf/kmesh/bpf2go/bpf2go.go + hack/gen_bpf2go.sh .PHONY: tidy tidy: diff --git a/bpf/kmesh/ads/include/kmesh_common.h b/bpf/kmesh/ads/include/kmesh_common.h index 019cad971..2df13531a 100644 --- a/bpf/kmesh/ads/include/kmesh_common.h +++ b/bpf/kmesh/ads/include/kmesh_common.h @@ -28,6 +28,11 @@ val; \ }) +struct bpf_mem_ptr { + void *ptr; + __u32 size; +}; + #if !ENHANCED_KERNEL static inline int bpf__strncmp(const char *dst, int n, const char *src) { diff --git a/hack/gen_bpf2go.sh b/hack/gen_bpf2go.sh new file mode 100755 index 000000000..8c3c85545 --- /dev/null +++ b/hack/gen_bpf2go.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +ROOT_DIR=$(git rev-parse --show-toplevel) +. $ROOT_DIR/hack/utils.sh +. $ROOT_DIR/kmesh_compile_env_pre.sh + +kmesh_exec(){ + set_enhanced_kernel_env + prepare + go generate bpf/kmesh/bpf2go/bpf2go.go +} + +function build_kmesh_bpf2go() { + local container_id=$1 + docker exec $container_id git config --global --add safe.directory /kmesh + docker exec -e VERSION=$VERSION $container_id ./hack/gen_bpf2go_exec.sh +} + + +container_id=$(run_docker_container) +build_kmesh_bpf2go $container_id +clean_container $container_id + diff --git a/hack/gen_bpf2go_exec.sh b/hack/gen_bpf2go_exec.sh new file mode 100755 index 000000000..666aee347 --- /dev/null +++ b/hack/gen_bpf2go_exec.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +ROOT_DIR=$(git rev-parse --show-toplevel) +. $ROOT_DIR/hack/utils.sh +. $ROOT_DIR/kmesh_compile_env_pre.sh + + +kmesh_exec(){ + set_enhanced_kernel_env + prepare + go generate bpf/kmesh/bpf2go/bpf2go.go +} +kmesh_exec diff --git a/kmesh_compile_env_pre.sh b/kmesh_compile_env_pre.sh index b37504e99..5ae6bd245 100644 --- a/kmesh_compile_env_pre.sh +++ b/kmesh_compile_env_pre.sh @@ -12,6 +12,7 @@ function install_libboundscheck() { } function dependency_pkg_install() { + echo "depdependency_pkg_install" if command -v apt > /dev/null; then # apt install apt-get update && apt-get install -y git make clang libbpf-dev llvm linux-tools-generic protobuf-compiler libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler cmake pkg-config @@ -52,10 +53,6 @@ function adapt_include_env { fi } -if [ "${SKIP_DEPENDENCY_INSTALL}" != "true" ]; then - dependency_pkg_install -fi - function kmesh_set_env(){ if [ "$(arch)" == "x86_64" ]; then export EXTRA_CDEFINE="-D__x86_64__" @@ -102,6 +99,9 @@ function set_enhanced_kernel_env() { } function prepare() { + if [ "${SKIP_DEPENDENCY_INSTALL}" != "true" ]; then + dependency_pkg_install + fi fix_libbpf_bug adapt_low_version_kernel adapt_include_env From 64c5f6e3b8e75fc45456770bd597ce896c4177ee Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 30 Oct 2024 15:42:34 +0800 Subject: [PATCH 06/19] update bpf2go files Signed-off-by: lec-bit --- .gitignore | 3 +++ .../bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go | 8 ++++++++ .../bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go | 8 ++++++++ .../kernelnative/enhanced/kmeshsockopscompat_bpfeb.go | 8 ++++++++ .../kernelnative/enhanced/kmeshsockopscompat_bpfel.go | 8 ++++++++ .../bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go | 8 ++++++++ .../bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go | 8 ++++++++ .../kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go | 8 ++++++++ .../kernelnative/normal/kmeshcgroupsockcompat_bpfel.go | 8 ++++++++ kmesh_compile_env_pre.sh | 1 - 10 files changed, 67 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 14f8c464e..8316a6ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,9 @@ bpf/kmesh/bpf2go/kmeshsockopsworkloadcompat_bpfel.go bpf/kmesh/bpf2go/kmeshxdpauthcompat_bpfeb.go bpf/kmesh/bpf2go/kmeshxdpauthcompat_bpfel.go +bpf/kmesh/bpf2go/* +config/* + kernel/**/*.ko kernel/**/*.cmd kernel/ko_src/kmesh/Module.symvers diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go index a3e569faf..ffb0bb0aa 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go @@ -14,6 +14,8 @@ import ( type KmeshSockopsBuf struct{ Data [40]int8 } +type KmeshSockopsClusterSockData struct{ ClusterId uint32 } + type KmeshSockopsLogEvent struct { Ret uint32 Msg [255]int8 @@ -87,6 +89,7 @@ type KmeshSockopsMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -94,6 +97,7 @@ type KmeshSockopsMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` @@ -123,6 +127,7 @@ type KmeshSockopsMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -130,6 +135,7 @@ type KmeshSockopsMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` @@ -142,6 +148,7 @@ func (m *KmeshSockopsMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -149,6 +156,7 @@ func (m *KmeshSockopsMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go index 3ef5f8d6f..b86b8f808 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go @@ -14,6 +14,8 @@ import ( type KmeshSockopsBuf struct{ Data [40]int8 } +type KmeshSockopsClusterSockData struct{ ClusterId uint32 } + type KmeshSockopsLogEvent struct { Ret uint32 Msg [255]int8 @@ -87,6 +89,7 @@ type KmeshSockopsMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -94,6 +97,7 @@ type KmeshSockopsMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` @@ -123,6 +127,7 @@ type KmeshSockopsMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -130,6 +135,7 @@ type KmeshSockopsMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` @@ -142,6 +148,7 @@ func (m *KmeshSockopsMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -149,6 +156,7 @@ func (m *KmeshSockopsMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go index 9622340c1..b31e2ada2 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go @@ -14,6 +14,8 @@ import ( type KmeshSockopsCompatBuf struct{ Data [40]int8 } +type KmeshSockopsCompatClusterSockData struct{ ClusterId uint32 } + type KmeshSockopsCompatLogEvent struct { Ret uint32 Msg [255]int8 @@ -87,6 +89,7 @@ type KmeshSockopsCompatMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -94,6 +97,7 @@ type KmeshSockopsCompatMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` @@ -123,6 +127,7 @@ type KmeshSockopsCompatMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -130,6 +135,7 @@ type KmeshSockopsCompatMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` @@ -142,6 +148,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -149,6 +156,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go index 35f994847..708f43d25 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go @@ -14,6 +14,8 @@ import ( type KmeshSockopsCompatBuf struct{ Data [40]int8 } +type KmeshSockopsCompatClusterSockData struct{ ClusterId uint32 } + type KmeshSockopsCompatLogEvent struct { Ret uint32 Msg [255]int8 @@ -87,6 +89,7 @@ type KmeshSockopsCompatMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -94,6 +97,7 @@ type KmeshSockopsCompatMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` @@ -123,6 +127,7 @@ type KmeshSockopsCompatMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -130,6 +135,7 @@ type KmeshSockopsCompatMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` @@ -142,6 +148,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -149,6 +156,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go index 51c7023ae..3652e4b9e 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go @@ -14,6 +14,8 @@ import ( type KmeshCgroupSockBuf struct{ Data [40]int8 } +type KmeshCgroupSockClusterSockData struct{ ClusterId uint32 } + type KmeshCgroupSockLogEvent struct { Ret uint32 Msg [255]int8 @@ -86,6 +88,7 @@ type KmeshCgroupSockMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -93,6 +96,7 @@ type KmeshCgroupSockMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` @@ -121,6 +125,7 @@ type KmeshCgroupSockMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -128,6 +133,7 @@ type KmeshCgroupSockMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` @@ -139,6 +145,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -146,6 +153,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go index 28beebe13..1e8681b0a 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go @@ -14,6 +14,8 @@ import ( type KmeshCgroupSockBuf struct{ Data [40]int8 } +type KmeshCgroupSockClusterSockData struct{ ClusterId uint32 } + type KmeshCgroupSockLogEvent struct { Ret uint32 Msg [255]int8 @@ -86,6 +88,7 @@ type KmeshCgroupSockMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -93,6 +96,7 @@ type KmeshCgroupSockMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` @@ -121,6 +125,7 @@ type KmeshCgroupSockMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -128,6 +133,7 @@ type KmeshCgroupSockMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` @@ -139,6 +145,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -146,6 +153,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go index 54aec6ca9..274f561ff 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go @@ -14,6 +14,8 @@ import ( type KmeshCgroupSockCompatBuf struct{ Data [40]int8 } +type KmeshCgroupSockCompatClusterSockData struct{ ClusterId uint32 } + type KmeshCgroupSockCompatLogEvent struct { Ret uint32 Msg [255]int8 @@ -86,6 +88,7 @@ type KmeshCgroupSockCompatMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -93,6 +96,7 @@ type KmeshCgroupSockCompatMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` @@ -121,6 +125,7 @@ type KmeshCgroupSockCompatMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -128,6 +133,7 @@ type KmeshCgroupSockCompatMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` @@ -139,6 +145,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -146,6 +153,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go index 6533eba45..ed392a99f 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go @@ -14,6 +14,8 @@ import ( type KmeshCgroupSockCompatBuf struct{ Data [40]int8 } +type KmeshCgroupSockCompatClusterSockData struct{ ClusterId uint32 } + type KmeshCgroupSockCompatLogEvent struct { Ret uint32 Msg [255]int8 @@ -86,6 +88,7 @@ type KmeshCgroupSockCompatMapSpecs struct { BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` @@ -93,6 +96,7 @@ type KmeshCgroupSockCompatMapSpecs struct { KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` @@ -121,6 +125,7 @@ type KmeshCgroupSockCompatMaps struct { BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` @@ -128,6 +133,7 @@ type KmeshCgroupSockCompatMaps struct { KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` @@ -139,6 +145,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.BpfLogLevel, m.InnerMap, m.KmeshCluster, + m.KmeshClusterStats, m.KmeshEvents, m.KmeshListener, m.KmeshManage, @@ -146,6 +153,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.KmeshTailCallProg, m.MapOfClusterEps, m.MapOfClusterEpsData, + m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, m.TmpBuf, diff --git a/kmesh_compile_env_pre.sh b/kmesh_compile_env_pre.sh index 5ae6bd245..09076fc56 100644 --- a/kmesh_compile_env_pre.sh +++ b/kmesh_compile_env_pre.sh @@ -12,7 +12,6 @@ function install_libboundscheck() { } function dependency_pkg_install() { - echo "depdependency_pkg_install" if command -v apt > /dev/null; then # apt install apt-get update && apt-get install -y git make clang libbpf-dev llvm linux-tools-generic protobuf-compiler libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler cmake pkg-config From ca275f021c3db1bfc0f216677dbd8baa717f8689 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 04:09:38 +0800 Subject: [PATCH 07/19] update .gitignore Signed-off-by: lec-bit --- .gitignore | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 8316a6ee4..605535b50 100644 --- a/.gitignore +++ b/.gitignore @@ -40,34 +40,12 @@ coverage.out # build artifacts *.so *.o -bpf/kmesh/bpf2go/kmeshcgroupsock_bpfeb.go -bpf/kmesh/bpf2go/kmeshcgroupsock_bpfel.go -bpf/kmesh/bpf2go/kmeshcgroupsockworkload_bpfeb.go -bpf/kmesh/bpf2go/kmeshcgroupsockworkload_bpfel.go -bpf/kmesh/bpf2go/kmeshsockopsworkload_bpfeb.go -bpf/kmesh/bpf2go/kmeshsockopsworkload_bpfel.go -bpf/kmesh/bpf2go/kmeshxdpauth_bpfeb.go -bpf/kmesh/bpf2go/kmeshxdpauth_bpfel.go -bpf/kmesh/bpf2go/kmeshsendmsg_bpfeb.go -bpf/kmesh/bpf2go/kmeshsendmsg_bpfel.go -bpf/kmesh/bpf2go/kmeshsockops_bpfeb.go -bpf/kmesh/bpf2go/kmeshsockops_bpfel.go -bpf/kmesh/bpf2go/kmeshtracepoint_bpfeb.go -bpf/kmesh/bpf2go/kmeshtracepoint_bpfel.go -bpf/kmesh/bpf2go/kmeshcgroupsockcompat_bpfeb.go -bpf/kmesh/bpf2go/kmeshcgroupsockcompat_bpfel.go -bpf/kmesh/bpf2go/kmeshcgroupsockworkloadcompat_bpfeb.go -bpf/kmesh/bpf2go/kmeshcgroupsockworkloadcompat_bpfel.go -bpf/kmesh/bpf2go/kmeshsendmsgcompat_bpfeb.go -bpf/kmesh/bpf2go/kmeshsendmsgcompat_bpfel.go -bpf/kmesh/bpf2go/kmeshsockopsworkloadcompat_bpfeb.go -bpf/kmesh/bpf2go/kmeshsockopsworkloadcompat_bpfel.go -bpf/kmesh/bpf2go/kmeshxdpauthcompat_bpfeb.go -bpf/kmesh/bpf2go/kmeshxdpauthcompat_bpfel.go +bpf/kmesh/bpf2go/** +config/** +mk/* -bpf/kmesh/bpf2go/* -config/* +bpf/include/bpf_helper_defs_ext.h kernel/**/*.ko kernel/**/*.cmd From b8d7427d10947f1fa81789ac76ea333e40550cff Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 04:10:31 +0800 Subject: [PATCH 08/19] update bpf2go Signed-off-by: lec-bit --- .../kmeshcgroupsockworkload_bpfeb.go | 26 +++++++++++++++-- .../kmeshcgroupsockworkload_bpfel.go | 26 +++++++++++++++-- .../kmeshcgroupsockworkloadcompat_bpfeb.go | 26 +++++++++++++++-- .../kmeshcgroupsockworkloadcompat_bpfel.go | 26 +++++++++++++++-- .../bpf2go/dualengine/kmeshsendmsg_bpfeb.go | 22 +++++++------- .../bpf2go/dualengine/kmeshsendmsg_bpfel.go | 22 +++++++------- .../dualengine/kmeshsendmsgcompat_bpfeb.go | 22 +++++++------- .../dualengine/kmeshsendmsgcompat_bpfel.go | 22 +++++++------- .../dualengine/kmeshsockopsworkload_bpfeb.go | 26 +++++++++++++++-- .../dualengine/kmeshsockopsworkload_bpfel.go | 26 +++++++++++++++-- .../kmeshsockopsworkloadcompat_bpfeb.go | 26 +++++++++++++++-- .../kmeshsockopsworkloadcompat_bpfel.go | 26 +++++++++++++++-- .../bpf2go/dualengine/kmeshxdpauth_bpfeb.go | 6 ++-- .../bpf2go/dualengine/kmeshxdpauth_bpfel.go | 6 ++-- .../dualengine/kmeshxdpauthcompat_bpfeb.go | 6 ++-- .../dualengine/kmeshxdpauthcompat_bpfel.go | 6 ++-- .../enhanced/kmeshsockops_bpfeb.go | 29 +++++++++++++++++-- .../enhanced/kmeshsockops_bpfel.go | 29 +++++++++++++++++-- .../enhanced/kmeshsockopscompat_bpfeb.go | 29 +++++++++++++++++-- .../enhanced/kmeshsockopscompat_bpfel.go | 29 +++++++++++++++++-- .../normal/kmeshcgroupsock_bpfeb.go | 29 +++++++++++++++++-- .../normal/kmeshcgroupsock_bpfel.go | 29 +++++++++++++++++-- .../normal/kmeshcgroupsockcompat_bpfeb.go | 29 +++++++++++++++++-- .../normal/kmeshcgroupsockcompat_bpfel.go | 29 +++++++++++++++++-- 24 files changed, 448 insertions(+), 104 deletions(-) diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go index 4dcc5701c..3c91b7003 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go @@ -35,6 +35,20 @@ type KmeshCgroupSockWorkloadManagerKey struct { _ [8]byte } +type KmeshCgroupSockWorkloadOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshCgroupSockWorkloadOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshCgroupSockWorkloadSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -91,13 +105,15 @@ type KmeshCgroupSockWorkloadProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockWorkloadMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -130,13 +146,15 @@ func (o *KmeshCgroupSockWorkloadObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockWorkloadMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -152,13 +170,15 @@ type KmeshCgroupSockWorkloadMaps struct { func (m *KmeshCgroupSockWorkloadMaps) Close() error { return _KmeshCgroupSockWorkloadClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go index 17db7ab38..1a9310d46 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go @@ -35,6 +35,20 @@ type KmeshCgroupSockWorkloadManagerKey struct { _ [8]byte } +type KmeshCgroupSockWorkloadOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshCgroupSockWorkloadOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshCgroupSockWorkloadSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -91,13 +105,15 @@ type KmeshCgroupSockWorkloadProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockWorkloadMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -130,13 +146,15 @@ func (o *KmeshCgroupSockWorkloadObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockWorkloadMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -152,13 +170,15 @@ type KmeshCgroupSockWorkloadMaps struct { func (m *KmeshCgroupSockWorkloadMaps) Close() error { return _KmeshCgroupSockWorkloadClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go index cb8055572..82373b92d 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go @@ -35,6 +35,20 @@ type KmeshCgroupSockWorkloadCompatManagerKey struct { _ [8]byte } +type KmeshCgroupSockWorkloadCompatOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshCgroupSockWorkloadCompatOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshCgroupSockWorkloadCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -91,13 +105,15 @@ type KmeshCgroupSockWorkloadCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockWorkloadCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -130,13 +146,15 @@ func (o *KmeshCgroupSockWorkloadCompatObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockWorkloadCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -152,13 +170,15 @@ type KmeshCgroupSockWorkloadCompatMaps struct { func (m *KmeshCgroupSockWorkloadCompatMaps) Close() error { return _KmeshCgroupSockWorkloadCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go index 2c54a2c20..c2f938178 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go @@ -35,6 +35,20 @@ type KmeshCgroupSockWorkloadCompatManagerKey struct { _ [8]byte } +type KmeshCgroupSockWorkloadCompatOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshCgroupSockWorkloadCompatOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshCgroupSockWorkloadCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -91,13 +105,15 @@ type KmeshCgroupSockWorkloadCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockWorkloadCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -130,13 +146,15 @@ func (o *KmeshCgroupSockWorkloadCompatObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockWorkloadCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -152,13 +170,15 @@ type KmeshCgroupSockWorkloadCompatMaps struct { func (m *KmeshCgroupSockWorkloadCompatMaps) Close() error { return _KmeshCgroupSockWorkloadCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go index 4bed256e0..121e72ce0 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go @@ -78,11 +78,11 @@ type KmeshSendmsgProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSendmsgMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } // KmeshSendmsgObjects contains all objects after they have been loaded into the kernel. @@ -104,16 +104,16 @@ func (o *KmeshSendmsgObjects) Close() error { // // It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSendmsgMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.Map `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSendmsgMaps) Close() error { return _KmeshSendmsgClose( - m.BpfLogLevel, + m.KmeshConfigMap, m.KmeshEvents, m.MapOfDstInfo, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go index a0a78499f..538d62496 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go @@ -78,11 +78,11 @@ type KmeshSendmsgProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSendmsgMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } // KmeshSendmsgObjects contains all objects after they have been loaded into the kernel. @@ -104,16 +104,16 @@ func (o *KmeshSendmsgObjects) Close() error { // // It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSendmsgMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.Map `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSendmsgMaps) Close() error { return _KmeshSendmsgClose( - m.BpfLogLevel, + m.KmeshConfigMap, m.KmeshEvents, m.MapOfDstInfo, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go index 61c2fd88f..44898b255 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go @@ -78,11 +78,11 @@ type KmeshSendmsgCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSendmsgCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } // KmeshSendmsgCompatObjects contains all objects after they have been loaded into the kernel. @@ -104,16 +104,16 @@ func (o *KmeshSendmsgCompatObjects) Close() error { // // It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSendmsgCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.Map `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSendmsgCompatMaps) Close() error { return _KmeshSendmsgCompatClose( - m.BpfLogLevel, + m.KmeshConfigMap, m.KmeshEvents, m.MapOfDstInfo, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go index 02a1ea659..7ecbfd257 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go @@ -78,11 +78,11 @@ type KmeshSendmsgCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSendmsgCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } // KmeshSendmsgCompatObjects contains all objects after they have been loaded into the kernel. @@ -104,16 +104,16 @@ func (o *KmeshSendmsgCompatObjects) Close() error { // // It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSendmsgCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` - KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` - MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` - TmpBuf *ebpf.Map `ebpf:"tmp_buf"` - TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSendmsgCompatMaps) Close() error { return _KmeshSendmsgCompatClose( - m.BpfLogLevel, + m.KmeshConfigMap, m.KmeshEvents, m.MapOfDstInfo, m.TmpBuf, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go index 8eef0a88d..247e747a5 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go @@ -35,6 +35,20 @@ type KmeshSockopsWorkloadManagerKey struct { _ [8]byte } +type KmeshSockopsWorkloadOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshSockopsWorkloadOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshSockopsWorkloadSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -90,13 +104,15 @@ type KmeshSockopsWorkloadProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsWorkloadMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -129,13 +145,15 @@ func (o *KmeshSockopsWorkloadObjects) Close() error { // // It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsWorkloadMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -151,13 +169,15 @@ type KmeshSockopsWorkloadMaps struct { func (m *KmeshSockopsWorkloadMaps) Close() error { return _KmeshSockopsWorkloadClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go index 846fbdfea..2e36e830a 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go @@ -35,6 +35,20 @@ type KmeshSockopsWorkloadManagerKey struct { _ [8]byte } +type KmeshSockopsWorkloadOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshSockopsWorkloadOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshSockopsWorkloadSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -90,13 +104,15 @@ type KmeshSockopsWorkloadProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsWorkloadMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -129,13 +145,15 @@ func (o *KmeshSockopsWorkloadObjects) Close() error { // // It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsWorkloadMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -151,13 +169,15 @@ type KmeshSockopsWorkloadMaps struct { func (m *KmeshSockopsWorkloadMaps) Close() error { return _KmeshSockopsWorkloadClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go index d4acaf447..dfa6dc0ef 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go @@ -35,6 +35,20 @@ type KmeshSockopsWorkloadCompatManagerKey struct { _ [8]byte } +type KmeshSockopsWorkloadCompatOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshSockopsWorkloadCompatOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshSockopsWorkloadCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -90,13 +104,15 @@ type KmeshSockopsWorkloadCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsWorkloadCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -129,13 +145,15 @@ func (o *KmeshSockopsWorkloadCompatObjects) Close() error { // // It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsWorkloadCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -151,13 +169,15 @@ type KmeshSockopsWorkloadCompatMaps struct { func (m *KmeshSockopsWorkloadCompatMaps) Close() error { return _KmeshSockopsWorkloadCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go index 78b0cffab..faab12fc0 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go @@ -35,6 +35,20 @@ type KmeshSockopsWorkloadCompatManagerKey struct { _ [8]byte } +type KmeshSockopsWorkloadCompatOperationUsageData struct { + StartTime uint64 + EndTime uint64 + PidTgid uint64 + OperationType uint32 + _ [4]byte +} + +type KmeshSockopsWorkloadCompatOperationUsageKey struct { + SocketCookie uint64 + OperationType uint32 + _ [4]byte +} + type KmeshSockopsWorkloadCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -90,13 +104,15 @@ type KmeshSockopsWorkloadCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsWorkloadCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.MapSpec `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.MapSpec `ebpf:"kmesh_perf_map"` KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` @@ -129,13 +145,15 @@ func (o *KmeshSockopsWorkloadCompatObjects) Close() error { // // It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsWorkloadCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshPerfInfo *ebpf.Map `ebpf:"kmesh_perf_info"` + KmeshPerfMap *ebpf.Map `ebpf:"kmesh_perf_map"` KmeshService *ebpf.Map `ebpf:"kmesh_service"` MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` @@ -151,13 +169,15 @@ type KmeshSockopsWorkloadCompatMaps struct { func (m *KmeshSockopsWorkloadCompatMaps) Close() error { return _KmeshSockopsWorkloadCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, m.KmeshManage, + m.KmeshPerfInfo, + m.KmeshPerfMap, m.KmeshService, m.MapOfAuth, m.MapOfDstInfo, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go index 766b70048..f49906e24 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go @@ -90,9 +90,9 @@ type KmeshXDPAuthProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshXDPAuthMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` @@ -127,9 +127,9 @@ func (o *KmeshXDPAuthObjects) Close() error { // // It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshXDPAuthMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` @@ -147,9 +147,9 @@ type KmeshXDPAuthMaps struct { func (m *KmeshXDPAuthMaps) Close() error { return _KmeshXDPAuthClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go index 3f8dd7015..23b836527 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go @@ -90,9 +90,9 @@ type KmeshXDPAuthProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshXDPAuthMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` @@ -127,9 +127,9 @@ func (o *KmeshXDPAuthObjects) Close() error { // // It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshXDPAuthMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` @@ -147,9 +147,9 @@ type KmeshXDPAuthMaps struct { func (m *KmeshXDPAuthMaps) Close() error { return _KmeshXDPAuthClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go index 307208048..b0bd880b8 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go @@ -90,9 +90,9 @@ type KmeshXDPAuthCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshXDPAuthCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` @@ -127,9 +127,9 @@ func (o *KmeshXDPAuthCompatObjects) Close() error { // // It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshXDPAuthCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` @@ -147,9 +147,9 @@ type KmeshXDPAuthCompatMaps struct { func (m *KmeshXDPAuthCompatMaps) Close() error { return _KmeshXDPAuthCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go index be34f963d..61a0f2242 100644 --- a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go @@ -90,9 +90,9 @@ type KmeshXDPAuthCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshXDPAuthCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` @@ -127,9 +127,9 @@ func (o *KmeshXDPAuthCompatObjects) Close() error { // // It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshXDPAuthCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` @@ -147,9 +147,9 @@ type KmeshXDPAuthCompatMaps struct { func (m *KmeshXDPAuthCompatMaps) Close() error { return _KmeshXDPAuthCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshBackend, + m.KmeshConfigMap, m.KmeshEndpoint, m.KmeshEvents, m.KmeshFrontend, diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go index ffb0bb0aa..707e6b814 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go @@ -27,6 +27,23 @@ type KmeshSockopsManagerKey struct { _ [8]byte } +type KmeshSockopsRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshSockopsRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshSockopsSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -86,13 +103,14 @@ type KmeshSockopsProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -101,6 +119,7 @@ type KmeshSockopsMapSpecs struct { MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -124,13 +143,14 @@ func (o *KmeshSockopsObjects) Close() error { // // It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -139,19 +159,21 @@ type KmeshSockopsMaps struct { MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSockopsMaps) Close() error { return _KmeshSockopsClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -160,6 +182,7 @@ func (m *KmeshSockopsMaps) Close() error { m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go index b86b8f808..17ae9717a 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go @@ -27,6 +27,23 @@ type KmeshSockopsManagerKey struct { _ [8]byte } +type KmeshSockopsRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshSockopsRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshSockopsSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -86,13 +103,14 @@ type KmeshSockopsProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -101,6 +119,7 @@ type KmeshSockopsMapSpecs struct { MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -124,13 +143,14 @@ func (o *KmeshSockopsObjects) Close() error { // // It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -139,19 +159,21 @@ type KmeshSockopsMaps struct { MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSockopsMaps) Close() error { return _KmeshSockopsClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -160,6 +182,7 @@ func (m *KmeshSockopsMaps) Close() error { m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go index b31e2ada2..aae8eb089 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go @@ -27,6 +27,23 @@ type KmeshSockopsCompatManagerKey struct { _ [8]byte } +type KmeshSockopsCompatRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshSockopsCompatRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshSockopsCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -86,13 +103,14 @@ type KmeshSockopsCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -101,6 +119,7 @@ type KmeshSockopsCompatMapSpecs struct { MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -124,13 +143,14 @@ func (o *KmeshSockopsCompatObjects) Close() error { // // It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -139,19 +159,21 @@ type KmeshSockopsCompatMaps struct { MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSockopsCompatMaps) Close() error { return _KmeshSockopsCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -160,6 +182,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go index 708f43d25..4be520386 100644 --- a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go @@ -27,6 +27,23 @@ type KmeshSockopsCompatManagerKey struct { _ [8]byte } +type KmeshSockopsCompatRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshSockopsCompatRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshSockopsCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -86,13 +103,14 @@ type KmeshSockopsCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshSockopsCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -101,6 +119,7 @@ type KmeshSockopsCompatMapSpecs struct { MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -124,13 +143,14 @@ func (o *KmeshSockopsCompatObjects) Close() error { // // It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshSockopsCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -139,19 +159,21 @@ type KmeshSockopsCompatMaps struct { MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshSockopsCompatMaps) Close() error { return _KmeshSockopsCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -160,6 +182,7 @@ func (m *KmeshSockopsCompatMaps) Close() error { m.MapOfRouterConfig, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go index 3652e4b9e..ec6f1e440 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go @@ -27,6 +27,23 @@ type KmeshCgroupSockManagerKey struct { _ [8]byte } +type KmeshCgroupSockRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshCgroupSockRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshCgroupSockSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -85,13 +102,14 @@ type KmeshCgroupSockProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -99,6 +117,7 @@ type KmeshCgroupSockMapSpecs struct { MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -122,13 +141,14 @@ func (o *KmeshCgroupSockObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -136,19 +156,21 @@ type KmeshCgroupSockMaps struct { MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshCgroupSockMaps) Close() error { return _KmeshCgroupSockClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -156,6 +178,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go index 1e8681b0a..fea0fdd74 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go @@ -27,6 +27,23 @@ type KmeshCgroupSockManagerKey struct { _ [8]byte } +type KmeshCgroupSockRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshCgroupSockRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshCgroupSockSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -85,13 +102,14 @@ type KmeshCgroupSockProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -99,6 +117,7 @@ type KmeshCgroupSockMapSpecs struct { MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -122,13 +141,14 @@ func (o *KmeshCgroupSockObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -136,19 +156,21 @@ type KmeshCgroupSockMaps struct { MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshCgroupSockMaps) Close() error { return _KmeshCgroupSockClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -156,6 +178,7 @@ func (m *KmeshCgroupSockMaps) Close() error { m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go index 274f561ff..830d651dc 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go @@ -27,6 +27,23 @@ type KmeshCgroupSockCompatManagerKey struct { _ [8]byte } +type KmeshCgroupSockCompatRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshCgroupSockCompatRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshCgroupSockCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -85,13 +102,14 @@ type KmeshCgroupSockCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -99,6 +117,7 @@ type KmeshCgroupSockCompatMapSpecs struct { MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -122,13 +141,14 @@ func (o *KmeshCgroupSockCompatObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -136,19 +156,21 @@ type KmeshCgroupSockCompatMaps struct { MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshCgroupSockCompatMaps) Close() error { return _KmeshCgroupSockCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -156,6 +178,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go index ed392a99f..6286ccbdb 100644 --- a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go @@ -27,6 +27,23 @@ type KmeshCgroupSockCompatManagerKey struct { _ [8]byte } +type KmeshCgroupSockCompatRatelimitKey struct { + Key struct { + SkSkb struct { + Netns uint64 + Ipv4 uint32 + Port uint32 + Family uint32 + _ [4]byte + } + } +} + +type KmeshCgroupSockCompatRatelimitValue struct { + LastTopup uint64 + Tokens uint64 +} + type KmeshCgroupSockCompatSockStorageData struct { ConnectNs uint64 Direction uint8 @@ -85,13 +102,14 @@ type KmeshCgroupSockCompatProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type KmeshCgroupSockCompatMapSpecs struct { - BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` InnerMap *ebpf.MapSpec `ebpf:"inner_map"` KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.MapSpec `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.MapSpec `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.MapSpec `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` @@ -99,6 +117,7 @@ type KmeshCgroupSockCompatMapSpecs struct { MapOfClusterSock *ebpf.MapSpec `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + OuterOfMaglev *ebpf.MapSpec `ebpf:"outer_of_maglev"` TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` } @@ -122,13 +141,14 @@ func (o *KmeshCgroupSockCompatObjects) Close() error { // // It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. type KmeshCgroupSockCompatMaps struct { - BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` InnerMap *ebpf.Map `ebpf:"inner_map"` KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` KmeshClusterStats *ebpf.Map `ebpf:"kmesh_cluster_stats"` + KmeshConfigMap *ebpf.Map `ebpf:"kmesh_config_map"` KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshRatelimit *ebpf.Map `ebpf:"kmesh_ratelimit"` KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` @@ -136,19 +156,21 @@ type KmeshCgroupSockCompatMaps struct { MapOfClusterSock *ebpf.Map `ebpf:"map_of_cluster_sock"` MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` OuterMap *ebpf.Map `ebpf:"outer_map"` + OuterOfMaglev *ebpf.Map `ebpf:"outer_of_maglev"` TmpBuf *ebpf.Map `ebpf:"tmp_buf"` TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` } func (m *KmeshCgroupSockCompatMaps) Close() error { return _KmeshCgroupSockCompatClose( - m.BpfLogLevel, m.InnerMap, m.KmeshCluster, m.KmeshClusterStats, + m.KmeshConfigMap, m.KmeshEvents, m.KmeshListener, m.KmeshManage, + m.KmeshRatelimit, m.KmeshTailCallCtx, m.KmeshTailCallProg, m.MapOfClusterEps, @@ -156,6 +178,7 @@ func (m *KmeshCgroupSockCompatMaps) Close() error { m.MapOfClusterSock, m.MapOfSockStorage, m.OuterMap, + m.OuterOfMaglev, m.TmpBuf, m.TmpLogBuf, ) From e239bc1024184bdfcc95e76b3c8027a7515e2c26 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 05:00:15 +0800 Subject: [PATCH 09/19] update gen-check Signed-off-by: lec-bit --- hack/gen-check.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hack/gen-check.sh b/hack/gen-check.sh index e48f58c91..677de1e03 100755 --- a/hack/gen-check.sh +++ b/hack/gen-check.sh @@ -1,5 +1,15 @@ #!/bin/bash +function ignore(){ + git update-index --assume-unchanged bpf/include/bpf_helper_defs_ext.h + git update-index --assume-unchanged config/kmesh_marcos_def.h + git update-index --assume-unchanged bpf/kmesh/bpf2go/bpf2go.go + git update-index --assume-unchanged mk/api-v2-c.pc + git update-index --assume-unchanged mk/bpf.pc +} + +ignore + if [[ -n $(git status --porcelain) ]]; then git status git diff From ad186e1b4659594b54fe1d817a8c42af10100871 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 05:18:42 +0800 Subject: [PATCH 10/19] fix gen-copyright Signed-off-by: lec-bit --- .gitignore | 2 -- hack/copyright/copyright_scan_dir.json | 1 - hack/gen-check.sh | 10 ---------- hack/gen_bpf2go.sh | 7 +------ 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 605535b50..a6b9ba09f 100644 --- a/.gitignore +++ b/.gitignore @@ -45,8 +45,6 @@ bpf/kmesh/bpf2go/** config/** mk/* -bpf/include/bpf_helper_defs_ext.h - kernel/**/*.ko kernel/**/*.cmd kernel/ko_src/kmesh/Module.symvers diff --git a/hack/copyright/copyright_scan_dir.json b/hack/copyright/copyright_scan_dir.json index 3e23bd566..a60c6b846 100644 --- a/hack/copyright/copyright_scan_dir.json +++ b/hack/copyright/copyright_scan_dir.json @@ -9,7 +9,6 @@ "c_dirs": [ "/bpf", "/config", - "/depends", "/kernel", "/oncn-mda" ], diff --git a/hack/gen-check.sh b/hack/gen-check.sh index 677de1e03..e48f58c91 100755 --- a/hack/gen-check.sh +++ b/hack/gen-check.sh @@ -1,15 +1,5 @@ #!/bin/bash -function ignore(){ - git update-index --assume-unchanged bpf/include/bpf_helper_defs_ext.h - git update-index --assume-unchanged config/kmesh_marcos_def.h - git update-index --assume-unchanged bpf/kmesh/bpf2go/bpf2go.go - git update-index --assume-unchanged mk/api-v2-c.pc - git update-index --assume-unchanged mk/bpf.pc -} - -ignore - if [[ -n $(git status --porcelain) ]]; then git status git diff diff --git a/hack/gen_bpf2go.sh b/hack/gen_bpf2go.sh index 8c3c85545..7f20dea10 100755 --- a/hack/gen_bpf2go.sh +++ b/hack/gen_bpf2go.sh @@ -4,12 +4,6 @@ ROOT_DIR=$(git rev-parse --show-toplevel) . $ROOT_DIR/hack/utils.sh . $ROOT_DIR/kmesh_compile_env_pre.sh -kmesh_exec(){ - set_enhanced_kernel_env - prepare - go generate bpf/kmesh/bpf2go/bpf2go.go -} - function build_kmesh_bpf2go() { local container_id=$1 docker exec $container_id git config --global --add safe.directory /kmesh @@ -20,4 +14,5 @@ function build_kmesh_bpf2go() { container_id=$(run_docker_container) build_kmesh_bpf2go $container_id clean_container $container_id +make clean From 4398595d5585ff91068fa45397710bd47b7f61a3 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 06:49:30 +0800 Subject: [PATCH 11/19] update golanglint Signed-off-by: lec-bit --- common/config/.golangci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 4f299ea3a..316413c99 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -82,6 +82,9 @@ issues: - ".*\\.gen\\.go" - ".*_bpfeb\\.go" - ".*_bpfel\\.go" + - ".*bpfeb\\.go" + - ".*bpfel\\.go" + - "bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go" exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ From 806092086204f7d6b3d1cd0cdc3a5356ce943947 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 09:11:46 +0800 Subject: [PATCH 12/19] fix golanglint Signed-off-by: lec-bit --- common/config/.golangci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 316413c99..edcc48bc3 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -84,7 +84,7 @@ issues: - ".*_bpfel\\.go" - ".*bpfeb\\.go" - ".*bpfel\\.go" - - "bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go" + - "kmeshsockops_bpfel.go" exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ From 327bd3f6f1214f6a027f3ebdd24bab3b18786647 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 12:38:08 +0800 Subject: [PATCH 13/19] fix golanglint Signed-off-by: lec-bit --- common/config/.golangci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index edcc48bc3..bde244405 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -85,6 +85,9 @@ issues: - ".*bpfeb\\.go" - ".*bpfel\\.go" - "kmeshsockops_bpfel.go" + exclude-dirs: + - "bpf/kmesh/bpf2go/dualengine" + - "bpf/kmesh/bpf2go/kernelnative" exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ From a3de8e8e01c2da74e5749567816b9a3751b05d2d Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 13:25:41 +0800 Subject: [PATCH 14/19] golanglint Signed-off-by: lec-bit --- common/config/.golangci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index bde244405..898b3a32b 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -81,13 +81,13 @@ issues: - ".*\\.pb\\.go" - ".*\\.gen\\.go" - ".*_bpfeb\\.go" - - ".*_bpfel\\.go" + - ".*_bpfel\\.go$" - ".*bpfeb\\.go" - - ".*bpfel\\.go" - - "kmeshsockops_bpfel.go" + - ".*bpfel\\.go$" + - bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go exclude-dirs: - - "bpf/kmesh/bpf2go/dualengine" - - "bpf/kmesh/bpf2go/kernelnative" + - bpf/kmesh/bpf2go/dualengine + - bpf/kmesh/bpf2go/kernelnative exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ From 99e8ee8d738c65c2228cb5c9c9cbdcded5c91578 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Tue, 5 Nov 2024 13:41:53 +0800 Subject: [PATCH 15/19] update Signed-off-by: lec-bit --- .github/workflows/main.yml | 3 +- .golangci.yaml | 132 +++++++++++++++++++++++++++++++++++ common/config/.golangci.yaml | 2 +- 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 .golangci.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf0ab7fdb..a6fdd8117 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,8 +49,9 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: - args: "--config=common/config/.golangci.yaml --out-format colored-line-number" + args: "--config=.golangci.yaml --out-format colored-line-number --verbose" skip-pkg-cache: true + working-directory: . - name: Go Test run: | diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 000000000..01aa10494 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,132 @@ +# This files contains all configuration options for analysis running. +# More details please refer to: https://golangci-lint.run/usage/configuration/ + +run: + # timeout for analysis, e.g. 30s, 5m, default is 1m + timeout: 30m + + # which dirs to skip: issues from them won't be reported; + # can use regexp here: generated.*, regexp is applied on full path; + # default value is empty list, but default dirs are skipped independently + # from this option's value (see skip-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work + # on Windows. + skip-dirs: [] + + # default is true. Enables skipping of directories: + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + skip-dirs-use-default: true + + # One of 'readonly' and 'vendor'. + # - readonly: the go command is disallowed from the implicit automatic updating of go.mod described above. + # Instead, it fails when any changes to go.mod are needed. This setting is most useful to check + # that go.mod does not need updates, such as in a continuous integration and testing system. + # - vendor: the go command assumes that the vendor directory holds the correct copies of dependencies and ignores + # the dependency descriptions in go.mod. + modules-download-mode: readonly +linters: + disable-all: true + enable: + # linters maintained by golang.org + - gofmt + - goimports + - govet + - depguard + # linters default enabled by golangci-lint . + - errcheck + - gosimple + - ineffassign + - staticcheck + - typecheck + - unused + - misspell + - whitespace + #- gosec + #- revive + +linters-settings: + goimports: + local-prefixes: kmesh.net + gocyclo: + # minimal cyclomatic complexity to report + min-complexity: 15 + depguard: + rules: + main: + deny: + - pkg: "github.com/golang/protobuf" + desc: "Please use google.golang.org/protobuf instead." + - pkg: 'gopkg.in/yaml.v3' + desc: "Please use sigs.k8s.io/yaml instead." + - pkg: "gopkg.in/yaml.v2" + desc: "Please use sigs.k8s.io/yaml instead." + - pkg: "github.com/ghodss/yaml" + desc: "Please use sigs.k8s.io/yaml instead." + + +issues: + # List of regexps of issue texts to exclude, empty list by default. + # But independently from this option we use default exclude patterns, + # it can be disabled by `exclude-use-default: false`. To list all + # excluded by default patterns execute `golangci-lint run --help` + exclude: + - composite literal uses unkeyed fields + # Which files to exclude: they will be analyzed, but issues from them won't be reported. + # There is no need to include all autogenerated files, + # we confidently recognize autogenerated files. + # If it's not, please let us know. + # "/" will be replaced by current OS file path separator to properly work on Windows. + # Default: [] + exclude-files: + - ".*\\.pb\\.go" + - ".*\\.gen\\.go" + - ".*_bpfeb\\.go" + - ".*_bpfel\\.go$" + - ".*bpfeb\\.go" + - ".*bpfel\\.go$" + - ".*/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go" + exclude-dirs: + - bpf/kmesh/bpf2go/dualengine + - bpf/kmesh/bpf2go/kernelnative + exclude-rules: + # Exclude some linters from running on test files. + - path: _test\.go$|^tests/|^samples/ + linters: + - errcheck + - maligned + - path: _test\.go$ + text: "dot-imports: should not use dot imports" + # We need to use the deprecated module since the jsonpb replacement is not backwards compatible. + - linters: + - staticcheck + text: "SA1019: package github.com/golang/protobuf/jsonpb" + - linters: + - staticcheck + text: 'SA1019: "github.com/golang/protobuf/jsonpb"' + # This is not helpful. The new function is not very usable and the current function will not be removed + - linters: + - staticcheck + text: 'SA1019: grpc.Dial is deprecated: use NewClient instead' + - linters: + - staticcheck + text: 'SA1019: grpc.DialContext is deprecated: use NewClient instead' + - linters: + - staticcheck + text: "SA1019: grpc.WithBlock is deprecated" + - linters: + - staticcheck + text: "SA1019: grpc.FailOnNonTempDialError" + - linters: + - staticcheck + text: "SA1019: grpc.WithReturnConnectionError" + # Independently from option `exclude` we use default exclude patterns, + # it can be disabled by this option. To list all + # excluded by default patterns execute `golangci-lint run --help`. + # Default value for this option is true. + exclude-use-default: true + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues: 0 diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 898b3a32b..01aa10494 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -84,7 +84,7 @@ issues: - ".*_bpfel\\.go$" - ".*bpfeb\\.go" - ".*bpfel\\.go$" - - bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go + - ".*/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go" exclude-dirs: - bpf/kmesh/bpf2go/dualengine - bpf/kmesh/bpf2go/kernelnative From 0a80f129f0b589639b9c096b0907eacf18f1c802 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 6 Nov 2024 11:26:50 +0800 Subject: [PATCH 16/19] update Signed-off-by: lec-bit --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6fdd8117..83643d8e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,9 +49,8 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: - args: "--config=.golangci.yaml --out-format colored-line-number --verbose" + args: "--config=common/config/.golangci.yaml --out-format colored-line-number --verbose" skip-pkg-cache: true - working-directory: . - name: Go Test run: | From 3045fbda66e236325883e633257fb53da3585c42 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 6 Nov 2024 14:27:59 +0800 Subject: [PATCH 17/19] update Signed-off-by: lec-bit --- .github/workflows/main.yml | 2 +- common/config/.golangci.yaml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 83643d8e8..aa60c37d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: # Since requiring code generated by the Proto compilation, execute go lint after building. - name: golangci-lint - uses: golangci/golangci-lint-action@v3.7.0 + uses: golangci/golangci-lint-action@v6.0.0 with: args: "--config=common/config/.golangci.yaml --out-format colored-line-number --verbose" skip-pkg-cache: true diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 01aa10494..789d3ef0e 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -78,16 +78,17 @@ issues: # "/" will be replaced by current OS file path separator to properly work on Windows. # Default: [] exclude-files: - - ".*\\.pb\\.go" - - ".*\\.gen\\.go" - ".*_bpfeb\\.go" - ".*_bpfel\\.go$" - ".*bpfeb\\.go" - ".*bpfel\\.go$" - - ".*/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go" + - ".*/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel\\.go" + - "bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel\\.go" + - ".*kmeshsockops_bpfel\\.go" + - bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go exclude-dirs: - bpf/kmesh/bpf2go/dualengine - - bpf/kmesh/bpf2go/kernelnative + - bpf/kmesh/bpf2go/kernelnative/enhanced exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ @@ -97,6 +98,9 @@ issues: - path: _test\.go$ text: "dot-imports: should not use dot imports" # We need to use the deprecated module since the jsonpb replacement is not backwards compatible. + - path: kmeshsockops_bpfel\.go$ + linters: + - errcheck - linters: - staticcheck text: "SA1019: package github.com/golang/protobuf/jsonpb" From 3401b9839fae1d378bccf75f8065688dee9737ea Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 6 Nov 2024 17:50:23 +0800 Subject: [PATCH 18/19] update Signed-off-by: lec-bit --- .github/workflows/main.yml | 5 +++++ common/config/.golangci.yaml | 11 ----------- hack/golangci-lint-prepare.sh | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 11 deletions(-) create mode 100755 hack/golangci-lint-prepare.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa60c37d6..5a60716d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,11 @@ jobs: run: | echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/mk" >> $GITHUB_ENV + # Some files such as sockops_bpfel.go require some preprocessing + - name: golangci-lint prepare + run: | + ./hack/golangci-lint-prepare.sh + # Since requiring code generated by the Proto compilation, execute go lint after building. - name: golangci-lint uses: golangci/golangci-lint-action@v6.0.0 diff --git a/common/config/.golangci.yaml b/common/config/.golangci.yaml index 789d3ef0e..ca92eb895 100644 --- a/common/config/.golangci.yaml +++ b/common/config/.golangci.yaml @@ -81,14 +81,6 @@ issues: - ".*_bpfeb\\.go" - ".*_bpfel\\.go$" - ".*bpfeb\\.go" - - ".*bpfel\\.go$" - - ".*/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel\\.go" - - "bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel\\.go" - - ".*kmeshsockops_bpfel\\.go" - - bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go - exclude-dirs: - - bpf/kmesh/bpf2go/dualengine - - bpf/kmesh/bpf2go/kernelnative/enhanced exclude-rules: # Exclude some linters from running on test files. - path: _test\.go$|^tests/|^samples/ @@ -98,9 +90,6 @@ issues: - path: _test\.go$ text: "dot-imports: should not use dot imports" # We need to use the deprecated module since the jsonpb replacement is not backwards compatible. - - path: kmeshsockops_bpfel\.go$ - linters: - - errcheck - linters: - staticcheck text: "SA1019: package github.com/golang/protobuf/jsonpb" diff --git a/hack/golangci-lint-prepare.sh b/hack/golangci-lint-prepare.sh new file mode 100755 index 000000000..95383f9aa --- /dev/null +++ b/hack/golangci-lint-prepare.sh @@ -0,0 +1,24 @@ +#!/bin/bash +ROOT_DIR=$(git rev-parse --show-toplevel) + +TARGET_DIR="$ROOT_DIR/bpf/kmesh/bpf2go/kernelnative/enhanced" + +FILES=( + "kmeshsockops_bpfel.o" + "kmeshsockops_bpfeb.o" + "kmeshsockopscompat_bpfeb.o" + "kmeshsockopscompat_bpfel.o" + "kmeshtracepoint_bpfeb.o" + "kmeshtracepoint_bpfel.o" + "kmeshtracepointcompat_bpfeb.o" + "kmeshtracepointcompat_bpfel.o" +) + +mkdir -p "$TARGET_DIR" + +for FILE in "${FILES[@]}"; do + touch "$TARGET_DIR/$FILE" +done + +echo "All files have been created in $TARGET_DIR." + From 37e78d69c09e551d9771717774e7e80374e31010 Mon Sep 17 00:00:00 2001 From: lec-bit Date: Wed, 6 Nov 2024 18:48:20 +0800 Subject: [PATCH 19/19] update Signed-off-by: lec-bit --- pkg/bpf/ads/sock_connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/bpf/ads/sock_connection.go b/pkg/bpf/ads/sock_connection.go index d83ed1ee5..607752463 100644 --- a/pkg/bpf/ads/sock_connection.go +++ b/pkg/bpf/ads/sock_connection.go @@ -28,7 +28,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/kernelnative/normal" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/kernelnative/normal" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/utils" helper "kmesh.net/kmesh/pkg/utils"