@@ -30,6 +30,19 @@ QuicLibraryEvaluateSendRetryState(
30
30
void
31
31
);
32
32
33
+ CXPLAT_DATAPATH_FEATURES
34
+ QuicLibraryGetDatapathFeatures (
35
+ void
36
+ )
37
+ {
38
+ CXPLAT_SOCKET_FLAGS SocketFlags = CXPLAT_SOCKET_FLAG_NONE ;
39
+ if (MsQuicLib .Settings .XdpEnabled ) {
40
+ SocketFlags |= CXPLAT_SOCKET_FLAG_XDP ;
41
+ }
42
+ CXPLAT_DBG_ASSERT (MsQuicLib .Datapath != NULL );
43
+ return CxPlatDataPathGetSupportedFeatures (MsQuicLib .Datapath , SocketFlags );
44
+ }
45
+
33
46
//
34
47
// Initializes all global variables if not already done.
35
48
//
@@ -700,13 +713,18 @@ QuicLibraryLazyInitialize(
700
713
& DatapathCallbacks ,
701
714
NULL , // TcpCallbacks
702
715
MsQuicLib .WorkerPool ,
703
- MsQuicLib .ExecutionConfig ,
704
716
& MsQuicLib .Datapath );
705
717
if (QUIC_SUCCEEDED (Status )) {
706
718
QuicTraceEvent (
707
719
DataPathInitialized ,
708
720
"[data] Initialized, DatapathFeatures=%u" ,
709
- CxPlatDataPathGetSupportedFeatures (MsQuicLib .Datapath ));
721
+ QuicLibraryGetDatapathFeatures ());
722
+ if (MsQuicLib .ExecutionConfig &&
723
+ MsQuicLib .ExecutionConfig -> PollingIdleTimeoutUs != 0 ) {
724
+ CxPlatDataPathUpdatePollingIdleTimeout (
725
+ MsQuicLib .Datapath ,
726
+ MsQuicLib .ExecutionConfig -> PollingIdleTimeoutUs );
727
+ }
710
728
} else {
711
729
MsQuicLibraryFreePartitions ();
712
730
#ifndef _KERNEL_MODE
@@ -839,6 +857,8 @@ QuicLibrarySetGlobalParam(
839
857
QUIC_STATUS Status = QUIC_STATUS_SUCCESS ;
840
858
QUIC_SETTINGS_INTERNAL InternalSettings = {0 };
841
859
860
+ CXPLAT_DBG_ASSERT (MsQuicLib .Loaded );
861
+
842
862
switch (Param ) {
843
863
case QUIC_PARAM_GLOBAL_RETRY_MEMORY_PERCENT :
844
864
@@ -1040,13 +1060,9 @@ QuicLibrarySetGlobalParam(
1040
1060
CXPLAT_DBG_ASSERT (MsQuicLib .Partitions != NULL );
1041
1061
CXPLAT_DBG_ASSERT (MsQuicLib .Datapath != NULL );
1042
1062
1043
- if (MsQuicLib .ExecutionConfig == NULL ) {
1044
- Status = QUIC_STATUS_INVALID_STATE ;
1045
- } else {
1046
- MsQuicLib .ExecutionConfig -> PollingIdleTimeoutUs = Config -> PollingIdleTimeoutUs ;
1047
- CxPlatDataPathUpdateConfig (MsQuicLib .Datapath , MsQuicLib .ExecutionConfig );
1048
- Status = QUIC_STATUS_SUCCESS ;
1049
- }
1063
+ CxPlatDataPathUpdatePollingIdleTimeout (
1064
+ MsQuicLib .Datapath , Config -> PollingIdleTimeoutUs );
1065
+ Status = QUIC_STATUS_SUCCESS ;
1050
1066
CxPlatLockRelease (& MsQuicLib .Lock );
1051
1067
break ;
1052
1068
}
@@ -1188,6 +1204,8 @@ QuicLibraryGetGlobalParam(
1188
1204
QUIC_STATUS Status ;
1189
1205
uint32_t GitHashLength ;
1190
1206
1207
+ CXPLAT_DBG_ASSERT (MsQuicLib .Loaded );
1208
+
1191
1209
switch (Param ) {
1192
1210
case QUIC_PARAM_GLOBAL_RETRY_MEMORY_PERCENT :
1193
1211
@@ -1379,7 +1397,7 @@ QuicLibraryGetGlobalParam(
1379
1397
Status = QUIC_STATUS_SUCCESS ;
1380
1398
break ;
1381
1399
1382
- case QUIC_PARAM_GLOBAL_DATAPATH_FEATURES :
1400
+ case QUIC_PARAM_GLOBAL_DATAPATH_FEATURES : {
1383
1401
if (* BufferLength < sizeof (uint32_t )) {
1384
1402
* BufferLength = sizeof (uint32_t );
1385
1403
Status = QUIC_STATUS_BUFFER_TOO_SMALL ;
@@ -1397,10 +1415,11 @@ QuicLibraryGetGlobalParam(
1397
1415
}
1398
1416
1399
1417
* BufferLength = sizeof (uint32_t );
1400
- * (uint32_t * )Buffer = CxPlatDataPathGetSupportedFeatures ( MsQuicLib . Datapath );
1418
+ * (uint32_t * )Buffer = QuicLibraryGetDatapathFeatures ( );
1401
1419
1402
1420
Status = QUIC_STATUS_SUCCESS ;
1403
1421
break ;
1422
+ }
1404
1423
1405
1424
case QUIC_PARAM_GLOBAL_VERSION_NEGOTIATION_ENABLED :
1406
1425
@@ -2040,7 +2059,7 @@ QuicLibraryGetBinding(
2040
2059
// one and already create the binding.
2041
2060
//
2042
2061
2043
- if (CxPlatDataPathGetSupportedFeatures ( MsQuicLib . Datapath ) & CXPLAT_DATAPATH_FEATURE_LOCAL_PORT_SHARING ) {
2062
+ if (QuicLibraryGetDatapathFeatures ( ) & CXPLAT_DATAPATH_FEATURE_LOCAL_PORT_SHARING ) {
2044
2063
//
2045
2064
// The datapath supports multiple connected sockets on the same local
2046
2065
// tuple, so we need to do collision detection based on the whole
@@ -2275,7 +2294,7 @@ QuicTraceRundown(
2275
2294
QuicTraceEvent (
2276
2295
DataPathRundown ,
2277
2296
"[data] Rundown, DatapathFeatures=%u" ,
2278
- CxPlatDataPathGetSupportedFeatures ( MsQuicLib . Datapath ));
2297
+ QuicLibraryGetDatapathFeatures ( ));
2279
2298
}
2280
2299
2281
2300
QuicTraceEvent (
0 commit comments