Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align XDP Queues with RSS Better #4484

Merged
merged 20 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/generated/linux/datapath_raw_xdp_win.c.clog.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpPartitionShutdownComplete , arg2);\
// QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
ret,
"ConvertInterfaceIndexToLuid");
// arg2 = arg2 = ret = arg2
// arg3 = arg3 = "ConvertInterfaceIndexToLuid" = arg3
Status,
"XdpInterfaceOpen");
// arg2 = arg2 = Status = arg2
// arg3 = arg3 = "XdpInterfaceOpen" = arg3
----------------------------------------------------------*/
#ifndef _clog_4_ARGS_TRACE_LibraryErrorStatus
#define _clog_4_ARGS_TRACE_LibraryErrorStatus(uniqueId, encoded_arg_string, arg2, arg3)\
Expand Down
8 changes: 4 additions & 4 deletions src/generated/linux/datapath_raw_xdp_win.c.clog.h.lttng.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpPartitionShutdownComplete,
// QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
ret,
"ConvertInterfaceIndexToLuid");
// arg2 = arg2 = ret = arg2
// arg3 = arg3 = "ConvertInterfaceIndexToLuid" = arg3
Status,
"XdpInterfaceOpen");
// arg2 = arg2 = Status = arg2
// arg3 = arg3 = "XdpInterfaceOpen" = arg3
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, LibraryErrorStatus,
TP_ARGS(
Expand Down
5 changes: 4 additions & 1 deletion src/platform/datapath_raw_xdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ typedef struct QUIC_CACHEALIGN XDP_PARTITION {
CXPLAT_EVENTQ* EventQ;
XDP_QUEUE* Queues; // A linked list of queues, accessed by Next.
uint16_t PartitionIndex;
uint16_t Processor;
} XDP_PARTITION;

void XdpWorkerAddQueue(_In_ XDP_PARTITION* Partition, _In_ XDP_QUEUE* Queue) {
Expand All @@ -78,7 +79,9 @@ CxPlatDpRawAssignQueue(
)
{
const XDP_INTERFACE_COMMON* Interface = (const XDP_INTERFACE_COMMON*)_Interface;
Route->Queue = &((XDP_QUEUE_COMMON*)Interface->Queues)[0];
XDP_QUEUE_COMMON* Queues = (XDP_QUEUE_COMMON*)Interface->Queues;
CXPLAT_FRE_ASSERT(Queues[0].Partition != NULL); // What if there was no partition?
Route->Queue = &Queues[0]; // TODO - Can we do better than just the first queue?
}

_IRQL_requires_max_(DISPATCH_LEVEL)
Expand Down
8 changes: 7 additions & 1 deletion src/platform/datapath_raw_xdp_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static uint64_t XskUmemFrameAlloc(struct XskSocketInfo *Xsk)
if (Xsk->UmemFrameFree == 0) {
QuicTraceLogVerbose(
XdpUmemAllocFails,
"[ xdp][umem] Out of UMEM frame, OOM");
"[ xdp][umem] Out of UMEM frame, OOM");
return INVALID_UMEM_FRAME;
}
Frame = Xsk->UmemFrameAddr[--Xsk->UmemFrameFree];
Expand Down Expand Up @@ -684,8 +684,14 @@ CxPlatDpRawInitialize(

if (Config && Config->ProcessorCount) {
Xdp->PartitionCount = Config->ProcessorCount;
for (uint32_t i = 0; i < Xdp->PartitionCount; i++) {
Xdp->Partitions[i].Processor = Config->ProcessorList[i];
}
} else {
Xdp->PartitionCount = CxPlatProcCount();
for (uint32_t i = 0; i < Xdp->PartitionCount; i++) {
Xdp->Partitions[i].Processor = (uint16_t)i;
}
}

QuicTraceLogVerbose(
Expand Down
Loading
Loading