From 3ff975d3f2d255bc2977481fd31651a36776424d Mon Sep 17 00:00:00 2001 From: Qizhen Zhang Date: Wed, 20 Sep 2023 16:56:24 -0700 Subject: [PATCH 1/2] Emulate control plane completions --- .../DDSBackEndDPUService/Source/FileBackEnd.c | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c index be38e9c..a9d7542 100644 --- a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c +++ b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c @@ -2612,9 +2612,87 @@ CheckAndProcessControlPlaneCompletions( // // if (*(ErrorCodeT*)(ctrlConn->PendingControlPlanRequest.Response) == DDS_ERROR_CODE_IO_PENDING) { - continue; + // + // TODO: testing + // + // + switch (ctrlConn->PendingControlPlanRequest.RequestId) + { + case CTRL_MSG_F2B_REQ_CREATE_DIR: + { + CtrlMsgB2FAckCreateDirectory* resp = (CtrlMsgB2FAckCreateDirectory*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + case CTRL_MSG_F2B_REQ_REMOVE_DIR: + { + CtrlMsgB2FAckRemoveDirectory* resp = (CtrlMsgB2FAckRemoveDirectory*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + case CTRL_MSG_F2B_REQ_CREATE_FILE: + { + CtrlMsgB2FAckCreateFile* resp = (CtrlMsgB2FAckCreateFile*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + case CTRL_MSG_F2B_REQ_DELETE_FILE: + { + CtrlMsgB2FAckDeleteFile* resp = (CtrlMsgB2FAckDeleteFile*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + case CTRL_MSG_F2B_REQ_CHANGE_FILE_SIZE: + { + CtrlMsgB2FAckChangeFileSize* resp = (CtrlMsgB2FAckChangeFileSize*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + case CTRL_MSG_F2B_REQ_GET_FILE_SIZE: + { + CtrlMsgB2FAckGetFileSize* resp = (CtrlMsgB2FAckGetFileSize*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + resp->FileSize = 0; + } + break; + case CTRL_MSG_F2B_REQ_GET_FILE_INFO: + { + CtrlMsgB2FAckGetFileInfo* resp = (CtrlMsgB2FAckGetFileInfo*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + memset(&Resp->FileInfo, 0, sizeof(Resp->FileInfo)); + } + break; + case CTRL_MSG_F2B_REQ_GET_FILE_ATTR: + { + CtrlMsgB2FAckGetFileAttr* resp = (CtrlMsgB2FAckGetFileAttr*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + resp->FileAttr = 0; + } + break; + case CTRL_MSG_F2B_REQ_GET_FREE_SPACE: + { + CtrlMsgB2FAckGetFreeSpace* resp = (CtrlMsgB2FAckGetFreeSpace*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + resp->FreeSpace = 0; + } + break; + case CTRL_MSG_F2B_REQ_MOVE_FILE: + { + CtrlMsgB2FAckMoveFile* resp = (CtrlMsgB2FAckMoveFile*)ctrlConn->PendingControlPlanRequest.Response; + resp->Result = DDS_ERROR_CODE_SUCCESS; + } + break; + default: + break; + } + + // continue; } + ctrlConn->PendingControlPlanRequest.RequestId = DDS_REQUEST_INVALID; + ctrlConn->PendingControlPlanRequest.Request = NULL; + ctrlConn->PendingControlPlanRequest.Response = NULL; + // // It's complete. Respond back to the host // From 9ca015f4d688b88b6f86d293ae9b03f30f07c495 Mon Sep 17 00:00:00 2001 From: Qizhen Zhang Date: Thu, 21 Sep 2023 00:09:20 +0000 Subject: [PATCH 2/2] minor --- DPDPU/Common/Include/Protocol.h | 2 +- DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DPDPU/Common/Include/Protocol.h b/DPDPU/Common/Include/Protocol.h index b5fbba7..2b38ec9 100644 --- a/DPDPU/Common/Include/Protocol.h +++ b/DPDPU/Common/Include/Protocol.h @@ -103,5 +103,5 @@ assert_static_protocol(DDS_RESPONSE_RING_BYTES % DDS_CACHE_LINE_SIZE == 0, 5); #pragma warning(pop) #endif -#define DDS_BACKEND_ADDR "172.16.1.4" +#define DDS_BACKEND_ADDR "172.16.1.8" #define DDS_BACKEND_PORT 4242 diff --git a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c index a9d7542..01e2de5 100644 --- a/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c +++ b/DPDPU/StorageEngine/DDSBackEndDPUService/Source/FileBackEnd.c @@ -2659,7 +2659,7 @@ CheckAndProcessControlPlaneCompletions( { CtrlMsgB2FAckGetFileInfo* resp = (CtrlMsgB2FAckGetFileInfo*)ctrlConn->PendingControlPlanRequest.Response; resp->Result = DDS_ERROR_CODE_SUCCESS; - memset(&Resp->FileInfo, 0, sizeof(Resp->FileInfo)); + memset(&resp->FileInfo, 0, sizeof(resp->FileInfo)); } break; case CTRL_MSG_F2B_REQ_GET_FILE_ATTR: