summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2019-08-12 19:17:02 +0800
committer杨威 <[email protected]>2019-08-12 19:17:02 +0800
commitace638519716da065ae7ec3a1cb0e6fc884019ab (patch)
treeb9c5f668ecad90aeda69119b03517f35a7648845
parent423ef10bfc53891b81aee7f65156313538299045 (diff)
Pangu develop parallel
-rw-r--r--CMakeLists.txt4
-rw-r--r--entry/CMakeLists.txt3
-rw-r--r--packet_io/packet_io.c3
-rw-r--r--plugin/src/plugin.c33
-rw-r--r--run/conf/main.conf18
-rw-r--r--support/symbol_check/CMakeLists.txt2
-rw-r--r--support/timestamp_record/CMakeLists.txt3
7 files changed, 53 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 903c6bb..7fd0e70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,8 +11,8 @@ include(Version)
set(CMAKE_MACOSX_RPATH 0)
-set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror -DHIGH_PERF=1")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Werror -DHIGH_PERF=1")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror -DHIGH_PERF=0")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Werror -DHIGH_PERF=0")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -DHIGH_PERF=0")
diff --git a/entry/CMakeLists.txt b/entry/CMakeLists.txt
index 07555ae..ed8881a 100644
--- a/entry/CMakeLists.txt
+++ b/entry/CMakeLists.txt
@@ -8,11 +8,12 @@ include_directories(${CMAKE_SOURCE_DIR}/include/net)
include_directories(${CMAKE_SOURCE_DIR}/dealpkt)
include_directories(${CMAKE_SOURCE_DIR}/packet_io)
+LINK_DIRECTORIES(/opt/MESA/lib)
add_executable(sapp sapp_init.c sapp_main.c sapp_global_val.c)
target_compile_options(sapp PUBLIC ${MEM_POOL_DEFINITIONS})
target_link_libraries(sapp nsl pthread dl m pcap)
target_link_libraries(sapp MESA_handle_logger MESA_prof_load)
-target_link_libraries(sapp sapp_assistant gdev_assistant)
+target_link_libraries(sapp sapp_assistant gdev_assistant cjson)
set(SAPP_MODULES iknow timestamp_record md5 symbol_check MESA_sleep MESA_socket_wrap packet_io dealpkt project plugctrl)
diff --git a/packet_io/packet_io.c b/packet_io/packet_io.c
index 019b901..832f1bd 100644
--- a/packet_io/packet_io.c
+++ b/packet_io/packet_io.c
@@ -113,6 +113,7 @@ void pptp_exit(void);
extern void ipv4_frag_per_thread_exit(int thread_seq);
extern void ipv6_frag_per_thread_exit(int thread_seq);
extern void pptp_per_thread_exit(int thread_seq);
+extern void plugctrl_destroy_all_plug(void);
extern void __timestamp_print_max_tuple4(const raw_pkt_t *raw_pkt, long timedelay, int tid);
static const unsigned char phony_feedback_eth_hdr_ip4[ETHERNET_HDR_LEN] =
@@ -659,6 +660,8 @@ void packet_io_exit(void)
sleep(1);
sched_yield();
sleep(1);
+
+ plugctrl_destroy_all_plug();
exit(1);
diff --git a/plugin/src/plugin.c b/plugin/src/plugin.c
index 71624ba..0838df0 100644
--- a/plugin/src/plugin.c
+++ b/plugin/src/plugin.c
@@ -1742,3 +1742,36 @@ char PROT_PROCESS(stSessionInfo* session_info, void **pme, int thread_seq,struct
}
+extern stBusinessPlugInfo* g_platform_plug_info;
+extern stBusinessPlugInfo* g_business_plug_info;
+extern stProtocolPlugInfo* g_protocol_plug_info;
+
+void plugctrl_destroy_all_plug(void)
+{
+ stBusinessPlugInfo *plug_info;
+
+ plug_info = g_platform_plug_info;
+ while(plug_info){
+ if(plug_info->fun_destroy){
+ plug_info->fun_destroy();
+ }
+ plug_info = plug_info->next;
+ }
+
+ plug_info = g_protocol_plug_info;
+ while(plug_info){
+ if(plug_info->fun_destroy){
+ plug_info->fun_destroy();
+ }
+ plug_info = plug_info->next;
+ }
+
+ plug_info = g_business_plug_info;
+ while(plug_info){
+ if(plug_info->fun_destroy){
+ plug_info->fun_destroy();
+ }
+ plug_info = plug_info->next;
+ }
+}
+
diff --git a/run/conf/main.conf b/run/conf/main.conf
index 53558c1..ef9853b 100644
--- a/run/conf/main.conf
+++ b/run/conf/main.conf
@@ -1,13 +1,13 @@
[Module]
-threadnum=8
+threadnum=1
#cpu_bind_core_mask=1,2,3,4,5
cpu_bind_core_mask=0xFF0
app_instance_name=sapp
-MaxTcpStreams=900
-MaxUdpStreams=900
-LinkTimeout=10
-UdpResetTime=10
+MaxTcpStreams=1000
+MaxUdpStreams=1000
+LinkTimeout=0
+UdpResetTime=0
CreatLinkMode=3
MaxUnorderNum=5
TcpAllEnable=1
@@ -24,9 +24,9 @@ kill_tcp_with_gdev=0
signal_take_over_switch=0
-timestamp_record=1
+timestamp_record=0
#timedelay_threshold unit: CPU CYCLE
-timedelay_threshold=1000
+timedelay_threshold=1000000
analyse_tcp_option=0
@@ -64,7 +64,7 @@ treat_vlan_as_mac_in_mac=0
capdatamodlel=1
forwardpkt=0
pcapdevice=lo
-pcapdevice2=em2
+#pcapdevice2=em2
pcapfilter=
pcap_dumpfile_list=dumpfile.list
senddevice=ens33
@@ -100,7 +100,7 @@ FS_app_name=sapp_test
FS_send_histogram=0
[pkt_dump]
-pkt_dump_switch=1
+pkt_dump_switch=0
#1:local file; 2:udp socket
pkt_dump_mode=2
pkt_dump_cmd_port=12345
diff --git a/support/symbol_check/CMakeLists.txt b/support/symbol_check/CMakeLists.txt
index 3895588..8f4d9cd 100644
--- a/support/symbol_check/CMakeLists.txt
+++ b/support/symbol_check/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 2.8)
+include_directories(${MESA_SDK_PREFIX}/include)
+include_directories(${MESA_SDK_PREFIX}/include/MESA)
#include_directories(${CMAKE_SOURCE_DIR}/packet_io)
#include_directories(${CMAKE_SOURCE_DIR}/project)
#include_directories(${CMAKE_SOURCE_DIR}/include)
diff --git a/support/timestamp_record/CMakeLists.txt b/support/timestamp_record/CMakeLists.txt
index a5c06d8..be33893 100644
--- a/support/timestamp_record/CMakeLists.txt
+++ b/support/timestamp_record/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.8)
-
+include_directories(${MESA_SDK_PREFIX}/include)
+include_directories(${MESA_SDK_PREFIX}/include/MESA)
include_directories(${CMAKE_SOURCE_DIR}/packet_io)
#include_directories(${CMAKE_SOURCE_DIR}/project)
include_directories(${CMAKE_SOURCE_DIR}/include)