Skip to content

Commit

Permalink
adjust newer xdp api restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-GS committed Nov 12, 2024
1 parent 058c635 commit 4202c51
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/platform/datapath_raw_xdp_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ typedef struct XDP_DATAPATH {
BOOLEAN TxAlwaysPoke;
BOOLEAN SkipXsum;
BOOLEAN Running; // Signal to stop partitions.
// XDP_QEO_SET_FN *XdpQeoSet;

XDP_PARTITION Partitions[0];
} XDP_DATAPATH;
Expand Down Expand Up @@ -175,6 +174,7 @@ CxPlatGetRssQueueProcessors(
if (QUIC_FAILED(Status)) { return Status; }

XSK_UMEM_REG TxUmem = {0};
UINT32 EnableAffinity = 1;
TxUmem.Address = &TxPacket;
TxUmem.ChunkSize = sizeof(XDP_TX_PACKET);
TxUmem.Headroom = FIELD_OFFSET(XDP_TX_PACKET, FrameBuffer);
Expand All @@ -189,6 +189,9 @@ CxPlatGetRssQueueProcessors(
Status = XskSetSockopt(TxXsk, XSK_SOCKOPT_TX_COMPLETION_RING_SIZE, &TxRingSize, sizeof(TxRingSize));
if (QUIC_FAILED(Status)) { CloseHandle(TxXsk); return Status; }

Status = XskSetSockopt(TxXsk, XSK_SOCKOPT_TX_PROCESSOR_AFFINITY, &EnableAffinity, sizeof(EnableAffinity));
if (QUIC_FAILED(Status)) { CloseHandle(TxXsk); return Status; }

uint32_t Flags = XSK_BIND_FLAG_TX;
Status = XskBind(TxXsk, InterfaceIndex, i, Flags);
if (QUIC_FAILED(Status)) {
Expand Down Expand Up @@ -943,7 +946,6 @@ CxPlatDpRawInitialize(
}

CxPlatListInitializeHead(&Xdp->Interfaces);
// Xdp->XdpQeoSet = (XDP_QEO_SET_FN *)XdpGetRoutine(XDP_QEO_SET_FN_NAME);

CxPlatXdpReadConfig(Xdp);
Xdp->PollingIdleTimeoutUs = Config ? Config->PollingIdleTimeoutUs : 0;
Expand Down Expand Up @@ -1268,16 +1270,11 @@ RawSocketUpdateQeo(

BOOLEAN AtLeastOneSucceeded = FALSE;
for (CXPLAT_LIST_ENTRY* Entry = Xdp->Interfaces.Flink; Entry != &Xdp->Interfaces; Entry = Entry->Flink) {
// if (Xdp->XdpQeoSet != NULL) {
// Status =
// Xdp->XdpQeoSet(
// CONTAINING_RECORD(Entry, XDP_INTERFACE, Link)->XdpHandle,
// Connections,
// sizeof(Connections));
if (FALSE) {
} else {
Status = E_NOINTERFACE;
}
Status =
XdpQeoSet(
CONTAINING_RECORD(Entry, XDP_INTERFACE, Link)->XdpHandle,
Connections,
sizeof(Connections));
if (QUIC_FAILED(Status)) {
QuicTraceEvent(
LibraryErrorStatus,
Expand Down

0 comments on commit 4202c51

Please sign in to comment.