From e0c2abfa83583bb86aca09ebe233c6b2353ef97b Mon Sep 17 00:00:00 2001 From: Qizhen Zhang Date: Mon, 11 Dec 2023 20:29:08 -0800 Subject: [PATCH] Isolate termination signals --- DPDPU/Benchmarks/RingBuffer/DPU/Source/RequestBackEnd.c | 3 ++- DPDPU/Benchmarks/RingBuffer/DPU/Source/ResponseBackEnd.c | 3 ++- DPDPU/Common/Source/DPU/BackEndControl.c | 4 ++++ DPDPU/Main/meson.build | 1 + DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c | 2 +- DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c | 2 +- DPDPU/StorageEngine/DDSBackEndDPUService/meson.build | 1 + 7 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 DPDPU/Common/Source/DPU/BackEndControl.c diff --git a/DPDPU/Benchmarks/RingBuffer/DPU/Source/RequestBackEnd.c b/DPDPU/Benchmarks/RingBuffer/DPU/Source/RequestBackEnd.c index b630406..9d24d69 100644 --- a/DPDPU/Benchmarks/RingBuffer/DPU/Source/RequestBackEnd.c +++ b/DPDPU/Benchmarks/RingBuffer/DPU/Source/RequestBackEnd.c @@ -11,13 +11,14 @@ #include #include +#include "BackEndControl.h" #include "DDSTypes.h" #include "RequestBackEnd.h" #define TRUE 1 #define FALSE 0 -static volatile int ForceQuitStorageEngine = 0; +extern volatile int ForceQuitStorageEngine = 0; // // Set a CM channel to be non-blocking diff --git a/DPDPU/Benchmarks/RingBuffer/DPU/Source/ResponseBackEnd.c b/DPDPU/Benchmarks/RingBuffer/DPU/Source/ResponseBackEnd.c index 49fb6eb..7ad1241 100644 --- a/DPDPU/Benchmarks/RingBuffer/DPU/Source/ResponseBackEnd.c +++ b/DPDPU/Benchmarks/RingBuffer/DPU/Source/ResponseBackEnd.c @@ -11,6 +11,7 @@ #include #include +#include "BackEndControl.h" #include "DDSTypes.h" #include "Profiler.h" #include "ResponseBackEnd.h" @@ -25,7 +26,7 @@ #define TOTAL_RESPONSES 100000 #endif -static volatile int ForceQuitStorageEngine = 0; +extern volatile int ForceQuitStorageEngine = 0; static struct Profiler Prof; struct Response { diff --git a/DPDPU/Common/Source/DPU/BackEndControl.c b/DPDPU/Common/Source/DPU/BackEndControl.c new file mode 100644 index 0000000..368e9c6 --- /dev/null +++ b/DPDPU/Common/Source/DPU/BackEndControl.c @@ -0,0 +1,4 @@ +#include "BackEndControl.h" + +volatile int ForceQuitStorageEngine = 0; +volatile int ForceQuitNetworkEngine = 0; \ No newline at end of file diff --git a/DPDPU/Main/meson.build b/DPDPU/Main/meson.build index 1de421b..0e6a718 100644 --- a/DPDPU/Main/meson.build +++ b/DPDPU/Main/meson.build @@ -81,6 +81,7 @@ app_srcs = [] app_srcs += [ 'Source/Main.c', + common_path + 'Source/DPU/BackEndControl.c', common_path + 'Source/DPU/CacheTable.c', common_path + 'Source/DPU/FileService.c', common_path + 'Source/DPU/RingBufferPolling.c', diff --git a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c index 270bc65..08e8763 100644 --- a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c +++ b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c @@ -44,7 +44,7 @@ static struct NetfeLcoreParam FeParam; static struct LcoreParam CoreParam[RTE_MAX_LCORE]; static int PEPOVerbose = 0; -volatile int ForceQuitNetworkEngine = 0; +extern volatile int ForceQuitNetworkEngine; // // Check out the paper below for the mapping between the hash key and TCP header fields diff --git a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c index 08c4297..4aa3b50 100644 --- a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c +++ b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c @@ -25,7 +25,7 @@ static inline void DebugPrint(const char* Fmt, ...) { } #endif -volatile int ForceQuitStorageEngine = 0; +extern volatile int ForceQuitStorageEngine; bool G_INITIALIZATION_DONE = false; // diff --git a/DPDPU/StorageEngine/DDSBackEndDPUService/meson.build b/DPDPU/StorageEngine/DDSBackEndDPUService/meson.build index 4007eec..7c3d5e4 100644 --- a/DPDPU/StorageEngine/DDSBackEndDPUService/meson.build +++ b/DPDPU/StorageEngine/DDSBackEndDPUService/meson.build @@ -59,6 +59,7 @@ app_srcs += [ 'Source/DPUBackEndFile.c', 'Source/DPUBackEndStorage.c', 'Source/Zmalloc.c', + '../../Common/Source/DPU/BackEndControl.c', '../../Common/Source/DPU/FileService.c', '../../Common/Source/DPU/RingBufferPolling.c', ]