From ee5f896958082107d014f2a663a945fd844b5f4b Mon Sep 17 00:00:00 2001 From: ami-GS <1991.daiki@gmail.com> Date: Tue, 12 Nov 2024 15:44:38 -0800 Subject: [PATCH] adjust newer xdp api restriction --- src/platform/datapath_raw_xdp_win.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/platform/datapath_raw_xdp_win.c b/src/platform/datapath_raw_xdp_win.c index 0e06443790..f5d0118c63 100644 --- a/src/platform/datapath_raw_xdp_win.c +++ b/src/platform/datapath_raw_xdp_win.c @@ -175,6 +175,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); @@ -189,6 +190,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)) { @@ -1268,16 +1272,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,