XDP TX fix
Remove the workaround in QUIC for XDP TX hangs. XDP version updated to 0.16.1.
@@ -391,7 +391,7 @@ CxPlatXdpReadConfig(
Xdp->RxRingSize = 128;
Xdp->TxBufferCount = 4096;
Xdp->TxRingSize = 128;
- Xdp->TxAlwaysPoke = TRUE;
+ Xdp->TxAlwaysPoke = FALSE;
//
// Read config from config file.
@@ -621,8 +621,8 @@ CxPlatDpRawInterfaceInitialize(
goto Error;
}
- uint32_t Flags = 0; // TODO: support native/generic forced flags.
- Status = XskBind(Queue->RxXsk, Interface->IfIndex, i, Flags, NULL);
+ uint32_t Flags = XSK_BIND_RX;
+ Status = XskBind(Queue->RxXsk, Interface->IfIndex, i, Flags);
if (QUIC_FAILED(Status)) {
QuicTraceEvent(
LibraryErrorStatus,
@@ -632,6 +632,16 @@ CxPlatDpRawInterfaceInitialize(
goto Error;
}
+ Status = XskActivate(Queue->RxXsk, 0, NULL);
+ if (QUIC_FAILED(Status)) {
+ QuicTraceEvent(
+ LibraryErrorStatus,
+ "[ lib] ERROR, %u, %s.",
+ Status,
+ "XskActivate");
+ goto Error;
+ }
+
XSK_RING_INFO_SET RxRingInfo;
uint32_t RxRingInfoSize = sizeof(RxRingInfo);
Status = XskGetSockopt(Queue->RxXsk, XSK_SOCKOPT_RING_INFO, &RxRingInfo, &RxRingInfoSize);
@@ -718,8 +728,8 @@ CxPlatDpRawInterfaceInitialize(
goto Error;
}
- Flags = 0; // TODO: support native/generic forced flags.
- Status = XskBind(Queue->TxXsk, Interface->IfIndex, i, Flags, NULL);
+ Flags = XSK_BIND_TX; // TODO: support native/generic forced flags.
+ Status = XskBind(Queue->TxXsk, Interface->IfIndex, i, Flags);
if (QUIC_FAILED(Status)) {
QuicTraceEvent(
LibraryErrorStatus,
@@ -729,6 +739,16 @@ CxPlatDpRawInterfaceInitialize(
goto Error;
}
+ Status = XskActivate(Queue->TxXsk, 0, NULL);
+ if (QUIC_FAILED(Status)) {
+ QuicTraceEvent(
+ LibraryErrorStatus,
+ "[ lib] ERROR, %u, %s.",
+ Status,
+ "XskActivate");
+ goto Error;
+ }
+
XSK_RING_INFO_SET TxRingInfo;
uint32_t TxRingInfoSize = sizeof(TxRingInfo);
Status = XskGetSockopt(Queue->TxXsk, XSK_SOCKOPT_RING_INFO, &TxRingInfo, &TxRingInfoSize);
@@ -1454,9 +1474,8 @@ CxPlatXdpTx(
ProdCount++;
}
- uint32_t TxIndexQuery;
if (ProdCount > 0 ||
- (CompCount > 0 && XskRingProducerReserve(&Queue->TxRing, MAXUINT32, &TxIndexQuery) != Queue->TxRing.size)) {
+ (CompCount > 0 && XskRingProducerReserve(&Queue->TxRing, MAXUINT32, &TxIndex) != Queue->TxRing.size)) {
XskRingProducerSubmit(&Queue->TxRing, ProdCount);
if (Xdp->TxAlwaysPoke || XskRingProducerNeedPoke(&Queue->TxRing)) {
uint32_t OutFlags;
