Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions scripts/secnetperf-helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = @{
Expand Down
19 changes: 17 additions & 2 deletions scripts/secnetperf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "",

Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 }

Expand Down
Loading