Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
qizzz committed Dec 24, 2023
1 parent 31b777d commit 18e9bef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
9 changes: 8 additions & 1 deletion DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -2813,10 +2813,16 @@ NetfeRxTxProcess(
);

totalBytesOfDPUReqs += FeLcore->ReqsForDPU[i].Bytes;
readOp->ReadCtxt.DataBuffer.TotalSize = FeLcore->ReqsForDPU[i].Bytes;
readOp->ReadCtxt.DataBuffer.TotalSize = readOp->ReadCtxt.Request->Bytes;
readOp->ReadCtxt.DataBuffer.FirstSize = readOp->ReadCtxt.DataBuffer.TotalSize;
readOp->StreamCtxt = (ContextT)FeStream;

// TODO: DEBUG
printf("ReadCtxt DataBuffer total size: %u\n", readOp->ReadCtxt.DataBuffer.TotalSize);
printf("FeLcore->ReqsForDPU[i].Offset: %u\n", FeLcore->ReqsForDPU[i].Offset);
printf("ReadCtxt Request Offset: %u, Bytes: %u\n", readOp->ReadCtxt.Request->Offset, readOp->ReadCtxt.Request->Bytes);
//

SubmitDataPlaneRequest(
FS,
&readOp->ReadCtxt,
Expand Down Expand Up @@ -3633,6 +3639,7 @@ PEPOLcoreMain(
//
//
iov.iov_len = 1024;
// memset(readOp->RespBuf, 7, 1024);//sanity check on client recv data
//
// Debugging ends here
//
Expand Down
1 change: 1 addition & 0 deletions DPDPU/OffloadEngine/UDFSamples/OffloadFunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ void OffloadFunc(
ReadOp->FileId = msg->FileId;
ReadOp->Bytes = msg->Length;
ReadOp->Offset = msg->Offset;
printf("OffloadFunc got offset: %lu, length: %d\n", msg->Offset, msg->Length);
}
4 changes: 3 additions & 1 deletion DPDPU/OffloadEngine/UDFSamples/OffloadPred.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ void OffloadPred(
uint8_t* NumReqsForHost,
uint8_t* NumReqsForDPU
) {
printf("pred got bytes: %hu\n", Bytes);
const uint16_t reqSize = sizeof(struct MessageHeader);
const int numReqsForDPU = Bytes / reqSize;
printf("pred got no. reqs: %d\n", numReqsForDPU);

*NumReqsForHost = 0;
*NumReqsForDPU = numReqsForDPU;
Expand All @@ -29,4 +31,4 @@ void OffloadPred(
ReqsForDPU[i].Offset = i * reqSize;
ReqsForDPU[i].Bytes = reqSize;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ void LoadFilesCallback(
SPDK_NOTICELOG("Initializing file with ID %hu\n", Ctx->FileOnDisk->Id);
Sto->AllFiles[Ctx->FileLoopIndex] =
BackEndFileI(Ctx->FileOnDisk->Id, Ctx->FileOnDisk->FProperties.FileName, Ctx->FileOnDisk->FProperties.FileAttributes);
printf("********** Sto->AllFiles[%d] = %p\n", Ctx->FileOnDisk->Id, Sto->AllFiles[Ctx->FileLoopIndex]);
if (Sto->AllFiles[Ctx->FileLoopIndex]) {
memcpy(GetFileProperties(Sto->AllFiles[Ctx->FileLoopIndex]), Ctx->FileOnDisk, sizeof(DPUFilePropertiesT));
SetNumAllocatedSegments(Sto->AllFiles[Ctx->FileLoopIndex]);
Expand Down Expand Up @@ -1149,7 +1150,8 @@ void CreateFileCallback2(
// Finally, file is added
//
//
Sto->AllFiles[HandlerCtx->DirId] = HandlerCtx->File;
Sto->AllFiles[HandlerCtx->FileId] = HandlerCtx->File;
printf("*********************** Sto->AllFiles[%d] is updated to %p\n", HandlerCtx->FileId, HandlerCtx->File);

pthread_mutex_lock(&Sto->SectorModificationMutex);

Expand Down Expand Up @@ -1529,6 +1531,11 @@ ErrorCodeT ReadFile(
struct PerSlotContext* SlotContext = (struct PerSlotContext*)Context;
SlotContext->DestBuffer = DestBuffer;
FileSizeT remainingBytes = GetSize(file) - Offset;
printf("Sto->AllFiles: %p\n", Sto->AllFiles);
printf("FileId: %d, file ptr: %p\n", FileId, file);
printf("file properties id: %d\n", file->Properties.Id);
printf("ReadFile: Offset: %u, GetSize(file): %d\n", Offset, GetSize(file));
printf("DestBuffer->TotalSize: %u\n", DestBuffer->TotalSize);

FileIOSizeT bytesLeftToRead = DestBuffer->TotalSize;
FileSizeT fileSize = GetSize(file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ void ReadHandler(

ErrorCodeT ret;
#ifdef FILE_SERVICE_USE_ZERO_COPY
ret = ReadFile(Context->Request->FileId, Context->Request->Offset, &Context->DataBuffer,
ReadHandlerZCCallback, SlotContext, Sto, SlotContext->SPDKContext);
ret = ReadFile(Context->Request->FileId, Context->Request->Offset, &Context->DataBuffer,
ReadHandlerZCCallback, SlotContext, Sto, SlotContext->SPDKContext);
#else
ret = ReadFile(Context->Request->FileId, Context->Request->Offset, &Context->DataBuffer,
ReadHandlerNonZCCallback, SlotContext, Sto, SlotContext->SPDKContext);
ret = ReadFile(Context->Request->FileId, Context->Request->Offset, &Context->DataBuffer,
ReadHandlerNonZCCallback, SlotContext, Sto, SlotContext->SPDKContext);
#endif

if (ret) {
Expand Down

0 comments on commit 18e9bef

Please sign in to comment.