From 40751ee0b0f357db9e873f82bed8eb4cb2dbc319 Mon Sep 17 00:00:00 2001 From: Thad House Date: Tue, 23 Mar 2021 14:05:41 -0700 Subject: [PATCH] Rename quicperf to netsecperf (#1368) * Rename quicperf to netsecperf Since TCP is now included, its now a network security perf test tool, not just quic perf * Fix file names * Fix clog * 1 more name fix --- docs/PGO.md | 18 +-- msquic.kernel.sln | 4 +- scripts/FullRunRPS.json | 4 +- scripts/RemoteTests.json | 18 +-- scripts/TcpTests.json | 4 +- scripts/emulated-performance.ps1 | 20 +-- scripts/performance-helper.psm1 | 10 +- scripts/rps.ps1 | 2 +- src/perf/bin/CMakeLists.txt | 6 +- src/perf/bin/appmain.cpp | 4 +- src/perf/bin/drvmain.cpp | 146 +++++++++--------- ...cxproj => secnetperfdriver.kernel.vcxproj} | 2 +- ...oj => secnetperfdriverpriv.kernel.vcxproj} | 2 +- src/perf/lib/CMakeLists.txt | 2 +- .../lib/{quicmain.cpp => SecNetPerfMain.cpp} | 20 +-- src/perf/lib/perflib.kernel.vcxproj | 2 +- 16 files changed, 132 insertions(+), 132 deletions(-) rename src/perf/bin/{quicperfdriver.kernel.vcxproj => secnetperfdriver.kernel.vcxproj} (99%) rename src/perf/bin/{quicperfdriverpriv.kernel.vcxproj => secnetperfdriverpriv.kernel.vcxproj} (99%) rename src/perf/lib/{quicmain.cpp => SecNetPerfMain.cpp} (93%) diff --git a/docs/PGO.md b/docs/PGO.md index 093240001..94d39a98a 100644 --- a/docs/PGO.md +++ b/docs/PGO.md @@ -23,7 +23,7 @@ A fundamental part of profile-guided optimizations is training. The code is run 1. [Build for training](#build-for-training). 2. Copy the binaries to the test machine(s). 1. The PGO msquic library. - 2. The test tool (e.g. `quicperf`). + 2. The test tool (e.g. `secnetperf`). 3. The PGO runtime library from your VS install: (e.g. `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64\pgort140.dll"`). 3. Run the test for the production/performance scenario. 4. Use [pgomgr](https://docs.microsoft.com/en-us/cpp/build/pgomgr) to merge the `.pgc` into the `.pgd`. @@ -78,7 +78,7 @@ Then build user mode MsQuic using the regular script with the following flags `- ## Setting up the perf machines -To train kernel mode PGO, we use the `quicperf` utility. To configure the perf machines, run the following powershell script as Administrator: +To train kernel mode PGO, we use the `secnetperf` utility. To configure the perf machines, run the following powershell script as Administrator: ```ps1 param( # Build path @@ -141,12 +141,12 @@ if (!(Test-Path -Path "c:\msquic\$($WinKernelBinPath)")) { } Copy-Item -Path "$($MsQuicPath)\$($WindowsBinPath)\msquic.dll" -Destination "c:\msquic\$($WinKernelBinPath)" -Copy-Item -Path "$($MsQuicPath)\$($WindowsBinPath)\quicperf.exe" -Destination "c:\msquic\$($WinKernelBinPath)" +Copy-Item -Path "$($MsQuicPath)\$($WindowsBinPath)\secnetperf.exe" -Destination "c:\msquic\$($WinKernelBinPath)" Copy-Item -Path "$($MsQuicPath)\$($WinKernelBinPath)\*" -Destination "c:\msquic\$($WinKernelBinPath)" sc.exe create "msquicpriv" type= kernel binpath= "C:\msquic\$($WinKernelBinPath)\msquicpriv.sys" start= demand -New-NetFirewallRule -DisplayName "Allow QuicPerf" -Enabled True -Profile Any -Direction Inbound -Action Allow -Protocol UDP -LocalPort 4433 +New-NetFirewallRule -DisplayName "Allow SecNetPerf" -Enabled True -Profile Any -Direction Inbound -Action Allow -Protocol UDP -LocalPort 4433 bcdedit /debug on @@ -160,7 +160,7 @@ Now that the perf machines are configured for kernel mode PGO, it's time to run On the machine that will act as server, run the following command to start the server: ``` -quicperf.exe -kernel +secnetperf.exe -kernel ``` Once running, clear the PGO counts on both the client and server machines to get a clean slate: @@ -172,10 +172,10 @@ del msquicpriv.pgc On the machine acting as client, run the following commands to generate traffic: ``` -quicperf.exe --kernel -test:tput -target: -upload:5000000000 -quicperf.exe --kernel -test:tput -target: -download:5000000000 -quicperf.exe --kernel -test:RPS -target: -quicperf.exe --kernel -test:HPS -target: +secnetperf.exe --kernel -test:tput -target: -upload:5000000000 +secnetperf.exe --kernel -test:tput -target: -download:5000000000 +secnetperf.exe --kernel -test:RPS -target: +secnetperf.exe --kernel -test:HPS -target: ``` After the client finishes all scenarios, run this again on the client and the server to collect the updated counts: diff --git a/msquic.kernel.sln b/msquic.kernel.sln index 266ee8def..ade12fb84 100644 --- a/msquic.kernel.sln +++ b/msquic.kernel.sln @@ -20,13 +20,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manifest.kernel", "src\mani EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perflib.kernel", "src\perf\lib\perflib.kernel.vcxproj", "{11633785-79CC-4C7D-AB6A-AECDF29A1FA7}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quicperfdriverpriv.kernel", "src\perf\bin\quicperfdriverpriv.kernel.vcxproj", "{2BE64DBF-60E6-4FE8-96B0-5F2526405096}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "secnetperfdriverpriv.kernel", "src\perf\bin\secnetperfdriverpriv.kernel.vcxproj", "{2BE64DBF-60E6-4FE8-96B0-5F2526405096}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msquicpriv.kernel", "src\bin\winkernel\msquicpriv.kernel.vcxproj", "{E2DDB0A8-594D-424D-9ADD-4EF211F7FC3F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msquictestpriv.kernel", "src\test\bin\winkernel\msquictestpriv.kernel.vcxproj", "{C8491270-B0BE-440C-B88D-7B441A8CB67E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quicperfdriver.kernel", "src\perf\bin\quicperfdriver.kernel.vcxproj", "{1862CCD7-31D7-4869-A409-5B9B5EDF19BB}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "secnetperfdriver.kernel", "src\perf\bin\secnetperfdriver.kernel.vcxproj", "{1862CCD7-31D7-4869-A409-5B9B5EDF19BB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/scripts/FullRunRPS.json b/scripts/FullRunRPS.json index e05fbb0c6..1a518e1a1 100644 --- a/scripts/FullRunRPS.json +++ b/scripts/FullRunRPS.json @@ -1,6 +1,6 @@ { "Remote": { - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "" }, "FullMatrix": true, @@ -11,7 +11,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:RPS -target:$RemoteAddress" }, "Variables": [ diff --git a/scripts/RemoteTests.json b/scripts/RemoteTests.json index 9994707a7..103c10137 100644 --- a/scripts/RemoteTests.json +++ b/scripts/RemoteTests.json @@ -1,6 +1,6 @@ { "Remote": { - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "" }, "FullMatrix": false, @@ -11,7 +11,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -upload:2000000000" }, "Variables": [ @@ -45,7 +45,7 @@ "Platform": "linux", "Tls": ["stub", "openssl"], "Arch": ["x64", "arm"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:Throughput -target:$RemoteAddress -uni:1 -upload:2000000000" }, "Variables": [ @@ -79,7 +79,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -download:2000000000" }, "Variables": [ @@ -105,7 +105,7 @@ "Platform": "linux", "Tls": ["stub", "openssl"], "Arch": ["x64", "arm"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:Throughput -target:$RemoteAddress -uni:1 -download:2000000000" }, "Variables": [ @@ -131,7 +131,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:RPS -target:$RemoteAddress" }, "Variables": [ @@ -174,7 +174,7 @@ "Platform": "linux", "Tls": ["stub", "openssl"], "Arch": ["x64", "arm"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:RPS -target:$RemoteAddress" }, "Variables": [ @@ -217,7 +217,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:HPS -target:$RemoteAddress" }, "Variables": [], @@ -234,7 +234,7 @@ "Platform": "linux", "Tls": ["stub", "openssl"], "Arch": ["x64", "arm"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:HPS -target:$RemoteAddress" }, "Variables": [], diff --git a/scripts/TcpTests.json b/scripts/TcpTests.json index 2c799565e..a1b65f967 100644 --- a/scripts/TcpTests.json +++ b/scripts/TcpTests.json @@ -1,6 +1,6 @@ { "Remote": { - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "" }, "FullMatrix": false, @@ -11,7 +11,7 @@ "Platform": "Windows", "Tls": ["stub", "schannel", "openssl", "mitls"], "Arch": ["x64", "x86", "arm", "arm64"], - "Exe": "quicperf", + "Exe": "secnetperf", "Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -upload:2000000000 -tcp:1" }, "Variables": [ diff --git a/scripts/emulated-performance.ps1 b/scripts/emulated-performance.ps1 index b6059e12a..d4b12d43a 100644 --- a/scripts/emulated-performance.ps1 +++ b/scripts/emulated-performance.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS This script runs performance tests with various emulated network conditions. Note, -this script requires duonic to be preinstalled on the system and quicperf.exe to +this script requires duonic to be preinstalled on the system and secnetperf.exe to be in the current directory. .PARAMETER Config @@ -276,23 +276,23 @@ if ($LogProfile -ne "None") { $Platform = $IsWindows ? "windows" : "linux" $PlatformName = (($IsWindows ? "Windows" : "Linux") + "_$($Arch)_$($Tls)") -# Path to the quicperf exectuable. -$ExeName = $IsWindows ? "quicperf.exe" : "quicperf" -$QuicPerf = Join-Path $RootDir "artifacts" "bin" $Platform "$($Arch)_$($Config)_$($Tls)" $ExeName +# Path to the secnetperf exectuable. +$ExeName = $IsWindows ? "secnetperf.exe" : "secnetperf" +$SecNetPerf = Join-Path $RootDir "artifacts" "bin" $Platform "$($Arch)_$($Config)_$($Tls)" $ExeName Get-NetAdapter | Write-Debug ipconfig -all | Write-Debug # Make sure to kill any old processes -try { Stop-Process -Name quicperf } catch { } +try { Stop-Process -Name secnetperf } catch { } # Start the perf server listening. Write-Debug "Starting server..." -if (!(Test-Path -Path $QuicPerf)) { - Write-Error "Missing file: $QuicPerf" +if (!(Test-Path -Path $SecNetPerf)) { + Write-Error "Missing file: $SecNetPerf" } $pinfo = New-Object System.Diagnostics.ProcessStartInfo -$pinfo.FileName = $QuicPerf +$pinfo.FileName = $SecNetPerf $pinfo.UseShellExecute = $false $pinfo.RedirectStandardOutput = $true $pinfo.RedirectStandardError = $true @@ -392,7 +392,7 @@ foreach ($ThisReorderDelayDeltaMs in $ReorderDelayDeltaMs) { Write-Debug "Run upload test: Iteration=$($i + 1)" $Rate = 0 - $Command = "$QuicPerf -test:tput -tcp:$UseTcp -maxruntime:$MaxRuntimeMs -bind:192.168.1.12 -target:192.168.1.11 -sendbuf:0 -upload:$ThisDurationMs -timed:1 -pacing:$ThisPacing" + $Command = "$SecNetPerf -test:tput -tcp:$UseTcp -maxruntime:$MaxRuntimeMs -bind:192.168.1.12 -target:192.168.1.11 -sendbuf:0 -upload:$ThisDurationMs -timed:1 -pacing:$ThisPacing" Write-Debug $Command $Output = [string](Invoke-Expression $Command) Write-Debug $Output @@ -454,4 +454,4 @@ foreach ($ThisReorderDelayDeltaMs in $ReorderDelayDeltaMs) { $RunResults | ConvertTo-Json -Depth 100 | Out-File $OutputFile # Kill any leftovers. -try { Stop-Process -Name quicperf } catch { } +try { Stop-Process -Name secnetperf } catch { } diff --git a/scripts/performance-helper.psm1 b/scripts/performance-helper.psm1 index d4756cd9b..54163cf17 100644 --- a/scripts/performance-helper.psm1 +++ b/scripts/performance-helper.psm1 @@ -350,12 +350,12 @@ function Get-ExeName { function Remove-PerfServices { if ($IsWindows) { Invoke-TestCommand -Session $Session -ScriptBlock { - if ($null -ne (Get-Service -Name "quicperfdrvpriv" -ErrorAction Ignore)) { + if ($null -ne (Get-Service -Name "secnetperfdrvpriv" -ErrorAction Ignore)) { try { - net.exe stop quicperfdrvpriv /y | Out-Null + net.exe stop secnetperfdrvpriv /y | Out-Null } catch {} - sc.exe delete quicperfdrvpriv /y | Out-Null + sc.exe delete secnetperfdrvpriv /y | Out-Null } if ($null -ne (Get-Service -Name "msquicpriv" -ErrorAction Ignore)) { try { @@ -410,7 +410,7 @@ function Invoke-RemoteExe { $KernelDir = Join-Path $RootBinPath "winkernel" $Arch if ($Kernel) { - Copy-Item (Join-Path $KernelDir "quicperfdrvpriv.sys") (Split-Path $Exe -Parent) + Copy-Item (Join-Path $KernelDir "secnetperfdrvpriv.sys") (Split-Path $Exe -Parent) Copy-Item (Join-Path $KernelDir "msquicpriv.sys") (Split-Path $Exe -Parent) sc.exe create "msquicpriv" type= kernel binpath= (Join-Path (Split-Path $Exe -Parent) "msquicpriv.sys") start= demand | Out-Null net.exe start msquicpriv @@ -421,7 +421,7 @@ function Invoke-RemoteExe { # Uninstall the kernel mode test driver and revert the msquic driver. if ($Kernel) { net.exe stop msquicpriv /y | Out-Null - sc.exe delete quicperfdrvpriv | Out-Null + sc.exe delete secnetperfdrvpriv | Out-Null sc.exe delete msquicpriv | Out-Null } diff --git a/scripts/rps.ps1 b/scripts/rps.ps1 index ac751948f..dc45bc131 100644 --- a/scripts/rps.ps1 +++ b/scripts/rps.ps1 @@ -29,7 +29,7 @@ for ($Conns=100; $Conns -le 1000; $Conns+=100) { $Requests = $Conns * $RequestsPerConn Write-Host "==$($Conns)c$($Requests)r==" for ($i=0; $i -lt $Iterations; $i++) { - (.\quicperf.exe ` + (.\secnetperf.exe ` -Test:RPS ` -Target:$Target ` -conns:$Conns ` diff --git a/src/perf/bin/CMakeLists.txt b/src/perf/bin/CMakeLists.txt index 740b4b76b..312dc8805 100644 --- a/src/perf/bin/CMakeLists.txt +++ b/src/perf/bin/CMakeLists.txt @@ -8,8 +8,8 @@ set(SOURCES # Allow CLOG to preprocess all the source files. add_clog_library(perfbin.clog STATIC ${SOURCES}) -add_executable(quicperf ${SOURCES} histogram/hdr_histogram.c) +add_executable(secnetperf ${SOURCES} histogram/hdr_histogram.c) -set_property(TARGET quicperf PROPERTY FOLDER "perf") +set_property(TARGET secnetperf PROPERTY FOLDER "perf") -target_link_libraries(quicperf inc warnings perflib msquic platform perfbin.clog) +target_link_libraries(secnetperf inc warnings perflib msquic platform perfbin.clog) diff --git a/src/perf/bin/appmain.cpp b/src/perf/bin/appmain.cpp index cee85513e..eb689173f 100644 --- a/src/perf/bin/appmain.cpp +++ b/src/perf/bin/appmain.cpp @@ -27,8 +27,8 @@ typedef struct { } QUIC_RUN_CERTIFICATE_PARAMS; #include "quic_driver_helpers.h" -#define QUIC_DRIVER_NAME "quicperfdrv" -#define QUIC_DRIVER_NAME_PRIVATE "quicperfdrvpriv" +#define QUIC_DRIVER_NAME "secnetperfdrv" +#define QUIC_DRIVER_NAME_PRIVATE "secnetperfdrvpriv" #endif diff --git a/src/perf/bin/drvmain.cpp b/src/perf/bin/drvmain.cpp index 059226767..3b6389a15 100644 --- a/src/perf/bin/drvmain.cpp +++ b/src/perf/bin/drvmain.cpp @@ -18,11 +18,11 @@ Abstract: #endif #ifdef PRIVATE_LIBRARY -DECLARE_CONST_UNICODE_STRING(QuicPerfCtlDeviceName, L"\\Device\\quicperfdrv"); -DECLARE_CONST_UNICODE_STRING(QuicPerfCtlDeviceSymLink, L"\\DosDevices\\quicperfdrvpriv"); +DECLARE_CONST_UNICODE_STRING(SecNetPerfCtlDeviceName, L"\\Device\\secnetperfdrv"); +DECLARE_CONST_UNICODE_STRING(SecNetPerfCtlDeviceSymLink, L"\\DosDevices\\secnetperfdrvpriv"); #else -DECLARE_CONST_UNICODE_STRING(QuicPerfCtlDeviceName, L"\\Device\\quicperfdrv"); -DECLARE_CONST_UNICODE_STRING(QuicPerfCtlDeviceSymLink, L"\\DosDevices\\quicperfdrvpriv"); +DECLARE_CONST_UNICODE_STRING(SecNetPerfCtlDeviceName, L"\\Device\\secnetperfdrv"); +DECLARE_CONST_UNICODE_STRING(SecNetPerfCtlDeviceSymLink, L"\\DosDevices\\secnetperfdrvpriv"); #endif typedef struct QUIC_DEVICE_EXTENSION { @@ -34,7 +34,7 @@ typedef struct QUIC_DEVICE_EXTENSION { } QUIC_DEVICE_EXTENSION; -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUIC_DEVICE_EXTENSION, QuicPerfCtlGetDeviceContext); +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUIC_DEVICE_EXTENSION, SecNetPerfCtlGetDeviceContext); typedef struct QUIC_DRIVER_CLIENT { LIST_ENTRY Link; @@ -49,32 +49,32 @@ typedef struct QUIC_DRIVER_CLIENT { CXPLAT_LOCK CleanupLock; } QUIC_DRIVER_CLIENT; -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUIC_DRIVER_CLIENT, QuicPerfCtlGetFileContext); +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUIC_DRIVER_CLIENT, SecNetPerfCtlGetFileContext); -EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL QuicPerfCtlEvtIoDeviceControl; -EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE QuicPerfCtlEvtIoQueueCanceled; -EVT_WDF_REQUEST_CANCEL QuicPerfCtlEvtIoCanceled; +EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL SecNetPerfCtlEvtIoDeviceControl; +EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE SecNetPerfCtlEvtIoQueueCanceled; +EVT_WDF_REQUEST_CANCEL SecNetPerfCtlEvtIoCanceled; -PAGEDX EVT_WDF_DEVICE_FILE_CREATE QuicPerfCtlEvtFileCreate; -PAGEDX EVT_WDF_FILE_CLOSE QuicPerfCtlEvtFileClose; -PAGEDX EVT_WDF_FILE_CLEANUP QuicPerfCtlEvtFileCleanup; +PAGEDX EVT_WDF_DEVICE_FILE_CREATE SecNetPerfCtlEvtFileCreate; +PAGEDX EVT_WDF_FILE_CLOSE SecNetPerfCtlEvtFileClose; +PAGEDX EVT_WDF_FILE_CLEANUP SecNetPerfCtlEvtFileCleanup; -WDFDEVICE QuicPerfCtlDevice = nullptr; -QUIC_DEVICE_EXTENSION* QuicPerfCtlExtension = nullptr; -QUIC_DRIVER_CLIENT* QuicPerfClient = nullptr; +WDFDEVICE SecNetPerfCtlDevice = nullptr; +QUIC_DEVICE_EXTENSION* SecNetPerfCtlExtension = nullptr; +QUIC_DRIVER_CLIENT* SecNetPerfClient = nullptr; -EVT_WDF_DRIVER_UNLOAD QuicPerfDriverUnload; +EVT_WDF_DRIVER_UNLOAD SecNetPerfDriverUnload; _No_competing_thread_ INITCODE NTSTATUS -QuicPerfCtlInitialize( +SecNetPerfCtlInitialize( _In_ WDFDRIVER Driver ); _IRQL_requires_max_(PASSIVE_LEVEL) void -QuicPerfCtlUninitialize( +SecNetPerfCtlUninitialize( void ); @@ -155,7 +155,7 @@ DriverEntry( // Create the WdfDriver Object // WDF_DRIVER_CONFIG_INIT(&Config, NULL); - Config.EvtDriverUnload = QuicPerfDriverUnload; + Config.EvtDriverUnload = SecNetPerfDriverUnload; Config.DriverInitFlags = WdfDriverInitNonPnpDriver; Config.DriverPoolTag = QUIC_POOL_PERF; @@ -178,7 +178,7 @@ DriverEntry( // // Initialize the device control interface. // - Status = QuicPerfCtlInitialize(Driver); + Status = SecNetPerfCtlInitialize(Driver); if (!NT_SUCCESS(Status)) { goto Error; } @@ -203,13 +203,13 @@ _Function_class_(EVT_WDF_DRIVER_UNLOAD) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) void -QuicPerfDriverUnload( +SecNetPerfDriverUnload( _In_ WDFDRIVER /*Driver*/ ) { NT_ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); - QuicPerfCtlUninitialize(); + SecNetPerfCtlUninitialize(); QuicTraceLogInfo( PerfDriverStopped, @@ -222,7 +222,7 @@ QuicPerfDriverUnload( _No_competing_thread_ INITCODE NTSTATUS -QuicPerfCtlInitialize( +SecNetPerfCtlInitialize( _In_ WDFDRIVER Driver ) { @@ -251,7 +251,7 @@ QuicPerfCtlInitialize( Status = WdfDeviceInitAssignName( DeviceInit, - &QuicPerfCtlDeviceName); + &SecNetPerfCtlDeviceName); if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, @@ -263,13 +263,13 @@ QuicPerfCtlInitialize( QuicTraceLogVerbose( PerfControlInitialized, - "[perf] Control interface initialized with %.*S", QuicPerfCtlDeviceName.Length, QuicPerfCtlDeviceName.Buffer); + "[perf] Control interface initialized with %.*S", SecNetPerfCtlDeviceName.Length, SecNetPerfCtlDeviceName.Buffer); WDF_FILEOBJECT_CONFIG_INIT( &FileConfig, - QuicPerfCtlEvtFileCreate, - QuicPerfCtlEvtFileClose, - QuicPerfCtlEvtFileCleanup); + SecNetPerfCtlEvtFileCreate, + SecNetPerfCtlEvtFileClose, + SecNetPerfCtlEvtFileCleanup); FileConfig.FileObjectClass = WdfFileObjectWdfCanUseFsContext2; WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&Attribs, QUIC_DRIVER_CLIENT); @@ -293,12 +293,12 @@ QuicPerfCtlInitialize( goto Error; } - DeviceContext = QuicPerfCtlGetDeviceContext(Device); + DeviceContext = SecNetPerfCtlGetDeviceContext(Device); RtlZeroMemory(DeviceContext, sizeof(QUIC_DEVICE_EXTENSION)); ExInitializePushLock(&DeviceContext->Lock); InitializeListHead(&DeviceContext->ClientList); - Status = WdfDeviceCreateSymbolicLink(Device, &QuicPerfCtlDeviceSymLink); + Status = WdfDeviceCreateSymbolicLink(Device, &SecNetPerfCtlDeviceSymLink); if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, @@ -309,8 +309,8 @@ QuicPerfCtlInitialize( } WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&QueueConfig, WdfIoQueueDispatchParallel); - QueueConfig.EvtIoDeviceControl = QuicPerfCtlEvtIoDeviceControl; - QueueConfig.EvtIoCanceledOnQueue = QuicPerfCtlEvtIoQueueCanceled; + QueueConfig.EvtIoDeviceControl = SecNetPerfCtlEvtIoDeviceControl; + QueueConfig.EvtIoCanceledOnQueue = SecNetPerfCtlEvtIoQueueCanceled; __analysis_assume(QueueConfig.EvtIoStop != 0); Status = @@ -330,8 +330,8 @@ QuicPerfCtlInitialize( goto Error; } - QuicPerfCtlDevice = Device; - QuicPerfCtlExtension = DeviceContext; + SecNetPerfCtlDevice = Device; + SecNetPerfCtlExtension = DeviceContext; WdfControlFinishInitializing(Device); @@ -350,7 +350,7 @@ Error: _IRQL_requires_max_(PASSIVE_LEVEL) void -QuicPerfCtlUninitialize( +SecNetPerfCtlUninitialize( void ) { @@ -358,12 +358,12 @@ QuicPerfCtlUninitialize( PerfControlUninitializing, "[perf] Control interface uninitializing"); - if (QuicPerfCtlDevice != nullptr) { - NT_ASSERT(QuicPerfCtlExtension != nullptr); - QuicPerfCtlExtension = nullptr; + if (SecNetPerfCtlDevice != nullptr) { + NT_ASSERT(SecNetPerfCtlExtension != nullptr); + SecNetPerfCtlExtension = nullptr; - WdfObjectDelete(QuicPerfCtlDevice); - QuicPerfCtlDevice = nullptr; + WdfObjectDelete(SecNetPerfCtlDevice); + SecNetPerfCtlDevice = nullptr; } QuicTraceLogVerbose( @@ -374,7 +374,7 @@ QuicPerfCtlUninitialize( PAGEDX _Use_decl_annotations_ void -QuicPerfCtlEvtFileCreate( +SecNetPerfCtlEvtFileCreate( _In_ WDFDEVICE /* Device */, _In_ WDFREQUEST Request, _In_ WDFFILEOBJECT FileObject @@ -385,10 +385,10 @@ QuicPerfCtlEvtFileCreate( PAGED_CODE(); KeEnterGuardedRegion(); - ExfAcquirePushLockExclusive(&QuicPerfCtlExtension->Lock); + ExfAcquirePushLockExclusive(&SecNetPerfCtlExtension->Lock); do { - if (QuicPerfCtlExtension->ClientListSize >= 1) { + if (SecNetPerfCtlExtension->ClientListSize >= 1) { QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", @@ -397,7 +397,7 @@ QuicPerfCtlEvtFileCreate( break; } - QUIC_DRIVER_CLIENT* Client = QuicPerfCtlGetFileContext(FileObject); + QUIC_DRIVER_CLIENT* Client = SecNetPerfCtlGetFileContext(FileObject); if (Client == nullptr) { QuicTraceEvent( LibraryError, @@ -413,8 +413,8 @@ QuicPerfCtlEvtFileCreate( // // Insert into the client list // - InsertTailList(&QuicPerfCtlExtension->ClientList, &Client->Link); - QuicPerfCtlExtension->ClientListSize++; + InsertTailList(&SecNetPerfCtlExtension->ClientList, &Client->Link); + SecNetPerfCtlExtension->ClientListSize++; QuicTraceLogInfo( PerfControlClientCreated, @@ -424,12 +424,12 @@ QuicPerfCtlEvtFileCreate( // // Update globals. (TODO: Add multiple device client support) // - QuicPerfClient = Client; + SecNetPerfClient = Client; InterlockedExchange((volatile LONG*)&BufferCurrent, 0); CxPlatEventInitialize(&Client->StopEvent, true, false); } while (false); - ExfReleasePushLockExclusive(&QuicPerfCtlExtension->Lock); + ExfReleasePushLockExclusive(&SecNetPerfCtlExtension->Lock); KeLeaveGuardedRegion(); WdfRequestComplete(Request, Status); @@ -438,7 +438,7 @@ QuicPerfCtlEvtFileCreate( PAGEDX _Use_decl_annotations_ void -QuicPerfCtlEvtFileClose( +SecNetPerfCtlEvtFileClose( _In_ WDFFILEOBJECT /* FileObject */ ) { @@ -448,7 +448,7 @@ QuicPerfCtlEvtFileClose( PAGEDX _Use_decl_annotations_ void -QuicPerfCtlEvtFileCleanup( +SecNetPerfCtlEvtFileCleanup( _In_ WDFFILEOBJECT FileObject ) { @@ -456,18 +456,18 @@ QuicPerfCtlEvtFileCleanup( KeEnterGuardedRegion(); - QUIC_DRIVER_CLIENT* Client = QuicPerfCtlGetFileContext(FileObject); + QUIC_DRIVER_CLIENT* Client = SecNetPerfCtlGetFileContext(FileObject); if (Client != nullptr) { - ExfAcquirePushLockExclusive(&QuicPerfCtlExtension->Lock); + ExfAcquirePushLockExclusive(&SecNetPerfCtlExtension->Lock); // // Remove the device client from the list // RemoveEntryList(&Client->Link); - QuicPerfCtlExtension->ClientListSize--; + SecNetPerfCtlExtension->ClientListSize--; - ExfReleasePushLockExclusive(&QuicPerfCtlExtension->Lock); + ExfReleasePushLockExclusive(&SecNetPerfCtlExtension->Lock); QuicTraceLogInfo( PerfControlClientCleaningUp, @@ -489,23 +489,23 @@ QuicPerfCtlEvtFileCleanup( // // Clean up globals. // - QuicPerfClient = nullptr; + SecNetPerfClient = nullptr; } KeLeaveGuardedRegion(); } VOID -QuicPerfCtlEvtIoQueueCanceled( +SecNetPerfCtlEvtIoQueueCanceled( _In_ WDFQUEUE /* Queue */, _In_ WDFREQUEST Request ) { - QuicPerfCtlEvtIoCanceled(Request); + SecNetPerfCtlEvtIoCanceled(Request); } VOID -QuicPerfCtlEvtIoCanceled( +SecNetPerfCtlEvtIoCanceled( _In_ WDFREQUEST Request ) { @@ -518,7 +518,7 @@ QuicPerfCtlEvtIoCanceled( goto Error; } - QUIC_DRIVER_CLIENT* Client = QuicPerfCtlGetFileContext(FileObject); + QUIC_DRIVER_CLIENT* Client = SecNetPerfCtlGetFileContext(FileObject); if (Client == nullptr) { Status = STATUS_DEVICE_NOT_READY; goto Error; @@ -545,7 +545,7 @@ Error: } NTSTATUS -QuicPerfCtlSetSecurityConfig( +SecNetPerfCtlSetSecurityConfig( _Inout_ QUIC_DRIVER_CLIENT* Client, _In_ const QUIC_CERTIFICATE_HASH* CertHash ) @@ -596,7 +596,7 @@ CXPLAT_THREAD_CALLBACK(PerformanceWaitForStopThreadCb, Context) QUIC_DRIVER_CLIENT* Client = (QUIC_DRIVER_CLIENT*)Context; WDFREQUEST Request = Client->Request; - WdfRequestMarkCancelable(Request, QuicPerfCtlEvtIoCanceled); + WdfRequestMarkCancelable(Request, SecNetPerfCtlEvtIoCanceled); if (Client->Canceled) { QuicTraceLogInfo( PerformanceStopCancelled, @@ -659,7 +659,7 @@ Exit: } void -QuicPerfCtlReadPrints( +SecNetPerfCtlReadPrints( _In_ WDFREQUEST Request, _In_ QUIC_DRIVER_CLIENT* Client ) @@ -687,7 +687,7 @@ QuicPerfCtlReadPrints( } NTSTATUS -QuicPerfCtlStart( +SecNetPerfCtlStart( _In_ QUIC_DRIVER_CLIENT* Client, _In_ char* Arguments, _In_ int Length @@ -717,7 +717,7 @@ QuicPerfCtlStart( } void -QuicPerfCtlGetMetadata( +SecNetPerfCtlGetMetadata( _In_ WDFREQUEST Request ) { @@ -751,7 +751,7 @@ QuicPerfCtlGetMetadata( } void -QuicPerfCtlGetExtraData( +SecNetPerfCtlGetExtraData( _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength ) @@ -783,7 +783,7 @@ QuicPerfCtlGetExtraData( } VOID -QuicPerfCtlEvtIoDeviceControl( +SecNetPerfCtlEvtIoDeviceControl( _In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, @@ -817,13 +817,13 @@ QuicPerfCtlEvtIoDeviceControl( goto Error; } - Client = QuicPerfCtlGetFileContext(FileObject); + Client = SecNetPerfCtlGetFileContext(FileObject); if (Client == nullptr) { Status = STATUS_DEVICE_NOT_READY; QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", - "QuicPerfCtlGetFileContext failed"); + "SecNetPerfCtlGetFileContext failed"); goto Error; } @@ -831,15 +831,15 @@ QuicPerfCtlEvtIoDeviceControl( // Handle IOCTL for read // if (IoControlCode == IOCTL_QUIC_READ_DATA) { - QuicPerfCtlReadPrints( + SecNetPerfCtlReadPrints( Request, Client); return; } else if (IoControlCode == IOCTL_QUIC_GET_METADATA) { - QuicPerfCtlGetMetadata(Request); + SecNetPerfCtlGetMetadata(Request); return; } else if (IoControlCode == IOCTL_QUIC_GET_EXTRA_DATA) { - QuicPerfCtlGetExtraData(Request, OutputBufferLength); + SecNetPerfCtlGetExtraData(Request, OutputBufferLength); return; } @@ -895,13 +895,13 @@ QuicPerfCtlEvtIoDeviceControl( case IOCTL_QUIC_SET_CERT_PARAMS: CXPLAT_FRE_ASSERT(Params != nullptr); Status = - QuicPerfCtlSetSecurityConfig( + SecNetPerfCtlSetSecurityConfig( Client, &Params->CertParams.ServerCertHash); break; case IOCTL_QUIC_RUN_PERF: Status = - QuicPerfCtlStart( + SecNetPerfCtlStart( Client, &Params->Data, Params->Length); diff --git a/src/perf/bin/quicperfdriver.kernel.vcxproj b/src/perf/bin/secnetperfdriver.kernel.vcxproj similarity index 99% rename from src/perf/bin/quicperfdriver.kernel.vcxproj rename to src/perf/bin/secnetperfdriver.kernel.vcxproj index 0af5d48a5..3aadea3d7 100644 --- a/src/perf/bin/quicperfdriver.kernel.vcxproj +++ b/src/perf/bin/secnetperfdriver.kernel.vcxproj @@ -75,7 +75,7 @@ - quicperfdrv + secnetperfdrv DbgengKernelDebugger false $(SolutionDir)artifacts\bin\winkernel\$(Platform)_$(Configuration)_schannel\ diff --git a/src/perf/bin/quicperfdriverpriv.kernel.vcxproj b/src/perf/bin/secnetperfdriverpriv.kernel.vcxproj similarity index 99% rename from src/perf/bin/quicperfdriverpriv.kernel.vcxproj rename to src/perf/bin/secnetperfdriverpriv.kernel.vcxproj index 1d4f2e1e6..ad10d219b 100644 --- a/src/perf/bin/quicperfdriverpriv.kernel.vcxproj +++ b/src/perf/bin/secnetperfdriverpriv.kernel.vcxproj @@ -75,7 +75,7 @@ - quicperfdrvpriv + secnetperfdrvpriv DbgengKernelDebugger false $(SolutionDir)artifacts\bin\winkernel\$(Platform)_$(Configuration)_schannel\ diff --git a/src/perf/lib/CMakeLists.txt b/src/perf/lib/CMakeLists.txt index 6ece09660..973ca2553 100644 --- a/src/perf/lib/CMakeLists.txt +++ b/src/perf/lib/CMakeLists.txt @@ -4,7 +4,7 @@ set(SOURCES HpsClient.cpp PerfServer.cpp - quicmain.cpp + SecNetPerfMain.cpp RpsClient.cpp Tcp.cpp ThroughputClient.cpp diff --git a/src/perf/lib/quicmain.cpp b/src/perf/lib/SecNetPerfMain.cpp similarity index 93% rename from src/perf/lib/quicmain.cpp rename to src/perf/lib/SecNetPerfMain.cpp index 0340dfe0a..125c06857 100644 --- a/src/perf/lib/quicmain.cpp +++ b/src/perf/lib/SecNetPerfMain.cpp @@ -16,7 +16,7 @@ Abstract: #include "HpsClient.h" #ifdef QUIC_CLOG -#include "quicmain.cpp.clog.h" +#include "SecNetPerfMain.cpp.clog.h" #endif const MsQuicApi* MsQuic; @@ -40,13 +40,13 @@ uint32_t MaxRuntime = 0; CXPLAT_FRE_ASSERT(QUIC_SUCCEEDED((_STATUS = x))); \ } while (0) -class QuicPerfWatchdog { +class SecNetPerfWatchdog { CXPLAT_THREAD WatchdogThread; CXPLAT_EVENT ShutdownEvent; uint32_t TimeoutMs; static CXPLAT_THREAD_CALLBACK(WatchdogThreadCallback, Context) { - auto This = (QuicPerfWatchdog*)Context; + auto This = (SecNetPerfWatchdog*)Context; if (!CxPlatEventWaitWithTimeout(This->ShutdownEvent, This->TimeoutMs)) { WriteOutput("Watchdog timeout fired!\n"); CXPLAT_FRE_ASSERTMSG(FALSE, "Watchdog timeout fired!"); @@ -54,7 +54,7 @@ class QuicPerfWatchdog { CXPLAT_THREAD_RETURN(0); } public: - QuicPerfWatchdog(uint32_t WatchdogTimeoutMs) : TimeoutMs(WatchdogTimeoutMs) { + SecNetPerfWatchdog(uint32_t WatchdogTimeoutMs) : TimeoutMs(WatchdogTimeoutMs) { CxPlatEventInitialize(&ShutdownEvent, TRUE, FALSE); CXPLAT_THREAD_CONFIG Config = { 0 }; Config.Name = "perf_watchdog"; @@ -62,7 +62,7 @@ public: Config.Context = this; ASSERT_ON_FAILURE(CxPlatThreadCreate(&Config, &WatchdogThread)); } - ~QuicPerfWatchdog() { + ~SecNetPerfWatchdog() { CxPlatEventSet(ShutdownEvent); CxPlatThreadWait(&WatchdogThread); CxPlatThreadDelete(&WatchdogThread); @@ -70,7 +70,7 @@ public: } }; -QuicPerfWatchdog* Watchdog; +SecNetPerfWatchdog* Watchdog; static void @@ -78,13 +78,13 @@ PrintHelp( ) { WriteOutput( "\n" - "quicperf usage:\n" + "secnetperf usage:\n" "\n" - "Server: quicperf [options]\n" + "Server: secnetperf [options]\n" "\n" " -port:<####> The UDP port of the server. (def:%u)\n" "\n" - "Client: quicperf -TestName: [options]\n" + "Client: secnetperf -TestName: [options]\n" "\n", PERF_DEFAULT_PORT ); @@ -116,7 +116,7 @@ QuicMainStart( TryGetValue(argc, argv, "watchdog", &WatchdogTimeout); if (WatchdogTimeout != 0) { - Watchdog = new(std::nothrow) QuicPerfWatchdog{WatchdogTimeout}; + Watchdog = new(std::nothrow) SecNetPerfWatchdog{WatchdogTimeout}; } QUIC_STATUS Status; diff --git a/src/perf/lib/perflib.kernel.vcxproj b/src/perf/lib/perflib.kernel.vcxproj index f60056fb6..c337be399 100644 --- a/src/perf/lib/perflib.kernel.vcxproj +++ b/src/perf/lib/perflib.kernel.vcxproj @@ -37,7 +37,7 @@ - +