From 53313ab58ff4bc0759de591d6aca91b52eee4f73 Mon Sep 17 00:00:00 2001 From: yinbin6 Date: Thu, 11 Jul 2024 11:26:21 +0800 Subject: [PATCH] sync cleancode: rename gazelle files in lwip (cherry picked from commit bda9661a9cf7201e26dbc5dd31ed812409872460) --- ...ncode-improving-makefile-readability.patch | 1154 +++++++++++++++++ 0214-add-.gitignore.patch | 50 + ...eancode-rename-gazelle-files-in-lwip.patch | 489 +++++++ gazelle.spec | 10 +- 4 files changed, 1702 insertions(+), 1 deletion(-) create mode 100644 0213-cleancode-improving-makefile-readability.patch create mode 100644 0214-add-.gitignore.patch create mode 100644 0215-cleancode-rename-gazelle-files-in-lwip.patch diff --git a/0213-cleancode-improving-makefile-readability.patch b/0213-cleancode-improving-makefile-readability.patch new file mode 100644 index 0000000..4482934 --- /dev/null +++ b/0213-cleancode-improving-makefile-readability.patch @@ -0,0 +1,1154 @@ +From 871a94d0abdf14efb9dfe42b711acc37d842ce6d Mon Sep 17 00:00:00 2001 +From: Lemmy Huang +Date: Mon, 8 Jul 2024 20:35:10 +0800 +Subject: [PATCH] cleancode: improving makefile readability + +Signed-off-by: Lemmy Huang +--- + build/build.sh | 8 +- + src/common/dir.mk | 13 --- + src/lstack/Makefile | 92 +++++++-------- + src/lstack/Printlog.mk | 14 +++ + src/lstack/api/dir.mk | 14 --- + src/lstack/api/lstack_epoll.c | 4 +- + src/lstack/api/lstack_rtw_api.c | 2 +- + src/lstack/api/lstack_signal.c | 4 +- + src/lstack/api/lstack_wrap.c | 3 +- + src/lstack/core/dir.mk | 13 --- + src/lstack/core/lstack_cfg.c | 5 +- + src/lstack/core/lstack_control_plane.c | 4 +- + src/lstack/core/lstack_dpdk.c | 3 +- + src/lstack/core/lstack_init.c | 5 +- + src/lstack/core/lstack_lwip.c | 4 +- + src/lstack/core/lstack_preload.c | 1 - + src/lstack/core/lstack_protocol_stack.c | 6 +- + src/lstack/core/lstack_stack_stat.c | 4 +- + src/lstack/include/lstack_cfg.h | 2 +- + src/lstack/include/lstack_dpdk.h | 4 +- + src/lstack/include/lstack_fault_inject.h | 2 + + src/lstack/include/lstack_lwip.h | 2 +- + src/lstack/include/lstack_protocol_stack.h | 4 +- + src/lstack/include/posix/lstack_epoll.h | 4 +- + src/lstack/netif/dir.mk | 15 --- + src/lstack/netif/lstack_ethdev.c | 2 +- + src/lstack/netif/lstack_fault_inject.c | 4 + + src/lstack/netif/lstack_flow.c | 2 +- + src/lstack/netif/lstack_tx_cache.c | 2 +- + src/lstack/netif/lstack_vdev.c | 4 +- + src/ltran/CMakeLists.txt | 127 ++++++++++++--------- + src/ltran/ltran_base.h | 2 +- + src/ltran/ltran_dfx.c | 2 +- + src/ltran/ltran_ethdev.c | 6 +- + src/ltran/ltran_ethdev.h | 2 +- + src/ltran/ltran_forward.c | 2 +- + src/ltran/ltran_instance.c | 6 +- + src/ltran/ltran_instance.h | 4 +- + src/ltran/ltran_monitor.c | 4 +- + src/ltran/ltran_param.c | 4 +- + src/ltran/ltran_param.h | 2 +- + src/ltran/ltran_stack.c | 2 +- + src/ltran/ltran_stat.c | 4 +- + src/ltran/ltran_stat.h | 2 +- + src/ltran/ltran_tcp_conn.h | 2 +- + src/ltran/ltran_tcp_sock.c | 2 +- + src/ltran/ltran_tcp_sock.h | 2 +- + src/ltran/main.c | 2 +- + 48 files changed, 200 insertions(+), 223 deletions(-) + delete mode 100644 src/common/dir.mk + create mode 100644 src/lstack/Printlog.mk + delete mode 100644 src/lstack/api/dir.mk + delete mode 100644 src/lstack/core/dir.mk + delete mode 100644 src/lstack/netif/dir.mk + +diff --git a/build/build.sh b/build/build.sh +index 622e1cc..ed6d444 100755 +--- a/build/build.sh ++++ b/build/build.sh +@@ -12,8 +12,10 @@ + export CURRENT_PATH=$(dirname $(readlink -f ${BASH_SOURCE[0]})) + cd $CURRENT_PATH + ++cpu_num=8 ++ + make -C ../src/lstack clean +-make -C ../src/lstack ++make -C ../src/lstack -j${cpu_num} + if [ $? -ne 0 ]; then + echo "build lstack failed" + exit 1 +@@ -24,7 +26,7 @@ rm -f CMakeCache.txt + rm -f ltran gazellectl + rm -rf CMakeFiles + cmake . +-make ++make -j${cpu_num} + if [ $? -ne 0 ]; then + echo "build ltran failed" + exit 1 +@@ -33,7 +35,7 @@ fi + cd - + cd ../examples + cmake . +-make ++make -j${cpu_num} + if [ $? -ne 0 ]; then + echo "build examples failed" + exit 1 +diff --git a/src/common/dir.mk b/src/common/dir.mk +deleted file mode 100644 +index 68a2b72..0000000 +--- a/src/common/dir.mk ++++ /dev/null +@@ -1,13 +0,0 @@ +-# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. +-# gazelle is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +- +-SRC = dpdk_common.c gazelle_parse_config.c +-$(eval $(call register_dir, ../common, $(SRC))) +- +diff --git a/src/lstack/Makefile b/src/lstack/Makefile +index ace33bd..dd4e2c4 100644 +--- a/src/lstack/Makefile ++++ b/src/lstack/Makefile +@@ -7,40 +7,28 @@ + # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + # PURPOSE. + # See the Mulan PSL v2 for more details. +-LSTACK_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +-ROOT_DIR := $(dir $(abspath $(LSTACK_DIR))) ++ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) ++ ++include $(ROOT_DIR)/Printlog.mk + +-LWIP_INCLUDE_FILE ?= /usr/include/lwip + LIB_PATH ?= /usr/lib64 ++LWIP_INCLUDE_DIR ?= /usr/include/lwip + + DPDK_VERSION := $(shell rpm -q --queryformat '%{VERSION}' dpdk) + ifeq ($(DPDK_VERSION),21.11) +- DPDK_INCLUDE_FILE := /usr/local/include ++ DPDK_INCLUDE_DIR := /usr/local/include + else +- DPDK_INCLUDE_FILE := /usr/include/dpdk ++ DPDK_INCLUDE_DIR := /usr/include/dpdk + endif + + AR = ar + ARFLAGS = crDP + CC ?= gcc +-OPTIMIZATION = -O2 -g + RM = rm -f +-LDFLAGS = -shared -ldl -lm -lpthread -lrt -lnuma -lconfig -lboundscheck + ARCH := $(shell uname -m) + +-ifneq ($(CC),clang) +- SEC_FLAGS = -fstack-protector-strong -Werror -Wall -Wno-deprecated-declarations -Wl,-z,relro, -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIC -D_FORTIFY_SOURCE=2 +-else +- SEC_FLAGS = -fstack-protector-strong -Werror -Wall -Wno-deprecated-declarations -fPIC +-endif +-$(info $(CC):$(SEC_FLAGS)) +- +-INC = -I$(LSTACK_DIR)/include \ +- -I$(LSTACK_DIR)/../common \ +- -I$(LWIP_INCLUDE_FILE) \ +- -I$(DPDK_INCLUDE_FILE) +- +-CFLAGS += $(OPTIMIZATION) -fno-strict-aliasing $(INC) -Wno-error=unused-function ++CFLAGS = -O2 -g ++LDFLAGS = -shared -ldl -lm -lpthread -lrt -lnuma -lconfig -lboundscheck + + ifeq ($(GAZELLE_COVERAGE_ENABLE), 1) + LDFLAGS += -fprofile-arcs -ftest-coverage +@@ -48,7 +36,6 @@ ifeq ($(GAZELLE_COVERAGE_ENABLE), 1) + endif + + ifeq ($(GAZELLE_FAULT_INJECT_ENABLE), 1) +- LDFLAGS += -DGAZELLE_FAULT_INJECT_ENABLE + CFLAGS += -DGAZELLE_FAULT_INJECT_ENABLE + endif + +@@ -56,19 +43,21 @@ ifeq ($(shell $(CC) -dumpmachine | cut -d"-" -f1), x86_64) + CFLAGS += -mssse3 + endif + +-CFLAGS += $(SEC_FLAGS) +- +-SRCS = +-DIRS = core netif api ../common ++SEC_FLAGS = -Wall -Werror -fstack-protector-strong -Wno-deprecated-declarations -fPIC ++ifneq ($(CC),clang) ++ SEC_FLAGS += -Wl,-z,relro, -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -D_FORTIFY_SOURCE=2 ++endif + +-define register_dir +-SRCS += $(patsubst %, $(1)/%, $(2)) +-endef ++INC = -I$(ROOT_DIR)/include \ ++ -I$(ROOT_DIR)/../ \ ++ -I$(LWIP_INCLUDE_DIR) \ ++ -I$(DPDK_INCLUDE_DIR) + +-include $(patsubst %, %/dir.mk, $(DIRS)) ++CFLAGS += -fno-strict-aliasing -Wno-error=unused-function ++CFLAGS += -D__USE_GNU=1 -D_GNU_SOURCE=1 ++CFLAGS += $(SEC_FLAGS) ++CFLAGS += $(INC) + +-# Linking object and library +-OBJS = $(subst .c,.o,$(SRCS)) + + LWIP_LIB = $(LIB_PATH)/liblwip.a + LIBRTE_LIB = $(LIB_PATH)/librte_pci.so \ +@@ -98,9 +87,9 @@ ifeq ($(DPDK_VERSION), 19.11) + $(LIB_PATH)/librte_pmd_hinic.so \ + $(LIB_PATH)/librte_pmd_ixgbe.so \ + $(LIB_PATH)/librte_pmd_virtio.so +- ifneq ($(ARCH), loongarch64) +- LIBRTE_LIB += $(LIB_PATH)/librte_pmd_i40e.so +- endif ++ ifneq ($(ARCH), loongarch64) ++ LIBRTE_LIB += $(LIB_PATH)/librte_pmd_i40e.so ++ endif + else + LIBRTE_LIB += $(LIB_PATH)/librte_net_pcap.so \ + $(LIB_PATH)/librte_net_bond.so \ +@@ -109,31 +98,38 @@ else + $(LIB_PATH)/librte_net_virtio.so \ + $(LIB_PATH)/librte_telemetry.so \ + $(LIB_PATH)/librte_pcapng.so +- ifeq ($(filter loongarch64 riscv64, $(ARCH)),) +- LIBRTE_LIB += $(LIB_PATH)/librte_net_i40e.so +- endif ++ ifeq ($(filter loongarch64 riscv64, $(ARCH)),) ++ LIBRTE_LIB += $(LIB_PATH)/librte_net_i40e.so ++ endif + endif + + DEP_LIBS = $(LWIP_LIB) $(LIBRTE_LIB) ++$(info $(CC):$(DEP_LIBS)) ++ ++SRCS = $(wildcard ./api/*.c ./core/*.c ./netif/*.c ../common/*.c) ++# Linking object and library ++OBJS = $(subst .c,.o,$(SRCS)) ++ + LDFLAGS += -Wl,--whole-archive $(DEP_LIBS) $(OBJS) -Wl,--no-whole-archive + ++$(info [CFLAGS] $(CFLAGS)) ++$(info [LDFLAGS] $(LDFLAGS)) ++ + # Target + LSTACK_SHARED_LIB = liblstack.so + LSTACK_STATIC_LIB = liblstack.a + +-.PHONY: all ++.PHONY: all clean + all: $(LSTACK_SHARED_LIB) + +-depend: .depend +- +-.depend: $(SRCS) +- rm -f ./.depend +- $(foreach SRC,$(SRCS),$(CC) $(CFLAGS) -MM -MT $(SRC:.c=.o) $(SRC) >> .depend;) +- +--include .depend +- + $(LSTACK_SHARED_LIB): $(OBJS) +- $(CC) $(LDFLAGS) -Wl,--whole-archive -Wl,--no-whole-archive -o $@ ++ $(call printlog, BUILD, $@) ++ $(QUIET) $(CC) $(LDFLAGS) -o $@ ++ ++%.o: %.c ++ $(call printlog, BUILD, $@) ++ $(QUIET) $(CC) $(CFLAGS) -c $(filter %.c,$^) -o $@ + + clean: +- $(RM) $(LSTACK_SHARED_LIB) $(OBJS) .depend ++ $(call printlog, CLEAN, $(LSTACK_SHARED_LIB)) ++ $(QUIET) $(RM) $(LSTACK_SHARED_LIB) $(OBJS) +diff --git a/src/lstack/Printlog.mk b/src/lstack/Printlog.mk +new file mode 100644 +index 0000000..7604851 +--- /dev/null ++++ b/src/lstack/Printlog.mk +@@ -0,0 +1,14 @@ ++ ++ROOT_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) ++ ++ifeq ($(V),1) ++ QUIET = ++ printlog = ++else ++ QUIET = @ ++ printlog = @printf ' %-8s %s%s\n' \ ++ "$(1)" \ ++ "$(patsubst $(ROOT_DIR)/%,%,$(2))" \ ++ "$(if $(3), $(3))"; ++ MAKEFLAGS += --no-print-directory ++endif +diff --git a/src/lstack/api/dir.mk b/src/lstack/api/dir.mk +deleted file mode 100644 +index 729690d..0000000 +--- a/src/lstack/api/dir.mk ++++ /dev/null +@@ -1,14 +0,0 @@ +-# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. +-# gazelle is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +- +-SRC = lstack_epoll.c lstack_signal.c lstack_fork.c lstack_wrap.c lstack_rtw_api.c lstack_rtc_api.c lstack_dummy_api.c +- +-$(eval $(call register_dir, api, $(SRC))) +- +diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c +index 2ac7150..9c0aef7 100644 +--- a/src/lstack/api/lstack_epoll.c ++++ b/src/lstack/api/lstack_epoll.c +@@ -31,8 +31,8 @@ + #include "lstack_stack_stat.h" + #include "lstack_cfg.h" + #include "lstack_log.h" +-#include "dpdk_common.h" +-#include "gazelle_base_func.h" ++#include "common/dpdk_common.h" ++#include "common/gazelle_base_func.h" + #include "lstack_lwip.h" + #include "lstack_protocol_stack.h" + #include "posix/lstack_epoll.h" +diff --git a/src/lstack/api/lstack_rtw_api.c b/src/lstack/api/lstack_rtw_api.c +index e50fe37..e43be59 100644 +--- a/src/lstack/api/lstack_rtw_api.c ++++ b/src/lstack/api/lstack_rtw_api.c +@@ -22,7 +22,7 @@ + #include "lstack_protocol_stack.h" + #include "lstack_cfg.h" + #include "lstack_lwip.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_rtw_api.h" + + +diff --git a/src/lstack/api/lstack_signal.c b/src/lstack/api/lstack_signal.c +index 314c14c..3dd5d03 100644 +--- a/src/lstack/api/lstack_signal.c ++++ b/src/lstack/api/lstack_signal.c +@@ -18,9 +18,9 @@ + #include + #include + +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_cfg.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_log.h" + #include "lstack_control_plane.h" + +diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c +index 7101d98..3a60cbb 100644 +--- a/src/lstack/api/lstack_wrap.c ++++ b/src/lstack/api/lstack_wrap.c +@@ -10,7 +10,6 @@ + * See the Mulan PSL v2 for more details. + */ + +-#define _GNU_SOURCE + #include + #include + #include +@@ -31,7 +30,7 @@ + #include "lstack_log.h" + #include "lstack_cfg.h" + #include "lstack_lwip.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_preload.h" + + #include "lstack_rtc_api.h" +diff --git a/src/lstack/core/dir.mk b/src/lstack/core/dir.mk +deleted file mode 100644 +index 21b0d22..0000000 +--- a/src/lstack/core/dir.mk ++++ /dev/null +@@ -1,13 +0,0 @@ +-# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. +-# gazelle is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +- +-SRC = lstack_preload.c lstack_init.c lstack_cfg.c lstack_dpdk.c lstack_control_plane.c lstack_stack_stat.c lstack_lwip.c lstack_protocol_stack.c lstack_thread_rpc.c lstack_virtio.c lstack_port_map.c +-$(eval $(call register_dir, core, $(SRC))) +- +diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c +index a165cdb..4bc4217 100644 +--- a/src/lstack/core/lstack_cfg.c ++++ b/src/lstack/core/lstack_cfg.c +@@ -10,7 +10,6 @@ + * See the Mulan PSL v2 for more details. + */ + +-#define _GNU_SOURCE + #include + #include + #include +@@ -29,9 +28,9 @@ + #include + #include + +-#include "gazelle_reg_msg.h" ++#include "common/gazelle_reg_msg.h" ++#include "common/gazelle_base_func.h" + #include "lstack_log.h" +-#include "gazelle_base_func.h" + #include "lstack_cfg.h" + + #define DEFAULT_CONF_FILE "/etc/gazelle/lstack.conf" +diff --git a/src/lstack/core/lstack_control_plane.c b/src/lstack/core/lstack_control_plane.c +index 04858c7..4ab12f6 100644 +--- a/src/lstack/core/lstack_control_plane.c ++++ b/src/lstack/core/lstack_control_plane.c +@@ -26,8 +26,8 @@ + + #include "lstack_cfg.h" + #include "lstack_dpdk.h" +-#include "gazelle_reg_msg.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_reg_msg.h" ++#include "common/gazelle_base_func.h" + #include "lstack_stack_stat.h" + #include "lstack_log.h" + #include "lstack_thread_rpc.h" +diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c +index 2de41e3..583bb09 100644 +--- a/src/lstack/core/lstack_dpdk.c ++++ b/src/lstack/core/lstack_dpdk.c +@@ -10,7 +10,6 @@ + * See the Mulan PSL v2 for more details. + */ + +-#define _GNU_SOURCE + #include + #include + #include +@@ -44,7 +43,7 @@ + #include + + #include "lstack_log.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_protocol_stack.h" + #include "lstack_thread_rpc.h" + #include "lstack_lwip.h" +diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c +index c2499d7..d97b218 100644 +--- a/src/lstack/core/lstack_init.c ++++ b/src/lstack/core/lstack_init.c +@@ -10,7 +10,6 @@ + * See the Mulan PSL v2 for more details. + */ + +-#define _GNU_SOURCE + #include + #include + #include +@@ -41,10 +40,10 @@ + #include "lstack_dpdk.h" + #include "lstack_stack_stat.h" + #include "lstack_log.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "posix/lstack_epoll.h" + #include "posix/lstack_unistd.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_protocol_stack.h" + #include "lstack_preload.h" + #include "lstack_wrap.h" +diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c +index 3728100..6e50e4d 100644 +--- a/src/lstack/core/lstack_lwip.c ++++ b/src/lstack/core/lstack_lwip.c +@@ -27,7 +27,7 @@ + #include + #include + +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_ethdev.h" + #include "lstack_protocol_stack.h" + #include "lstack_log.h" +@@ -35,7 +35,7 @@ + #include "lstack_stack_stat.h" + #include "posix/lstack_epoll.h" + #include "lstack_thread_rpc.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_cfg.h" + #include "lstack_lwip.h" + +diff --git a/src/lstack/core/lstack_preload.c b/src/lstack/core/lstack_preload.c +index 1d68501..f7caef5 100644 +--- a/src/lstack/core/lstack_preload.c ++++ b/src/lstack/core/lstack_preload.c +@@ -12,7 +12,6 @@ + #include + #include + #include +-#define __USE_GNU + #include + #include + +diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c +index e272a04..1983c0b 100644 +--- a/src/lstack/core/lstack_protocol_stack.c ++++ b/src/lstack/core/lstack_protocol_stack.c +@@ -9,7 +9,7 @@ + * PURPOSE. + * See the Mulan PSL v2 for more details. + */ +-#define _GNU_SOURCE ++ + #include + #include + +@@ -22,9 +22,9 @@ + #include + #include + +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "lstack_thread_rpc.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_log.h" + #include "lstack_dpdk.h" + #include "lstack_ethdev.h" +diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c +index 1e32c45..423be81 100644 +--- a/src/lstack/core/lstack_stack_stat.c ++++ b/src/lstack/core/lstack_stack_stat.c +@@ -22,8 +22,8 @@ + #include "posix_api.h" + #include "lstack_control_plane.h" + #include "lstack_log.h" +-#include "dpdk_common.h" +-#include "gazelle_dfx_msg.h" ++#include "common/dpdk_common.h" ++#include "common/gazelle_dfx_msg.h" + #include "lstack_thread_rpc.h" + #include "lstack_protocol_stack.h" + #include "posix/lstack_epoll.h" +diff --git a/src/lstack/include/lstack_cfg.h b/src/lstack/include/lstack_cfg.h +index a15088a..4fc99f3 100644 +--- a/src/lstack/include/lstack_cfg.h ++++ b/src/lstack/include/lstack_cfg.h +@@ -20,7 +20,7 @@ + #include + + #include "lstack_protocol_stack.h" +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + #define BASE_BIN_SCALE 2 + #define BASE_OCT_SCALE 8 +diff --git a/src/lstack/include/lstack_dpdk.h b/src/lstack/include/lstack_dpdk.h +index dff1e44..91af3c5 100644 +--- a/src/lstack/include/lstack_dpdk.h ++++ b/src/lstack/include/lstack_dpdk.h +@@ -14,8 +14,8 @@ + #define _GAZELLE_DPDK_H_ + + #include +-#include "gazelle_opt.h" +-#include "gazelle_dfx_msg.h" ++#include "common/gazelle_opt.h" ++#include "common/gazelle_dfx_msg.h" + + #define RXTX_CACHE_SZ (VDEV_RX_QUEUE_SZ) + +diff --git a/src/lstack/include/lstack_fault_inject.h b/src/lstack/include/lstack_fault_inject.h +index afd8faf..a65c61f 100644 +--- a/src/lstack/include/lstack_fault_inject.h ++++ b/src/lstack/include/lstack_fault_inject.h +@@ -15,6 +15,8 @@ + + #include + ++#include "common/gazelle_dfx_msg.h" ++ + int32_t handle_fault_inject_cmd(int32_t sockfd, struct gazelle_fault_inject_data inject, enum GAZELLE_STAT_MODE stat_mode); + + #endif /* __GAZELLE_INJECT_H__ */ +diff --git a/src/lstack/include/lstack_lwip.h b/src/lstack/include/lstack_lwip.h +index 85c9c20..0b952ec 100644 +--- a/src/lstack/include/lstack_lwip.h ++++ b/src/lstack/include/lstack_lwip.h +@@ -14,7 +14,7 @@ + #define __GAZELLE_LWIP_H__ + #include + +-#include "gazelle_dfx_msg.h" ++#include "common/gazelle_dfx_msg.h" + + #define NETCONN_IS_ACCEPTIN(sock) (((sock)->conn->acceptmbox != NULL) && !sys_mbox_empty((sock)->conn->acceptmbox)) + #define NETCONN_IS_DATAIN(sock) ((gazelle_ring_readable_count((sock)->recv_ring) || (sock)->recv_lastdata) || (sock->same_node_rx_ring != NULL && same_node_ring_count(sock))) +diff --git a/src/lstack/include/lstack_protocol_stack.h b/src/lstack/include/lstack_protocol_stack.h +index 6ca4f14..5b04c6d 100644 +--- a/src/lstack/include/lstack_protocol_stack.h ++++ b/src/lstack/include/lstack_protocol_stack.h +@@ -20,11 +20,11 @@ + #include + #include + +-#include "gazelle_dfx_msg.h" ++#include "common/gazelle_opt.h" ++#include "common/gazelle_dfx_msg.h" + #include "lstack_thread_rpc.h" + #include "lstack_ethdev.h" + #include "lstack_tx_cache.h" +-#include "gazelle_opt.h" + + #define SOCK_RECV_RING_SIZE (get_global_cfg_params()->recv_ring_size) + #define SOCK_RECV_FREE_THRES (32) +diff --git a/src/lstack/include/posix/lstack_epoll.h b/src/lstack/include/posix/lstack_epoll.h +index a7164f4..77b6ebb 100644 +--- a/src/lstack/include/posix/lstack_epoll.h ++++ b/src/lstack/include/posix/lstack_epoll.h +@@ -20,8 +20,8 @@ + + #include + +-#include "gazelle_dfx_msg.h" +-#include "gazelle_opt.h" ++#include "common/gazelle_dfx_msg.h" ++#include "common/gazelle_opt.h" + + #ifdef __cplusplus + extern "C" { +diff --git a/src/lstack/netif/dir.mk b/src/lstack/netif/dir.mk +deleted file mode 100644 +index b551041..0000000 +--- a/src/lstack/netif/dir.mk ++++ /dev/null +@@ -1,15 +0,0 @@ +-# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. +-# gazelle is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +- +-SRC = lstack_ethdev.c lstack_vdev.c lstack_flow.c lstack_tx_cache.c +-ifeq ($(GAZELLE_FAULT_INJECT_ENABLE), 1) +- SRC += lstack_fault_inject.c +-endif +-$(eval $(call register_dir, netif, $(SRC))) +diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c +index 933c3e8..e23d313 100644 +--- a/src/lstack/netif/lstack_ethdev.c ++++ b/src/lstack/netif/lstack_ethdev.c +@@ -24,7 +24,7 @@ + + #include + +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_cfg.h" + #include "lstack_vdev.h" + #include "lstack_stack_stat.h" +diff --git a/src/lstack/netif/lstack_fault_inject.c b/src/lstack/netif/lstack_fault_inject.c +index 4edc6cc..4736e29 100644 +--- a/src/lstack/netif/lstack_fault_inject.c ++++ b/src/lstack/netif/lstack_fault_inject.c +@@ -20,6 +20,9 @@ + #include "lstack_log.h" + #include "lstack_vdev.h" + ++#ifdef GAZELLE_FAULT_INJECT_ENABLE ++#include "lstack_fault_inject.h" ++ + #define INJECT_MODULO 1000 /* used in modulus operator */ + #define INJECT_US_TO_MS 1000 /* transefer time unit us to ms */ + +@@ -371,3 +374,4 @@ int32_t handle_fault_inject_cmd(int32_t sockfd, struct gazelle_fault_inject_data + return inject_set_cmd(sockfd, inject); + } + ++#endif /* GAZELLE_FAULT_INJECT_ENABLE */ +diff --git a/src/lstack/netif/lstack_flow.c b/src/lstack/netif/lstack_flow.c +index 9e8792c..84497dc 100644 +--- a/src/lstack/netif/lstack_flow.c ++++ b/src/lstack/netif/lstack_flow.c +@@ -22,7 +22,7 @@ + #include + #include + +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_log.h" + #include "lstack_dpdk.h" + #include "lstack_cfg.h" +diff --git a/src/lstack/netif/lstack_tx_cache.c b/src/lstack/netif/lstack_tx_cache.c +index ac5a9db..cda0003 100644 +--- a/src/lstack/netif/lstack_tx_cache.c ++++ b/src/lstack/netif/lstack_tx_cache.c +@@ -15,7 +15,7 @@ + #include "lwip/sockets.h" + #include "lstack_ethdev.h" + #include "lstack_log.h" +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + #include "lstack_protocol_stack.h" + #include "lstack_tx_cache.h" + +diff --git a/src/lstack/netif/lstack_vdev.c b/src/lstack/netif/lstack_vdev.c +index 75e4acc..63f9e40 100644 +--- a/src/lstack/netif/lstack_vdev.c ++++ b/src/lstack/netif/lstack_vdev.c +@@ -29,9 +29,9 @@ + #include "lstack_ethdev.h" + #include "lstack_control_plane.h" + #include "lstack_log.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "lstack_protocol_stack.h" +-#include "gazelle_reg_msg.h" ++#include "common/gazelle_reg_msg.h" + #include "lstack_lwip.h" + #include "lstack_flow.h" + #include "lstack_vdev.h" +diff --git a/src/ltran/CMakeLists.txt b/src/ltran/CMakeLists.txt +index fee3a94..8e9b1ea 100644 +--- a/src/ltran/CMakeLists.txt ++++ b/src/ltran/CMakeLists.txt +@@ -12,25 +12,7 @@ cmake_minimum_required(VERSION 3.12.1) + project(ltran) + + set(COMMON_DIR ${PROJECT_SOURCE_DIR}/../common) +-set(LWIP_DIR /usr/include/lwip) +- +-set(CMAKE_VERBOSE_MAKEFILE ON) +-if (CMAKE_C_COMPILER_ID STREQUAL "GNU") +- set(CMAKE_C_FLAGS "-g -fstack-protector-strong -Wall -Werror -fPIE -pie -pthread -D_FORTIFY_SOURCE=2 -O2 -fPIC") +-elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") +- set(CMAKE_C_FLAGS "-O2 -g -fstack-protector-strong -Wall -Werror -fPIE -pthread") +-endif() +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D LTRAN_COMPILE") +- +-if($ENV{GAZELLE_COVERAGE_ENABLE}) +- message("Enable Coverage compile option") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs") +-endif($ENV{GAZELLE_COVERAGE_ENABLE}) +- +-if($ENV{GAZELLE_FAULT_INJECT_ENABLE}) +- message("Enable Fault inject option") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGAZELLE_FAULT_INJECT_ENABLE") +-endif($ENV{GAZELLE_FAULT_INJECT_ENABLE}) ++set(LWIP_INCLUDE_DIR /usr/include/lwip) + + execute_process( + COMMAND rpm -qa dpdk +@@ -40,62 +22,99 @@ execute_process( + string(REGEX MATCH "[0-9]+\\.[0-9]+" DPDK_VERSION ${DPDK_VERSION_FULL}) + + if (DPDK_VERSION STREQUAL "21.11") +- set(DPDK_DIR /usr/local/include/) ++ set(DPDK_INCLUDE_DIR /usr/local/include/) + else() +- set(DPDK_DIR /usr/include/dpdk) ++ set(DPDK_INCLUDE_DIR /usr/include/dpdk) ++endif() ++ ++ ++set(CMAKE_C_FLAGS "-O2 -g") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLTRAN_COMPILE -D_GNU_SOURCE -fno-strict-aliasing") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fstack-protector-strong -fPIE") ++if (CMAKE_C_COMPILER_ID STREQUAL "GNU") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -D_FORTIFY_SOURCE=2 -fPIC") ++endif() ++ ++# gcc coredump in openEuler-20.03-LTS-XX aarch64 when add -march=native ++if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "sw_64|aarch64|ppc64le|riscv64" ) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -Wcast-align") + endif() + ++if($ENV{GAZELLE_COVERAGE_ENABLE}) ++ message("Enable Coverage compile option") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs") ++endif($ENV{GAZELLE_COVERAGE_ENABLE}) ++ ++if($ENV{GAZELLE_FAULT_INJECT_ENABLE}) ++ message("Enable Fault inject option") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGAZELLE_FAULT_INJECT_ENABLE") ++endif($ENV{GAZELLE_FAULT_INJECT_ENABLE}) ++ ++set(LTRAN_C_FLAGS -D__ARM_FEATURE_CRC32=1 ++ -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition ++ -Wpointer-arith -Wcast-qual -Wnested-externs -Wformat-nonliteral -Wformat-security -Wundef ++ -Wdeprecated -Wwrite-strings -Wno-implicit-fallthrough -Wno-error=deprecated-declarations) ++ ++set(DPDK_C_FLAGS -DRTE_MACHINE_CPUFLAG_NEON -DRTE_MACHINE_CPUFLAG_CRC32 ++ -DRTE_MACHINE_CPUFLAG_PMULL -DRTE_MACHINE_CPUFLAG_AES ++ -DRTE_MACHINE_CPUFLAG_SHA1 -DRTE_MACHINE_CPUFLAG_SHA2 ++ -include rte_config.h) ++ ++set(DPDK_LINK_FLAGS -Wl,-lrte_meter -Wl,-lrte_gro -Wl,-lrte_hash -Wl,-lrte_kvargs ++ -Wl,-lrte_mbuf -Wl,-lrte_ethdev -Wl,-lrte_net -Wl,-lrte_timer -Wl,-lrte_mempool ++ -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_pci -Wl,-lrte_cmdline ++ -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_pdump) ++ + if (DPDK_VERSION STREQUAL "19.11") +- set(DPDK_LINK_FLAGS "-Wl,-lrte_pmd_bond -Wl,-lrte_pmd_hinic -Wl,-lrte_pmd_ixgbe \ +- -Wl,-lrte_pmd_pcap -Wl,-lrte_pmd_virtio") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_hinic -Wl,-lrte_pmd_ixgbe ++ -Wl,-lrte_pmd_pcap -Wl,-lrte_pmd_virtio) + if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64") +- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lrte_pmd_i40e") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -Wl,-lrte_pmd_i40e) + endif() + else() +- set(DPDK_LINK_FLAGS "-Wl,-lrte_net_bond -Wl,-lrte_net_hinic -Wl,-lrte_net_ixgbe \ +- -Wl,-lpcap -Wl,-lrte_net_pcap -Wl,-lrte_net_virtio -Wl,-lrte_pcapng -Wl,-lrte_telemetry") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -Wl,-lrte_net_bond -Wl,-lrte_net_hinic -Wl,-lrte_net_ixgbe ++ -Wl,-lpcap -Wl,-lrte_net_pcap -Wl,-lrte_net_virtio -Wl,-lrte_pcapng -Wl,-lrte_telemetry) + if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64|riscv64") +- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lrte_net_i40e") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -Wl,-lrte_net_i40e) + endif() + endif() + + if (DPDK_VERSION GREATER_EQUAL 23.11) +- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -lrte_log -larchive -Wl,-lrte_eal") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -lrte_log -larchive -Wl,-lrte_eal) + else() +- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -lrte_kni -Wl,-Bstatic -lrte_eal -Wl,-Bdynamic") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -lrte_kni -Wl,-Bstatic -Wl,-lrte_eal -Wl,-Bdynamic) + if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc64le") +- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-larchive") ++ set(DPDK_LINK_FLAGS ${DPDK_LINK_FLAGS} -Wl,-larchive) + endif() + endif() + ++# compile info ++# set(CMAKE_VERBOSE_MAKEFILE ON) ++message("[CMAKE_C_FLAGS] ${CMAKE_C_FLAGS}") ++message("[LTRAN_C_FLAGS] ${LTRAN_C_FLAGS}") ++message("[DPDK_C_FLAGS ] ${DPDK_C_FLAGS}") ++message("[DPDK_LINK_FLAGS] ${DPDK_LINK_FLAGS}") ++ + add_executable(ltran main.c ltran_param.c ltran_config.c ltran_ethdev.c ltran_stat.c ltran_errno.c +- ltran_monitor.c ltran_instance.c ltran_stack.c ltran_tcp_conn.c ltran_tcp_sock.c +- ltran_forward.c ltran_timer.c ${COMMON_DIR}/gazelle_dfx_msg.c ${COMMON_DIR}/dpdk_common.c +- ${COMMON_DIR}/gazelle_parse_config.c) +- +-target_include_directories(ltran PRIVATE ${COMMON_DIR} ${PROJECT_SOURCE_DIR} ${LWIP_DIR} ${DPDK_DIR}) +-target_compile_options(ltran PRIVATE -fno-strict-aliasing -D__ARM_FEATURE_CRC32=1 -DRTE_MACHINE_CPUFLAG_NEON +- -DRTE_MACHINE_CPUFLAG_CRC32 -DRTE_MACHINE_CPUFLAG_PMULL -DRTE_MACHINE_CPUFLAG_AES +- -DRTE_MACHINE_CPUFLAG_SHA1 -DRTE_MACHINE_CPUFLAG_SHA2 -include rte_config.h +- -D_GNU_SOURCE -W -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition +- -Wpointer-arith -Wcast-qual -Wnested-externs -Wformat-nonliteral -Wformat-security -Wundef +- -Wdeprecated -Wwrite-strings -Wno-implicit-fallthrough -D_FORTIFY_SOURCE=2 -Wno-error=deprecated-declarations) ++ ltran_monitor.c ltran_instance.c ltran_stack.c ltran_tcp_conn.c ltran_tcp_sock.c ++ ltran_forward.c ltran_timer.c ++ ${COMMON_DIR}/gazelle_dfx_msg.c ++ ${COMMON_DIR}/dpdk_common.c ++ ${COMMON_DIR}/gazelle_parse_config.c) + +-# gcc coredump in openEuler-20.03-LTS-XX aarch64 when add -march=native +-if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "sw_64|aarch64|ppc64le|riscv64" ) +- target_compile_options(ltran PRIVATE -march=native -Wcast-align) +-endif() ++target_include_directories(ltran PRIVATE ${COMMON_DIR}/../ ${PROJECT_SOURCE_DIR} ${LWIP_INCLUDE_DIR} ${DPDK_INCLUDE_DIR}) + +-target_link_libraries(ltran PRIVATE config boundscheck rte_pdump -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines) ++# COMPILE_FLAGS and LINK_FLAGS are deprecated. ++target_compile_options(ltran PRIVATE ${LTRAN_C_FLAGS} ${DPDK_C_FLAGS}) ++target_link_options(ltran PRIVATE ++ -Wl,--whole-archive ${DPDK_LINK_FLAGS} -Wl,--no-whole-archive ++ -Wl,--as-needed -Wl,-export-dynamic ++ -Wl,-Map=ltran.map -Wl,--cref) ++target_link_libraries(ltran PRIVATE pthread config boundscheck ++ -Wl,-lm -Wl,-lrt -Wl,-lnuma -Wl,-ldl ++ -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines) + +-set_target_properties(ltran PROPERTIES LINK_FLAGS "-L$ENV{DPDK_LIB_PATH} -Wl,--no-whole-archive \ +- -Wl,-lrte_meter -Wl,--whole-archive -Wl,-lrte_gro -Wl,-lrte_hash -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ethdev \ +- -Wl,-lrte_net -Wl,-lrte_timer -Wl,-lrte_mempool -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_pci \ +- -Wl,-lrte_cmdline -Wl,-lrte_bus_pci\ +- -Wl,-lrte_bus_vdev ${DPDK_LINK_FLAGS} \ +- -Wl,--no-whole-archive -Wl,-lm -Wl,-lrt -Wl,-lnuma -Wl,-ldl -Wl,-export-dynamic -Wl,-export-dynamic \ +- -Wl,--as-needed -Wl,-export-dynamic -Wl,-Map=ltran.map -Wl,--cref") + + add_executable(gazellectl ltran_dfx.c ${COMMON_DIR}/gazelle_dfx_msg.c) +-target_include_directories(gazellectl PRIVATE $ENV{DPDK_INCLUDE_FILE} ${COMMON_DIR} ${DPDK_DIR}) ++target_include_directories(gazellectl PRIVATE ${COMMON_DIR}/../ ${DPDK_INCLUDE_DIR}) + target_link_libraries(gazellectl PRIVATE boundscheck -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack) +diff --git a/src/ltran/ltran_base.h b/src/ltran/ltran_base.h +index f174a40..9462fe5 100644 +--- a/src/ltran/ltran_base.h ++++ b/src/ltran/ltran_base.h +@@ -15,7 +15,7 @@ + + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + #define GAZELLE_CMD_BUFFER_SIZE _POSIX_ARG_MAX + #define GAZELLE_PATH_BUFFER_SIZE PATH_MAX +diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c +index cdcd7b3..005b09c 100644 +--- a/src/ltran/ltran_dfx.c ++++ b/src/ltran/ltran_dfx.c +@@ -30,7 +30,7 @@ + + #include "ltran_stat.h" + #include "ltran_base.h" +-#include "gazelle_dfx_msg.h" ++#include "common/gazelle_dfx_msg.h" + + /* seeing show_usage() */ + #define GAZELLE_TARGET_ARG_IDX 1 +diff --git a/src/ltran/ltran_ethdev.c b/src/ltran/ltran_ethdev.c +index 2f08d4a..68dc786 100644 +--- a/src/ltran/ltran_ethdev.c ++++ b/src/ltran/ltran_ethdev.c +@@ -30,13 +30,13 @@ + + #include + +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "ltran_param.h" + #include "ltran_log.h" + #include "ltran_base.h" +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + #include "ltran_errno.h" +-#include "gazelle_reg_msg.h" ++#include "common/gazelle_reg_msg.h" + + uint32_t g_bond_num = 0; + FILE* g_log_file = NULL; +diff --git a/src/ltran/ltran_ethdev.h b/src/ltran/ltran_ethdev.h +index f720c55..b84baae 100644 +--- a/src/ltran/ltran_ethdev.h ++++ b/src/ltran/ltran_ethdev.h +@@ -15,7 +15,7 @@ + + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + struct port_info { + uint16_t num_ports; +diff --git a/src/ltran/ltran_forward.c b/src/ltran/ltran_forward.c +index c49da89..c2f53d6 100644 +--- a/src/ltran/ltran_forward.c ++++ b/src/ltran/ltran_forward.c +@@ -28,7 +28,7 @@ + #include + #include + +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "ltran_instance.h" + #include "ltran_tcp_conn.h" + #include "ltran_tcp_sock.h" +diff --git a/src/ltran/ltran_instance.c b/src/ltran/ltran_instance.c +index fc5b0fb..428c1aa 100644 +--- a/src/ltran/ltran_instance.c ++++ b/src/ltran/ltran_instance.c +@@ -25,10 +25,10 @@ + #include "ltran_stat.h" + #include "ltran_log.h" + #include "ltran_base.h" +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + #include "ltran_errno.h" +-#include "gazelle_dfx_msg.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_dfx_msg.h" ++#include "common/gazelle_base_func.h" + #include "ltran_instance.h" + + volatile unsigned long g_tx_loop_count __rte_cache_aligned; +diff --git a/src/ltran/ltran_instance.h b/src/ltran/ltran_instance.h +index 2b888ec..f0fe580 100644 +--- a/src/ltran/ltran_instance.h ++++ b/src/ltran/ltran_instance.h +@@ -17,8 +17,8 @@ + #include + #include + +-#include "gazelle_opt.h" +-#include "gazelle_reg_msg.h" ++#include "common/gazelle_opt.h" ++#include "common/gazelle_reg_msg.h" + + struct gazelle_stack; + struct gazelle_instance { +diff --git a/src/ltran/ltran_monitor.c b/src/ltran/ltran_monitor.c +index 457e8c8..93ab2d5 100644 +--- a/src/ltran/ltran_monitor.c ++++ b/src/ltran/ltran_monitor.c +@@ -29,8 +29,8 @@ + #include "ltran_log.h" + #include "ltran_stat.h" + #include "ltran_instance.h" +-#include "gazelle_dfx_msg.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_dfx_msg.h" ++#include "common/gazelle_base_func.h" + #include "ltran_param.h" + #include "ltran_monitor.h" + +diff --git a/src/ltran/ltran_param.c b/src/ltran/ltran_param.c +index bd5a8e1..ad689f6 100644 +--- a/src/ltran/ltran_param.c ++++ b/src/ltran/ltran_param.c +@@ -23,8 +23,8 @@ + #include "ltran_errno.h" + #include "ltran_base.h" + #include "ltran_log.h" +-#include "gazelle_dfx_msg.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_dfx_msg.h" ++#include "common/gazelle_base_func.h" + #include "ltran_param.h" + + #define HEX_BASE 16 +diff --git a/src/ltran/ltran_param.h b/src/ltran/ltran_param.h +index 75addcd..e48b781 100644 +--- a/src/ltran/ltran_param.h ++++ b/src/ltran/ltran_param.h +@@ -17,7 +17,7 @@ + #include + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + struct ltran_config { + struct { +diff --git a/src/ltran/ltran_stack.c b/src/ltran/ltran_stack.c +index 2aed6c9..299fb7a 100644 +--- a/src/ltran/ltran_stack.c ++++ b/src/ltran/ltran_stack.c +@@ -16,7 +16,7 @@ + #include "ltran_instance.h" + #include "ltran_log.h" + #include "ltran_jhash.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "ltran_stack.h" + + struct gazelle_stack_htable *g_stack_htable = NULL; +diff --git a/src/ltran/ltran_stat.c b/src/ltran/ltran_stat.c +index dfd5fc9..0a8d75c 100644 +--- a/src/ltran/ltran_stat.c ++++ b/src/ltran/ltran_stat.c +@@ -21,12 +21,12 @@ + #include "ltran_tcp_conn.h" + #include "ltran_instance.h" + #include "ltran_log.h" +-#include "gazelle_dfx_msg.h" ++#include "common/gazelle_dfx_msg.h" + #include "ltran_timer.h" + #include "ltran_ethdev.h" + #include "ltran_base.h" + #include "ltran_stack.h" +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "ltran_forward.h" + + /* undefine lwip_ntohs in lwip/def.h */ +diff --git a/src/ltran/ltran_stat.h b/src/ltran/ltran_stat.h +index 16d03a1..75cb353 100644 +--- a/src/ltran/ltran_stat.h ++++ b/src/ltran/ltran_stat.h +@@ -17,7 +17,7 @@ + + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + /* + * When doing reads from the NIC or the client queues, +diff --git a/src/ltran/ltran_tcp_conn.h b/src/ltran/ltran_tcp_conn.h +index fa508bc..82c5faf 100644 +--- a/src/ltran/ltran_tcp_conn.h ++++ b/src/ltran/ltran_tcp_conn.h +@@ -18,7 +18,7 @@ + #include + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + struct gazelle_tcp_conn { + uint32_t tid; +diff --git a/src/ltran/ltran_tcp_sock.c b/src/ltran/ltran_tcp_sock.c +index 940ded8..4044fc0 100644 +--- a/src/ltran/ltran_tcp_sock.c ++++ b/src/ltran/ltran_tcp_sock.c +@@ -18,7 +18,7 @@ + #include "ltran_instance.h" + #include "ltran_base.h" + #include "ltran_jhash.h" +-#include "gazelle_base_func.h" ++#include "common/gazelle_base_func.h" + #include "ltran_tcp_sock.h" + + struct gazelle_tcp_sock_htable *g_tcp_sock_htable = NULL; +diff --git a/src/ltran/ltran_tcp_sock.h b/src/ltran/ltran_tcp_sock.h +index a6e9571..e40891d 100644 +--- a/src/ltran/ltran_tcp_sock.h ++++ b/src/ltran/ltran_tcp_sock.h +@@ -17,7 +17,7 @@ + #include + #include + +-#include "gazelle_opt.h" ++#include "common/gazelle_opt.h" + + struct gazelle_stack; + struct gazelle_tcp_sock { +diff --git a/src/ltran/main.c b/src/ltran/main.c +index 6cc8bc9..3d2310b 100644 +--- a/src/ltran/main.c ++++ b/src/ltran/main.c +@@ -20,7 +20,7 @@ + #include + #include + +-#include "dpdk_common.h" ++#include "common/dpdk_common.h" + #include "ltran_log.h" + #include "ltran_param.h" + #include "ltran_stat.h" +-- +2.33.0 + diff --git a/0214-add-.gitignore.patch b/0214-add-.gitignore.patch new file mode 100644 index 0000000..9217a9d --- /dev/null +++ b/0214-add-.gitignore.patch @@ -0,0 +1,50 @@ +From da27acd950124efefb237b4cce69e42b9a769fa9 Mon Sep 17 00:00:00 2001 +From: Lemmy Huang +Date: Tue, 9 Jul 2024 15:37:30 +0800 +Subject: [PATCH] add .gitignore + +Signed-off-by: Lemmy Huang +--- + .gitignore | 17 +++++++++++++++++ + src/lstack/Makefile | 1 - + 2 files changed, 17 insertions(+), 1 deletion(-) + create mode 100644 .gitignore + +diff --git a/.gitignore b/.gitignore +new file mode 100644 +index 0000000..ec51d25 +--- /dev/null ++++ b/.gitignore +@@ -0,0 +1,17 @@ ++.vscode ++ ++**/*.so ++**/*.a ++**/*.o ++ ++**/CMakeCache.txt ++**/CMakeFiles ++examples/Makefile ++examples/cmake_install.cmake ++examples/example ++src/ltran/Makefile ++src/ltran/cmake_install.cmake ++src/ltran/ltran.map ++src/ltran/gazellectl ++src/ltran/ltran ++ +diff --git a/src/lstack/Makefile b/src/lstack/Makefile +index dd4e2c4..8a659c2 100644 +--- a/src/lstack/Makefile ++++ b/src/lstack/Makefile +@@ -104,7 +104,6 @@ else + endif + + DEP_LIBS = $(LWIP_LIB) $(LIBRTE_LIB) +-$(info $(CC):$(DEP_LIBS)) + + SRCS = $(wildcard ./api/*.c ./core/*.c ./netif/*.c ../common/*.c) + # Linking object and library +-- +2.33.0 + diff --git a/0215-cleancode-rename-gazelle-files-in-lwip.patch b/0215-cleancode-rename-gazelle-files-in-lwip.patch new file mode 100644 index 0000000..daffb57 --- /dev/null +++ b/0215-cleancode-rename-gazelle-files-in-lwip.patch @@ -0,0 +1,489 @@ +From 8ce0711285aaa897b08cf894e2908fef9fffe112 Mon Sep 17 00:00:00 2001 +From: Lemmy Huang +Date: Tue, 9 Jul 2024 21:52:51 +0800 +Subject: [PATCH] cleancode: rename gazelle files in lwip + +Signed-off-by: Lemmy Huang +--- + src/common/gazelle_dfx_msg.h | 2 +- + src/lstack/api/lstack_epoll.c | 6 +++--- + src/lstack/api/lstack_fork.c | 2 +- + src/lstack/api/lstack_rtc_api.c | 4 ++-- + src/lstack/api/lstack_rtw_api.c | 2 +- + src/lstack/api/lstack_signal.c | 4 ++-- + src/lstack/api/lstack_wrap.c | 4 ++-- + src/lstack/core/lstack_cfg.c | 4 ++-- + src/lstack/core/lstack_control_plane.c | 4 ++-- + src/lstack/core/lstack_dpdk.c | 4 ++-- + src/lstack/core/lstack_init.c | 6 +++--- + src/lstack/core/lstack_lwip.c | 4 ++-- + src/lstack/core/lstack_preload.c | 4 ++-- + src/lstack/core/lstack_protocol_stack.c | 6 +++--- + src/lstack/core/lstack_stack_stat.c | 4 ++-- + src/lstack/core/lstack_thread_rpc.c | 2 +- + src/lstack/core/lstack_virtio.c | 2 +- + src/lstack/include/lstack_dpdk.h | 2 +- + src/lstack/include/lstack_protocol_stack.h | 2 +- + src/lstack/include/posix/lstack_epoll.h | 2 +- + src/lstack/netif/lstack_ethdev.c | 2 +- + src/lstack/netif/lstack_fault_inject.c | 2 +- + src/lstack/netif/lstack_flow.c | 2 +- + src/lstack/netif/lstack_vdev.c | 4 ++-- + src/ltran/ltran_instance.h | 2 +- + src/ltran/ltran_stack.h | 2 +- + src/ltran/ltran_tcp_conn.h | 4 ++-- + src/ltran/ltran_tcp_sock.c | 2 +- + src/ltran/ltran_tcp_sock.h | 2 +- + src/ltran/ltran_timer.c | 2 +- + 30 files changed, 47 insertions(+), 47 deletions(-) + +diff --git a/src/common/gazelle_dfx_msg.h b/src/common/gazelle_dfx_msg.h +index 57bf631..a2ec07b 100644 +--- a/src/common/gazelle_dfx_msg.h ++++ b/src/common/gazelle_dfx_msg.h +@@ -16,7 +16,7 @@ + #include + #include + +-#include ++#include + + #ifdef GAZELLE_FAULT_INJECT_ENABLE + #include "gazelle_fault_inject_common.h" +diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c +index 9c0aef7..7d00de7 100644 +--- a/src/lstack/api/lstack_epoll.c ++++ b/src/lstack/api/lstack_epoll.c +@@ -19,13 +19,13 @@ + #include + #include + +-#include ++#include + #include +-#include ++#include + #include + #include + #include +-#include ++#include + + #include "lstack_ethdev.h" + #include "lstack_stack_stat.h" +diff --git a/src/lstack/api/lstack_fork.c b/src/lstack/api/lstack_fork.c +index 43c212b..5cddee2 100644 +--- a/src/lstack/api/lstack_fork.c ++++ b/src/lstack/api/lstack_fork.c +@@ -13,7 +13,7 @@ + #include + #include + +-#include ++#include + + pid_t lstack_fork(void) + { +diff --git a/src/lstack/api/lstack_rtc_api.c b/src/lstack/api/lstack_rtc_api.c +index 18664ca..e77edec 100644 +--- a/src/lstack/api/lstack_rtc_api.c ++++ b/src/lstack/api/lstack_rtc_api.c +@@ -14,8 +14,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + #include "posix/lstack_epoll.h" + #include "lstack_log.h" + #include "lstack_cfg.h" +diff --git a/src/lstack/api/lstack_rtw_api.c b/src/lstack/api/lstack_rtw_api.c +index e43be59..0f23ffd 100644 +--- a/src/lstack/api/lstack_rtw_api.c ++++ b/src/lstack/api/lstack_rtw_api.c +@@ -15,7 +15,7 @@ + #include + #include + +-#include ++#include + + #include "lstack_thread_rpc.h" + #include "posix/lstack_epoll.h" +diff --git a/src/lstack/api/lstack_signal.c b/src/lstack/api/lstack_signal.c +index 3dd5d03..9d0431b 100644 +--- a/src/lstack/api/lstack_signal.c ++++ b/src/lstack/api/lstack_signal.c +@@ -15,8 +15,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "common/gazelle_base_func.h" + #include "lstack_cfg.h" +diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c +index 3a60cbb..cf0d302 100644 +--- a/src/lstack/api/lstack_wrap.c ++++ b/src/lstack/api/lstack_wrap.c +@@ -22,8 +22,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + #include + + #include "posix/lstack_unistd.h" +diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c +index 4bc4217..a1f6c2f 100644 +--- a/src/lstack/core/lstack_cfg.c ++++ b/src/lstack/core/lstack_cfg.c +@@ -24,8 +24,8 @@ + #include + + #include +-#include +-#include ++#include ++#include + #include + + #include "common/gazelle_reg_msg.h" +diff --git a/src/lstack/core/lstack_control_plane.c b/src/lstack/core/lstack_control_plane.c +index 4ab12f6..5545b9f 100644 +--- a/src/lstack/core/lstack_control_plane.c ++++ b/src/lstack/core/lstack_control_plane.c +@@ -21,8 +21,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "lstack_cfg.h" + #include "lstack_dpdk.h" +diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c +index 583bb09..a095cbd 100644 +--- a/src/lstack/core/lstack_dpdk.c ++++ b/src/lstack/core/lstack_dpdk.c +@@ -32,10 +32,10 @@ + #endif + #include + #include +-#include ++#include + #include + #include +-#include ++#include + #include + + #include +diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c +index d97b218..a5a4a4e 100644 +--- a/src/lstack/core/lstack_init.c ++++ b/src/lstack/core/lstack_init.c +@@ -28,11 +28,11 @@ + + #include + #include +-#include ++#include + #include +-#include ++#include + #include +-#include ++#include + + #include "lstack_cfg.h" + #include "lstack_control_plane.h" +diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c +index 6e50e4d..75ef5f6 100644 +--- a/src/lstack/core/lstack_lwip.c ++++ b/src/lstack/core/lstack_lwip.c +@@ -15,11 +15,11 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/src/lstack/core/lstack_preload.c b/src/lstack/core/lstack_preload.c +index f7caef5..0974e9e 100644 +--- a/src/lstack/core/lstack_preload.c ++++ b/src/lstack/core/lstack_preload.c +@@ -15,8 +15,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + #include + + #include "lstack_log.h" +diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c +index 1983c0b..d8bdd3c 100644 +--- a/src/lstack/core/lstack_protocol_stack.c ++++ b/src/lstack/core/lstack_protocol_stack.c +@@ -16,9 +16,9 @@ + #include + #include + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + +diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c +index 423be81..e77f21a 100644 +--- a/src/lstack/core/lstack_stack_stat.c ++++ b/src/lstack/core/lstack_stack_stat.c +@@ -15,11 +15,11 @@ + #include + #include + #include +-#include ++#include ++#include + + #include "lstack_cfg.h" + #include "lstack_ethdev.h" +-#include "posix_api.h" + #include "lstack_control_plane.h" + #include "lstack_log.h" + #include "common/dpdk_common.h" +diff --git a/src/lstack/core/lstack_thread_rpc.c b/src/lstack/core/lstack_thread_rpc.c +index e438c37..a6d2dbf 100644 +--- a/src/lstack/core/lstack_thread_rpc.c ++++ b/src/lstack/core/lstack_thread_rpc.c +@@ -10,7 +10,7 @@ + * See the Mulan PSL v2 for more details. + */ + #include +-#include ++#include + #include + + #include "lstack_log.h" +diff --git a/src/lstack/core/lstack_virtio.c b/src/lstack/core/lstack_virtio.c +index bc42bb9..36159c9 100644 +--- a/src/lstack/core/lstack_virtio.c ++++ b/src/lstack/core/lstack_virtio.c +@@ -13,7 +13,7 @@ + #include + #include + #include +-#include ++#include + #include + #include "lstack_cfg.h" + #include "lstack_log.h" +diff --git a/src/lstack/include/lstack_dpdk.h b/src/lstack/include/lstack_dpdk.h +index 91af3c5..d058409 100644 +--- a/src/lstack/include/lstack_dpdk.h ++++ b/src/lstack/include/lstack_dpdk.h +@@ -13,7 +13,7 @@ + #ifndef _GAZELLE_DPDK_H_ + #define _GAZELLE_DPDK_H_ + +-#include ++#include + #include "common/gazelle_opt.h" + #include "common/gazelle_dfx_msg.h" + +diff --git a/src/lstack/include/lstack_protocol_stack.h b/src/lstack/include/lstack_protocol_stack.h +index 5b04c6d..7dce757 100644 +--- a/src/lstack/include/lstack_protocol_stack.h ++++ b/src/lstack/include/lstack_protocol_stack.h +@@ -17,7 +17,7 @@ + #include + #include + +-#include ++#include + #include + + #include "common/gazelle_opt.h" +diff --git a/src/lstack/include/posix/lstack_epoll.h b/src/lstack/include/posix/lstack_epoll.h +index 77b6ebb..6e02615 100644 +--- a/src/lstack/include/posix/lstack_epoll.h ++++ b/src/lstack/include/posix/lstack_epoll.h +@@ -18,7 +18,7 @@ + #include + #include + +-#include ++#include + + #include "common/gazelle_dfx_msg.h" + #include "common/gazelle_opt.h" +diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c +index e23d313..5685d11 100644 +--- a/src/lstack/netif/lstack_ethdev.c ++++ b/src/lstack/netif/lstack_ethdev.c +@@ -19,7 +19,7 @@ + + #include + #include +-#include ++#include + #include + + #include +diff --git a/src/lstack/netif/lstack_fault_inject.c b/src/lstack/netif/lstack_fault_inject.c +index 4736e29..9fae745 100644 +--- a/src/lstack/netif/lstack_fault_inject.c ++++ b/src/lstack/netif/lstack_fault_inject.c +@@ -14,7 +14,7 @@ + #include + #include + +-#include ++#include + + #include "lstack_cfg.h" + #include "lstack_log.h" +diff --git a/src/lstack/netif/lstack_flow.c b/src/lstack/netif/lstack_flow.c +index 84497dc..84c5c61 100644 +--- a/src/lstack/netif/lstack_flow.c ++++ b/src/lstack/netif/lstack_flow.c +@@ -18,7 +18,7 @@ + #include + #include + +-#include ++#include + #include + #include + +diff --git a/src/lstack/netif/lstack_vdev.c b/src/lstack/netif/lstack_vdev.c +index 63f9e40..a590b30 100644 +--- a/src/lstack/netif/lstack_vdev.c ++++ b/src/lstack/netif/lstack_vdev.c +@@ -14,7 +14,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -201,7 +201,7 @@ int32_t vdev_reg_xmit(enum reg_ring_type type, struct gazelle_quintuple *qtuple) + + uint16_t local_port = ntohs(qtuple->src_port); + if (get_global_cfg_params()->flow_bifurcation && get_global_cfg_params()->is_primary) { +- if (type == REG_RING_TCP_LISTEN_CLOSE || type == REG_RING_UDP_BIND_CLOSE) { // add enum type in reg_sock.h ++ if (type == REG_RING_TCP_LISTEN_CLOSE || type == REG_RING_UDP_BIND_CLOSE) { // add enum type in lwipgz_flow.h + port_map_mod(local_port, 0); + } else if (type == REG_RING_TCP_LISTEN || type == REG_RING_UDP_BIND) { + port_map_mod(local_port, 1); +diff --git a/src/ltran/ltran_instance.h b/src/ltran/ltran_instance.h +index f0fe580..9cb6d31 100644 +--- a/src/ltran/ltran_instance.h ++++ b/src/ltran/ltran_instance.h +@@ -13,7 +13,7 @@ + #ifndef __GAZELLE_INSTANCE_H__ + #define __GAZELLE_INSTANCE_H__ + +-#include ++#include + #include + #include + +diff --git a/src/ltran/ltran_stack.h b/src/ltran/ltran_stack.h +index 693bb33..7dd1cb1 100644 +--- a/src/ltran/ltran_stack.h ++++ b/src/ltran/ltran_stack.h +@@ -13,7 +13,7 @@ + #ifndef __GAZELLE_STACK_H__ + #define __GAZELLE_STACK_H__ + +-#include ++#include + + #include "ltran_stat.h" + +diff --git a/src/ltran/ltran_tcp_conn.h b/src/ltran/ltran_tcp_conn.h +index 82c5faf..87491de 100644 +--- a/src/ltran/ltran_tcp_conn.h ++++ b/src/ltran/ltran_tcp_conn.h +@@ -13,10 +13,10 @@ + #ifndef __GAZELLE_TCP_CONN_H__ + #define __GAZELLE_TCP_CONN_H__ + +-#include ++#include + #include + #include +-#include ++#include + + #include "common/gazelle_opt.h" + +diff --git a/src/ltran/ltran_tcp_sock.c b/src/ltran/ltran_tcp_sock.c +index 4044fc0..eef2821 100644 +--- a/src/ltran/ltran_tcp_sock.c ++++ b/src/ltran/ltran_tcp_sock.c +@@ -12,7 +12,7 @@ + + #include + +-#include ++#include + + #include "ltran_tcp_conn.h" + #include "ltran_instance.h" +diff --git a/src/ltran/ltran_tcp_sock.h b/src/ltran/ltran_tcp_sock.h +index e40891d..6ca97ec 100644 +--- a/src/ltran/ltran_tcp_sock.h ++++ b/src/ltran/ltran_tcp_sock.h +@@ -13,7 +13,7 @@ + #ifndef __GAZELLE_TCP_SOCK_H__ + #define __GAZELLE_TCP_SOCK_H__ + +-#include ++#include + #include + #include + +diff --git a/src/ltran/ltran_timer.c b/src/ltran/ltran_timer.c +index 0832c5f..87046cb 100644 +--- a/src/ltran/ltran_timer.c ++++ b/src/ltran/ltran_timer.c +@@ -17,7 +17,7 @@ + #include + #include + #include +-#include ++#include + + #include "ltran_param.h" + #include "ltran_log.h" +-- +2.33.0 + diff --git a/gazelle.spec b/gazelle.spec index 272840b..20c663f 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.2 -Release: 49 +Release: 50 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -229,6 +229,9 @@ Patch9209: 0209-virtio-update-g_rule_port-by-reg_ring_type-enum.patch Patch9210: 0210-virtio-dfx-data-of-virtio.patch Patch9211: 0211-add-flow_bifurcation-switch-in-lstack_cfg-file.patch Patch9212: 0212-example-sync-example-update.patch +Patch9213: 0213-cleancode-improving-makefile-readability.patch +Patch9214: 0214-add-.gitignore.patch +Patch9215: 0215-cleancode-rename-gazelle-files-in-lwip.patch %description %{name} is a high performance user-mode stack. @@ -270,6 +273,11 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Thu Jul 11 2024 yinbin6 - 1.0.2-50 +- cleancode: rename gazelle files in lwip +- add .gitignore +- cleancode: improving makefile readability + * Thu Jul 11 2024 yinbin6 - 1.0.2-49 - example: sync example update