diff --git a/scripts/secnetperf-helpers.psm1 b/scripts/secnetperf-helpers.psm1 index 2dd5d3517e..34352a36e8 100644 --- a/scripts/secnetperf-helpers.psm1 +++ b/scripts/secnetperf-helpers.psm1 @@ -502,15 +502,21 @@ function Get-LatencyOutput { } } +function Is-TcpSupportedByIo { + param ($Io) + + return $Io -ne "xdp" -and $Io -ne "qtip" -and $Io -ne "wsk" +} + # Invokes secnetperf with the given arguments for both TCP and QUIC. function Invoke-Secnetperf { - param ($Session, $RemoteName, $RemoteDir, $UserName, $SecNetPerfPath, $LogProfile, $Scenario, $io, $Filter, $Environment, $RunId, $SyncerSecret) + param ($Session, $RemoteName, $RemoteDir, $UserName, $SecNetPerfPath, $LogProfile, $Scenario, $io, $ServerIo, $Filter, $Environment, $RunId, $SyncerSecret) $values = @(@(), @()) $latency = $null $extraOutput = $null $hasFailures = $false - if ($io -ne "xdp" -and $io -ne "qtip" -and $io -ne "wsk") { + if ((Is-TcpSupportedByIo $io) -and (Is-TcpSupportedByIo $ServerIo)) { $tcpSupported = 1 } else { $tcpSupported = 0 @@ -533,7 +539,7 @@ function Invoke-Secnetperf { # Set up all the parameters and paths for running the test. $clientPath = Repo-Path $SecNetPerfPath - $serverArgs = "-scenario:$Scenario -io:$io" + $serverArgs = "-scenario:$Scenario -io:$ServerIo" if ($env:collect_cpu_traces) { $updated_runtime_for_cpu_traces = @{ diff --git a/scripts/secnetperf.ps1 b/scripts/secnetperf.ps1 index 85f8522d1b..8888ca74ef 100644 --- a/scripts/secnetperf.ps1 +++ b/scripts/secnetperf.ps1 @@ -25,6 +25,9 @@ This script assumes the latest MsQuic commit is built and downloaded as artifact .PARAMETER io The network IO interface to be used (not all are supported on all platforms). +.PARAMETER serverio + The network IO interface to be used on the server (not all are supported on all platforms). + .PARAMETER filter Run only the tests whose arguments match one of the positive patterns but none of the negative patterns (prefixed by '-'). '?' matches any single @@ -64,6 +67,10 @@ param ( [ValidateSet("", "iocp", "rio", "xdp", "qtip", "wsk", "epoll", "kqueue")] [string]$io = "", + [Parameter(Mandatory = $false)] + [ValidateSet("", "iocp", "rio", "xdp", "qtip", "wsk", "epoll", "kqueue")] + [string]$serverio = "", + [Parameter(Mandatory = $false)] [string]$filter = "", @@ -77,6 +84,11 @@ param ( Set-StrictMode -Version "Latest" $PSDefaultParameterValues["*:ErrorAction"] = "Stop" +function Is-XdpRequiredByIo { + param ($Io) + + return ($Io -eq "xdp" -or $Io -eq "qtip") +} $RemotePowershellSupported = $env:netperf_remote_powershell_supported $RunId = $env:netperf_run_id @@ -109,13 +121,16 @@ if ($io -eq "") { $io = "epoll" } } +if ($serverio -eq "") { + $serverio = $io +} $NoLogs = ($LogProfile -eq "" -or $LogProfile -eq "NULL") if ($isWindows -and $NoLogs) { # Always collect basic, low volume logs on Windows. $LogProfile = "Basic.Light" } -$useXDP = ($io -eq "xdp" -or $io -eq "qtip") +$useXDP = (Is-XdpRequiredByIo $io) -or (Is-XdpRequiredByIo $serverio) if ($RemotePowershellSupported -eq $true) { # Set up the connection to the peer over remote powershell. @@ -335,7 +350,7 @@ $regressionJson = Get-Content -Raw -Path "watermark_regression.json" | ConvertFr # Run all the test cases. Write-Host "Setup complete! Running all tests" foreach ($scenario in $allScenarios) { - $Output = Invoke-Secnetperf $Session $RemoteName $RemoteDir $UserName $SecNetPerfPath $LogProfile $scenario $io $filter $environment $RunId $SyncerSecret + $Output = Invoke-Secnetperf $Session $RemoteName $RemoteDir $UserName $SecNetPerfPath $LogProfile $scenario $io $ServerIo $filter $environment $RunId $SyncerSecret $Test = $Output[-1] if ($Test.HasFailures) { $hasFailures = $true }