Skip to content

Test-Rdma.ps1 does not work with Windows 2025 #623

@steven-kamp

Description

@steven-kamp

It looks like they changed the performance counter names in Windows 2025 (maybe earlier versions as well). This causes the RDMA test to fail with the following:

ERROR: RDMA traffic test FAILED: Please check
ERROR: a) physical switch port configuration for Priorty Flow Control.
ERROR: b) job owner has write permission at 192.168.100.3 \C$

If you remove the ignore you see:

Get-Counter : The specified object was not found on the computer.
At line:1 char:1
+ Get-Counter -Counter "\SMB Direct Connection(_Total)\Bytes RDMA Writt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (:) [Get-Counter], Exception
    + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetCounterCommand

$written and $sent will be empty due to this.

Adding this code fixes the issue.

Replace lines 291 and 292 with:

$osVersion = (Get-CimInstance Win32_OperatingSystem).Version
    if ($osVersion -like "10.0.26*") {        
        $written = Get-Counter -Counter "\SMB Direct\Bytes RDMA Written/sec" -ErrorAction Ignore
        $sent = Get-Counter -Counter "\SMB Direct\Bytes Sent/sec" -ErrorAction Ignore
    } else {
        $written = Get-Counter -Counter "\SMB Direct Connection(_Total)\Bytes RDMA Written/sec" -ErrorAction Ignore
        $sent = Get-Counter -Counter "\SMB Direct Connection(_Total)\Bytes Sent/sec" -ErrorAction Ignore
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions