Skip to content

Commit

Permalink
Fix up naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Aug 25, 2024
1 parent 4c62ba1 commit 3e6def5
Show file tree
Hide file tree
Showing 20 changed files with 185 additions and 185 deletions.
2 changes: 1 addition & 1 deletion src/core/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ QuicLibraryLazyInitialize(
sizeof(QUIC_RX_PACKET),
&DatapathCallbacks,
NULL, // TcpCallbacks
NULL, // WorkerManager
NULL, // WorkerPool
MsQuicLib.ExecutionConfig,
&MsQuicLib.Datapath);
if (QUIC_SUCCEEDED(Status)) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ QuicWorkerInitialize(
#ifndef _KERNEL_MODE // Not supported on kernel mode
if (ExecProfile != QUIC_EXECUTION_PROFILE_TYPE_MAX_THROUGHPUT) {
Worker->IsExternal = TRUE;
CxPlatAddExecutionContext(&CxPlatWorkerManager, &Worker->ExecutionContext, PartitionIndex);
CxPlatAddExecutionContext(&CxPlatDefaultWorkerPool, &Worker->ExecutionContext, PartitionIndex);
} else
#endif // _KERNEL_MODE
{
Expand Down
8 changes: 4 additions & 4 deletions src/inc/quic_datapath.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,16 @@ typedef struct CXPLAT_TCP_DATAPATH_CALLBACKS {

typedef struct CXPLAT_WORKER CXPLAT_WORKER;

typedef struct CXPLAT_WORKER_MANAGER {
typedef struct CXPLAT_WORKER_POOL {

CXPLAT_WORKER* Workers;
CXPLAT_LOCK WorkerLock;
CXPLAT_RUNDOWN_REF Rundown;
uint32_t WorkerCount;

} CXPLAT_WORKER_MANAGER;
} CXPLAT_WORKER_POOL;

extern CXPLAT_WORKER_MANAGER CxPlatWorkerManager;
extern CXPLAT_WORKER_POOL CxPlatDefaultWorkerPool;

//
// Function pointer type for send complete callbacks.
Expand All @@ -417,7 +417,7 @@ CxPlatDataPathInitialize(
_In_ uint32_t ClientRecvContextLength,
_In_opt_ const CXPLAT_UDP_DATAPATH_CALLBACKS* UdpCallbacks,
_In_opt_ const CXPLAT_TCP_DATAPATH_CALLBACKS* TcpCallbacks,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ QUIC_EXECUTION_CONFIG* Config,
_Out_ CXPLAT_DATAPATH** NewDatapath
);
Expand Down
6 changes: 3 additions & 3 deletions src/inc/quic_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,15 @@ typedef struct CXPLAT_EXECUTION_CONTEXT {

} CXPLAT_EXECUTION_CONTEXT;

typedef struct CXPLAT_WORKER_MANAGER CXPLAT_WORKER_MANAGER;
typedef struct CXPLAT_WORKER_POOL CXPLAT_WORKER_POOL;

#ifdef _KERNEL_MODE // Not supported on kernel mode
#define CxPlatAddExecutionContext(WorkerManager, Context, IdealProcessor) CXPLAT_FRE_ASSERT(FALSE)
#define CxPlatAddExecutionContext(WorkerPool, Context, IdealProcessor) CXPLAT_FRE_ASSERT(FALSE)
#define CxPlatWakeExecutionContext(Context) CXPLAT_FRE_ASSERT(FALSE)
#else
void
CxPlatAddExecutionContext(
_In_ CXPLAT_WORKER_MANAGER* Manager,
_In_ CXPLAT_WORKER_POOL* WorkerPool,
_Inout_ CXPLAT_EXECUTION_CONTEXT* Context,
_In_ uint16_t Index // Into the execution config processor array
);
Expand Down
2 changes: 1 addition & 1 deletion src/perf/lib/Tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ bool TcpWorker::Initialize(TcpEngine* _Engine, uint16_t PartitionIndex)

#ifndef _KERNEL_MODE // Not supported on kernel mode
if (Engine->TcpExecutionProfile == TCP_EXECUTION_PROFILE_LOW_LATENCY) {
CxPlatAddExecutionContext(&CxPlatWorkerManager, &ExecutionContext, PartitionIndex);
CxPlatAddExecutionContext(&CxPlatDefaultWorkerPool, &ExecutionContext, PartitionIndex);
Initialized = true;
IsExternal = true;
return true;
Expand Down
16 changes: 8 additions & 8 deletions src/platform/datapath_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ CxPlatProcessorContextInitialize(
CXPLAT_DBG_ASSERT(Datapath != NULL);
DatapathPartition->Datapath = Datapath;
DatapathPartition->PartitionIndex = PartitionIndex;
DatapathPartition->EventQ = CxPlatWorkerGetEventQ(Datapath->WorkerManager, PartitionIndex);
DatapathPartition->EventQ = CxPlatWorkerPoolGetEventQ(Datapath->WorkerPool, PartitionIndex);
CxPlatRefInitialize(&DatapathPartition->RefCount);
CxPlatPoolInitialize(TRUE, Datapath->RecvBlockSize, QUIC_POOL_DATA, &DatapathPartition->RecvBlockPool);
CxPlatPoolInitialize(TRUE, Datapath->SendDataSize, QUIC_POOL_DATA, &DatapathPartition->SendBlockPool);
Expand All @@ -365,7 +365,7 @@ DataPathInitialize(
_In_ uint32_t ClientRecvDataLength,
_In_opt_ const CXPLAT_UDP_DATAPATH_CALLBACKS* UdpCallbacks,
_In_opt_ const CXPLAT_TCP_DATAPATH_CALLBACKS* TcpCallbacks,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ QUIC_EXECUTION_CONFIG* Config,
_Out_ CXPLAT_DATAPATH** NewDatapath
)
Expand All @@ -387,11 +387,11 @@ DataPathInitialize(
return QUIC_STATUS_INVALID_PARAMETER;
}
}
if (WorkerManager == NULL) {
WorkerManager = &CxPlatWorkerManager;
if (WorkerPool == NULL) {
WorkerPool = &CxPlatDefaultWorkerPool;
}

if (!CxPlatWorkerLazyStart(WorkerManager, Config)) {
if (!CxPlatWorkerPoolLazyStart(WorkerPool, Config)) {
return QUIC_STATUS_OUT_OF_MEMORY;
}

Expand Down Expand Up @@ -419,7 +419,7 @@ DataPathInitialize(
if (TcpCallbacks) {
Datapath->TcpHandlers = *TcpCallbacks;
}
Datapath->WorkerManager = WorkerManager;
Datapath->WorkerPool = WorkerPool;

Datapath->PartitionCount = PartitionCount;
Datapath->Features = CXPLAT_DATAPATH_FEATURE_LOCAL_PORT_SHARING;
Expand All @@ -434,7 +434,7 @@ DataPathInitialize(
Datapath, i, &Datapath->Partitions[i]);
}

CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerManager->Rundown));
CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerPool->Rundown));
*NewDatapath = Datapath;

return QUIC_STATUS_SUCCESS;
Expand All @@ -452,7 +452,7 @@ CxPlatDataPathRelease(
CXPLAT_DBG_ASSERT(Datapath->Uninitialized);
Datapath->Freed = TRUE;
#endif
CxPlatRundownRelease(&Datapath->WorkerManager->Rundown);
CxPlatRundownRelease(&Datapath->WorkerPool->Rundown);
CXPLAT_FREE(Datapath, QUIC_POOL_DATAPATH);
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/platform/datapath_kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ typedef struct CXPLAT_DATAPATH {
CXPLAT_UDP_DATAPATH_CALLBACKS UdpHandlers;

//
// The Worker manager
// The Worker pool
//
CXPLAT_WORKER_MANAGER* WorkerManager;
CXPLAT_WORKER_POOL* WorkerPool;

//
// Synchronization mechanism for cleanup.
Expand Down Expand Up @@ -413,7 +413,7 @@ CxPlatProcessorContextInitialize(
CXPLAT_DBG_ASSERT(Datapath != NULL);
DatapathPartition->Datapath = Datapath;
DatapathPartition->PartitionIndex = PartitionIndex;
DatapathPartition->EventQ = CxPlatWorkerGetEventQ(Datapath->WorkerManager, PartitionIndex);
DatapathPartition->EventQ = CxPlatWorkerPoolGetEventQ(Datapath->WorkerPool, PartitionIndex);
CxPlatRefInitialize(&DatapathPartition->RefCount);

CxPlatPoolInitialize(
Expand Down Expand Up @@ -443,7 +443,7 @@ CxPlatDataPathInitialize(
_In_ uint32_t ClientRecvDataLength,
_In_opt_ const CXPLAT_UDP_DATAPATH_CALLBACKS* UdpCallbacks,
_In_opt_ const CXPLAT_TCP_DATAPATH_CALLBACKS* TcpCallbacks,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ QUIC_EXECUTION_CONFIG* Config,
_Out_ CXPLAT_DATAPATH** NewDataPath
)
Expand All @@ -457,11 +457,11 @@ CxPlatDataPathInitialize(
return QUIC_STATUS_INVALID_PARAMETER;
}
}
if (WorkerManager == NULL) {
WorkerManager = &CxPlatWorkerManager;
if (WorkerPool == NULL) {
WorkerPool = &CxPlatDefaultWorkerPool;
}

if (!CxPlatWorkerLazyStart(WorkerManager, Config)) {
if (!CxPlatWorkerPoolLazyStart(WorkerPool, Config)) {
return QUIC_STATUS_OUT_OF_MEMORY;
}

Expand Down Expand Up @@ -489,7 +489,7 @@ CxPlatDataPathInitialize(
if (UdpCallbacks) {
Datapath->UdpHandlers = *UdpCallbacks;
}
Datapath->WorkerManager = WorkerManager;
Datapath->WorkerPool = WorkerPool;
Datapath->PartitionCount = 1; //PartitionCount; // Darwin only supports a single receiver
CxPlatRefInitializeEx(&Datapath->RefCount, Datapath->PartitionCount);

Expand All @@ -501,7 +501,7 @@ CxPlatDataPathInitialize(
&Datapath->Partitions[i]);
}

CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerManager->Rundown));
CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerPool->Rundown));
*NewDataPath = Datapath;

return QUIC_STATUS_SUCCESS;
Expand All @@ -519,7 +519,7 @@ CxPlatDataPathRelease(
CXPLAT_DBG_ASSERT(Datapath->Uninitialized);
Datapath->Freed = TRUE;
#endif
CxPlatRundownRelease(&Datapath->WorkerManager->Rundown);
CxPlatRundownRelease(&Datapath->WorkerPool->Rundown);
CXPLAT_FREE(Datapath, QUIC_POOL_DATAPATH);
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/platform/datapath_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RawDataPathInitialize(
_In_ uint32_t ClientRecvContextLength,
_In_opt_ QUIC_EXECUTION_CONFIG* Config,
_In_opt_ const CXPLAT_DATAPATH* ParentDataPath,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_Out_ CXPLAT_DATAPATH_RAW** NewDataPath
)
{
Expand All @@ -33,8 +33,8 @@ RawDataPathInitialize(
BOOLEAN DpRawInitialized = FALSE;
BOOLEAN SockPoolInitialized = FALSE;

if (WorkerManager == NULL) {
WorkerManager = &CxPlatWorkerManager;
if (WorkerPool == NULL) {
WorkerPool = &CxPlatDefaultWorkerPool;
}

if (NewDataPath == NULL) {
Expand All @@ -51,9 +51,9 @@ RawDataPathInitialize(
return QUIC_STATUS_OUT_OF_MEMORY;
}
CxPlatZeroMemory(DataPath, DatapathSize);
CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerManager->Rundown));
CXPLAT_FRE_ASSERT(CxPlatRundownAcquire(&WorkerPool->Rundown));

DataPath->WorkerManager = WorkerManager;
DataPath->WorkerPool = WorkerPool;

if (Config && (Config->Flags & QUIC_EXECUTION_CONFIG_FLAG_QTIP)) {
DataPath->UseTcp = TRUE;
Expand All @@ -65,7 +65,7 @@ RawDataPathInitialize(
}
SockPoolInitialized = TRUE;

Status = CxPlatDpRawInitialize(DataPath, ClientRecvContextLength, WorkerManager, Config);
Status = CxPlatDpRawInitialize(DataPath, ClientRecvContextLength, WorkerPool, Config);
if (QUIC_FAILED(Status)) {
goto Error;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ RawDataPathInitialize(
CxPlatSockPoolUninitialize(&DataPath->SocketPool);
}
CXPLAT_FREE(DataPath, QUIC_POOL_DATAPATH);
CxPlatRundownRelease(&WorkerManager->Rundown);
CxPlatRundownRelease(&WorkerPool->Rundown);
}
}

Expand Down Expand Up @@ -129,7 +129,7 @@ CxPlatDataPathUninitializeComplete(
Datapath->Freed = TRUE;
#endif
CxPlatSockPoolUninitialize(&Datapath->SocketPool);
CxPlatRundownRelease(&Datapath->WorkerManager->Rundown);
CxPlatRundownRelease(&Datapath->WorkerPool->Rundown);
CXPLAT_FREE(Datapath, QUIC_POOL_DATAPATH);
}

Expand Down
6 changes: 3 additions & 3 deletions src/platform/datapath_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ typedef struct CXPLAT_DATAPATH_RAW {
const CXPLAT_DATAPATH *ParentDataPath;

//
// The Worker manager
// The Worker pool
//
CXPLAT_WORKER_MANAGER* WorkerManager;
CXPLAT_WORKER_POOL* WorkerPool;

CXPLAT_SOCKET_POOL SocketPool;

Expand Down Expand Up @@ -112,7 +112,7 @@ QUIC_STATUS
CxPlatDpRawInitialize(
_Inout_ CXPLAT_DATAPATH_RAW* Datapath,
_In_ uint32_t ClientRecvContextLength,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ const QUIC_EXECUTION_CONFIG* Config
);

Expand Down
4 changes: 2 additions & 2 deletions src/platform/datapath_raw_dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ QUIC_STATUS
CxPlatDpRawInitialize(
_Inout_ CXPLAT_DATAPATH* Datapath,
_In_ uint32_t ClientRecvContextLength,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ const QUIC_EXECUTION_CONFIG* Config
)
{
UNREFERENCED_PARAMETER(WorkerManager);
UNREFERENCED_PARAMETER(WorkerPool);
DPDK_DATAPATH* Dpdk = (DPDK_DATAPATH*)Datapath;
CXPLAT_THREAD_CONFIG Config = {
0, 0, "DpdkMain", CxPlatDpdkMainThread, Dpdk
Expand Down
4 changes: 2 additions & 2 deletions src/platform/datapath_raw_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ RawDataPathInitialize(
_In_ uint32_t ClientRecvContextLength,
_In_opt_ QUIC_EXECUTION_CONFIG* Config,
_In_opt_ const CXPLAT_DATAPATH* ParentDataPath,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_Out_ CXPLAT_DATAPATH_RAW** DataPath
)
{
UNREFERENCED_PARAMETER(ClientRecvContextLength);
UNREFERENCED_PARAMETER(Config);
UNREFERENCED_PARAMETER(ParentDataPath);
UNREFERENCED_PARAMETER(WorkerManager);
UNREFERENCED_PARAMETER(WorkerPool);
UNREFERENCED_PARAMETER(DataPath);
return QUIC_STATUS_NOT_SUPPORTED;
}
Expand Down
10 changes: 5 additions & 5 deletions src/platform/datapath_raw_xdp_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,15 @@ QUIC_STATUS
CxPlatDpRawInitialize(
_Inout_ CXPLAT_DATAPATH_RAW* Datapath,
_In_ uint32_t ClientRecvContextLength,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ const QUIC_EXECUTION_CONFIG* Config
)
{
XDP_DATAPATH* Xdp = (XDP_DATAPATH*)Datapath;
QUIC_STATUS Status = QUIC_STATUS_SUCCESS;

if (WorkerManager == NULL) {
WorkerManager = &CxPlatWorkerManager;
if (WorkerPool == NULL) {
WorkerPool = &CxPlatDefaultWorkerPool;
}

CxPlatXdpReadConfig(Xdp);
Expand Down Expand Up @@ -796,7 +796,7 @@ CxPlatDpRawInitialize(
Partition->ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_XDP_SHUTDOWN;
CxPlatRefIncrement(&Xdp->RefCount);
CxPlatRundownAcquire(&Xdp->Rundown);
Partition->EventQ = CxPlatWorkerGetEventQ(WorkerManager, (uint16_t)i);
Partition->EventQ = CxPlatWorkerPoolGetEventQ(WorkerPool, (uint16_t)i);

if (!CxPlatSqeInitialize(
Partition->EventQ,
Expand Down Expand Up @@ -838,7 +838,7 @@ CxPlatDpRawInitialize(
Partition,
QueueCount);

CxPlatAddExecutionContext(WorkerManager, &Partition->Ec, Partition->PartitionIndex);
CxPlatAddExecutionContext(WorkerPool, &Partition->Ec, Partition->PartitionIndex);
}

Error:
Expand Down
10 changes: 5 additions & 5 deletions src/platform/datapath_raw_xdp_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,15 +980,15 @@ QUIC_STATUS
CxPlatDpRawInitialize(
_Inout_ CXPLAT_DATAPATH_RAW* Datapath,
_In_ uint32_t ClientRecvContextLength,
_In_opt_ CXPLAT_WORKER_MANAGER* WorkerManager,
_In_opt_ CXPLAT_WORKER_POOL* WorkerPool,
_In_opt_ const QUIC_EXECUTION_CONFIG* Config
)
{
XDP_DATAPATH* Xdp = (XDP_DATAPATH*)Datapath;
QUIC_STATUS Status;

if (WorkerManager == NULL) {
WorkerManager = &CxPlatWorkerManager;
if (WorkerPool == NULL) {
WorkerPool = &CxPlatDefaultWorkerPool;
}

CxPlatListInitializeHead(&Xdp->Interfaces);
Expand Down Expand Up @@ -1157,7 +1157,7 @@ CxPlatDpRawInitialize(
Partition->Ec.Context = &Xdp->Partitions[i];
Partition->ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN;
CxPlatRefIncrement(&Xdp->RefCount);
Partition->EventQ = CxPlatWorkerGetEventQ(WorkerManager, (uint16_t)i);
Partition->EventQ = CxPlatWorkerPoolGetEventQ(WorkerPool, (uint16_t)i);

uint32_t QueueCount = 0;
XDP_QUEUE* Queue = Partition->Queues;
Expand Down Expand Up @@ -1192,7 +1192,7 @@ CxPlatDpRawInitialize(
QueueCount);
UNREFERENCED_PARAMETER(QueueCount);

CxPlatAddExecutionContext(WorkerManager, &Partition->Ec, Partition->PartitionIndex);
CxPlatAddExecutionContext(WorkerPool, &Partition->Ec, Partition->PartitionIndex);
}
Status = QUIC_STATUS_SUCCESS;

Expand Down
Loading

0 comments on commit 3e6def5

Please sign in to comment.