Skip to content

[AI Generated] sriov: validate SR-IOV VF ethtool operations - #4720

Open
VENNELA2132 wants to merge 17 commits into
microsoft:mainfrom
VENNELA2132:ernis/ethtool_ringbuffer
Open

VENNELA2132 wants to merge 17 commits into
microsoft:mainfrom
VENNELA2132:ernis/ethtool_ringbuffer

Conversation

@VENNELA2132

@VENNELA2132 VENNELA2132 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

AI Generated: Generated by the LISA Test Writer prompt. Reviewers: verify AAA
logic, metadata, requirements, and node hygiene.

Description

Add SR-IOV VF integration coverage for ethtool ring buffers, RSS hash keys,
RSS indirection tables, receive CQE coalescing, channel configuration, and
per-queue statistics.

Extend the shared Ethtool implementation with the parsers and operations needed
by these cases. Unsupported-operation detection now checks stderr, statistics
deltas no longer mutate cached absolute counters, and raw statistics output is
retained for completeness validation.

Mutable settings and interface state are restored on every path, and nodes are marked dirty before mutation so an incomplete cleanup cannot return a contaminated VM to the pool.

Related Issue

None.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested
  • Tests executed and results posted below

Test Validation

Key Test Cases:
verify_sriov_ethtool_ring_buffer_settings|verify_sriov_ethtool_rss_hash_key|verify_sriov_ethtool_rss_indirection_table|verify_sriov_ethtool_coalesce_settings|verify_sriov_ethtool_channels|verify_sriov_ethtool_statistics

Impacted LISA Features:
Sriov

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts latest
  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
  • canonical ubuntu-24_04-lts server latest
  • canonical ubuntu-24_04-lts server-arm64 latest
  • debian debian-11 11 latest
  • debian debian-11 11-gen2 latest
  • debian debian-12 12-gen2 latest
  • debian debian-12 12-arm64 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-arm64 latest
  • oracle oracle-linux ol810-lvm-gen2 latest
  • redhat rhel 8_10 latest
  • redhat rhel 810-gen2 latest
  • redhat rhel 95_gen2 latest
  • redhat rhel-arm64 9_5-arm64 latest
  • suse sles-12-sp5 gen2 latest
  • suse sles-15-sp6 gen1 latest
  • suse sles-15-sp6 gen2 latest

Test Results

Coverage overview

Each integration case was run independently across the same 19-image matrix:

  • x64 Gen1: 4 images on Standard_D2ads_v5
  • x64 Gen2: 11 images on Standard_D2ds_v5
  • ARM64 Gen2: 4 images on Standard_D2pds_v5
  • Total: 6 cases x 19 images = 114 matrix image/test entries
  • Initial SSH/TCP deployment failures were retried serially to distinguish
    infrastructure failures from testcase failures.
  • Additional targeted MANA runs used Standard_D2ads_v6, including a three-VF
    configuration.

Final per-testcase matrix outcomes

These counts are final resolved outcomes after retries. Infrastructure/platform
blocks occurred before the testcase body and are not counted as testcase
failures.

Testcase Passed Legitimate skip Driver/product failure Infrastructure/platform blocked What was validated
Ring buffer 13 3 0 3 Changed RX/TX ring sizes, verified exact readback, and restored originals
RSS hash key 17 2 0 0 Changed same-length keys, verified exact readback, and restored key/interface state
RSS indirection table 14 3 0 2 Validated queue indexes, redistributed buckets, rejected oversized requests, and restored defaults
CQE coalescing 0 matrix + 1 targeted 19 0 0 Matrix established capability skips; targeted MANA changed 1 -> 4, rejected 4294967296, and restored 4 -> 1 on three VFs
Channels 9 4 0 6 Tested every combined count through the effective maximum, verified VF traffic, and restored each VF
Statistics 9 1 1 8 Sent 1,000 controlled packets and validated RX/TX per-queue deltas and counter completeness
Matrix total 62 32 1 19 114 independent image/test entries

The extra targeted CQE result is outside the 114-entry matrix total.

Matrix inventory

x64 Gen1 (4 images):

  • Ubuntu 22.04
  • Debian 11
  • RHEL 8.10
  • SLES 15 SP6

x64 Gen2 (11 images):

  • Ubuntu 22.04 and Ubuntu 24.04
  • Debian 11 and Debian 12
  • Azure Linux 3
  • Oracle Linux 8.10 and the current Oracle Linux 9.8 replacement
  • RHEL 8.10 and RHEL 9.5
  • SLES 12 SP5 and SLES 15 SP6

ARM64 Gen2 (4 images):

  • Ubuntu 24.04
  • Debian 12
  • Azure Linux 3
  • RHEL 9.5

The Oracle Linux 9.4 image was unavailable/retired in westus3; Oracle Linux
9.8 was exercised as its current replacement.

Review Follow-up (2026-10-12)

Removed the added selftests/test_ethtool.py in commit 760f8ab at Lili's request. No production code or integration cases changed. Production syntax and diff whitespace checks passed; no new integration run was performed for this deletion-only update. Historical test results above remain unchanged. Merge conflicts with main were not addressed in this update.

Coalescing Cleanup Follow-up

Commit 7940ec2 restores the original rx-cqe-frames value unconditionally in finally before any cleanup readback. The existing post-restoration readback assertion and interface-state cleanup remain. This addresses Copilot's review-summary concern that a failed readback could prevent restoration.

Local validation executed the actual helper with mocked normal completion, post-change readback failure, and post-restoration readback failure. All three passed, verifying restoration order and exception propagation. Black, flake8, mypy, and whitespace checks passed. No selftest files were added and no new Azure integration run was performed. Historical matrix results above are not a validation run of this commit. Merge conflicts remain untouched.

Ring and Statistics Follow-up

Commit 39ebf91c0 separates ring SET from readback and recognizes explicit unsupported SET responses. The ring testcase skips only an unsupported initial SET; accepted updates, readback failures, and other SET failures still trigger restoration, and restoration errors remain failures. Successful SET invalidates cached ring settings. Both statistics nodes are marked dirty before NIC initialization can bring interfaces up or renew DHCP.

The coalescing help probe remains unchanged after checking official kernel.org source archives: ethtool 7.1 lists rx-cqe-frames in the -C extended help and netlink parser; checked releases 6.9, 6.15, 6.19, and 7.0 lack the option. The claim that top-level help never lists individual coalescing parameters is incorrect.

Validation: 14 focused local checks passed against the actual methods, covering SET results, cache invalidation, skip/failure distinctions, restoration, and dirty-marking order. Black, isort, flake8, mypy, and whitespace checks passed. No selftest files were added and no new Azure integration run was performed. Historical integration results above do not validate this commit. Merge conflicts remain untouched.

Ring Setter Quoting Follow-up

Commit f0858f5 quotes the interface argument with shlex.quote before constructing the privileged ring SET shell command, consistent with existing RSS/coalescing setters. Five focused actual-setter checks passed for normal names, spaces, apostrophes, semicolons, and command-substitution text; SET results and cache invalidation remain unchanged. Black, flake8, mypy, and whitespace checks passed. No selftest files were added and no new Azure integration run was performed. Historical integration results do not validate this commit. Merge conflicts remain untouched.

RSS and Channel SET Follow-up

Commit fbbdf49 separates RSS-key and channel SET from readback. Explicit unsupported initial updates skip without another unsupported restore. Readback errors and failures after accepted channel updates remain failures. Earlier modified VFs are still restored when a later VF skips, and aggregate cleanup failures override pending skips. Successful SETs invalidate caches; shell arguments are quoted.

25 focused checks of actual methods passed, covering capability rejection, readback failures, multi-VF cleanup, restoration failures, quoting, cache invalidation, and wrappers. Black, isort, flake8, mypy, call-site compatibility, and whitespace checks passed. No selftest files were added and no new Azure integration run was performed. Historical integration results above do not validate this commit. Merge conflicts remain untouched.

Erni Sri Satya Vennela added 10 commits September 16, 2026 14:59
Ten call sites decided whether a driver supports an operation by
looking for "Operation not supported" in result.stdout, but ethtool
writes that diagnostic to stderr, which lisa keeps as a separate
stream, so every one of those conditions was permanently false and a
refused operation surfaced as a LisaException instead of the
UnsupportedOperationException callers turn into a skip. Route the
checks through a single _is_unsupported helper that searches both
streams, with extra match patterns opt in so the statistics sites keep
"no stats available" without widening it to opcodes that never emit it,
and leave each site's exit code condition as it was. Also add the
missing f prefix on the -l message, which would otherwise have raised
with a literal {interface}.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that changes the RX and TX ring sizes of every SR-IOV VF on
the node, checks the driver applies and reports them back, and then
restores the original values. The target is one power-of-two step up
rather than the reported maximum, because rings are preallocated, so
the maximum costs about 1 GB on a 32 queue VF and can fail on -ENOMEM,
against about 140 MB for a single step. A VF driver reports back the
ring size it was given, so the check is an equality rather than a
range.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that reads the RSS hash key of every SR-IOV VF, writes a
different key of the same length, verifies the key is applied exactly,
and restores the original key. Ensure each interface is up while the
key is changed and restore its original state after validation.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that reads the RSS indirection table of every SR-IOV VF,
checks that entries reference valid receive queues, redistributes the
table evenly across a subset of queues, verifies an oversized request
is rejected without changing the table, and restores the driver
default. Add the matching parser and get and set methods to Ethtool,
exposing the table size separately from the RX ring count.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add reusable support for reading and updating interrupt coalescing
settings, including numeric and not-applicable values reported by
ethtool -c. Detect packaged clients that do not expose rx-cqe-frames
and build checksum-pinned ethtool v7.1 with distribution-specific
libmnl dependencies only when needed.

Add focused selftests for parsing coalescing output and rejecting the
fallback on unsupported distributions.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that validates rx-cqe-frames on every SR-IOV VF. Probe an
alternate value accepted by the driver, verify it is reported back,
and ensure an out-of-range u32 value is rejected without changing the
active configuration.

Restore the original coalescing value and interface state on every
path so subsequent cases are not affected.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that tests every combined channel count from one through
the effective maximum on each SR-IOV VF. Verify traffic after the
datapath is rebuilt and restore the original counts.

Record each original count before mutation and restore every VF
independently so readback or restore failures cannot leak a modified
configuration.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Calculate counter deltas from a copy so cached DeviceStatistics
continue to represent the absolute values returned by ethtool.

Retain the raw statistics snapshot for consumers that need to validate
parser completeness without running ethtool a second time. Add
regression coverage for the delta result, cache integrity, and raw
output.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Add a case that validates every VF exposes complete RX and TX
per-queue packet statistics. Send a controlled 1,000-packet workload
through each VF and verify both counter directions account for it.

Use exact base packet-counter names to avoid inflating deltas with TSO
counters. Validate names and values from one ethtool snapshot, and
require IP-bearing Accelerated Networking pairings before traffic.

Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>
Signed-off-by: Erni Sri Satya Vennela <ernis@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved command-injection risk and multiple restoration, cleanup, and cache issues block approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds SR-IOV VF ethtool integration coverage and extends shared ethtool parsing and operations.

Changes:

  • Adds six validation cases for rings, RSS, coalescing, channels, and statistics.
  • Adds ethtool parsers, operations, unsupported-operation detection, and cache handling.
  • Adds unit tests for parsing and statistics behavior.
File summaries
File Summary and final review findings
selftests/test_ethtool.py Adds ethtool unit tests. Nit (1 vote): add normal and malformed/missing-row coverage for DeviceRssIndirectionTable.
lisa/tools/ethtool.py Adds ethtool operations and parsers. Critical (3 votes): validate and safely quote spec and interface values before using shell=True. Moderate (1 vote each): invalidate or refresh RSS indirection and coalescing caches after successful setters.
lisa/microsoft/testsuites/network/sriov.py Adds SR-IOV integration scenarios and cleanup. Moderate (3 votes): guard ring-buffer changes so readback failures still trigger restoration (lines 401/540). Moderate (1 vote): restore the exact original RSS indirection table. Moderate (2 votes): catch restoration AssertionError so cleanup continues across VFs. Moderate (1 vote): handle zero or non-tunable ring maxima safely. Moderate (1 vote): mark the node dirty when mutation is attempted. Nit (2 votes): link the related issue. Nit (1 vote): include command output and diagnostic guidance on setting failures.
Review details

Suppressed comments (8)

lisa/microsoft/testsuites/network/sriov.py:541

  • Major: change_device_rss_hash_key sets the key and then reads it back, but that call is outside the try. If the setter succeeds and the readback/parser fails, the original key is never restored. Put the change call inside the guarded block so the finally restores the key after any post-apply failure.
            changed = ethtool.change_device_rss_hash_key(vf_nic, new_key)
            try:

lisa/microsoft/testsuites/network/sriov.py:671

  • Major: Restoring with ethtool -X ... default is not equivalent to restoring original.table when the VF starts with a non-default indirection table. The assertion then fails and, more importantly, the test leaves the device at the driver default instead of its pre-test state. Restore the exact snapshot (or explicitly verify the initial table is the default before changing it).
                log.info(f"Restoring {vf_nic} RSS indirection table to the default")
                restored = ethtool.change_device_rss_indirection_table(
                    vf_nic, "default"
                )

lisa/microsoft/testsuites/network/sriov.py:462

  • maximum=0 is a valid report for a non-tunable RX/TX ring, but 1 << (maximum.bit_length() - 1) then shifts by -1 and raises ValueError. Handle non-positive maxima and the no-alternate-value case by skipping this VF instead of failing the test with an unrelated arithmetic error.
        ceiling = 1 << (maximum.bit_length() - 1)
        step_up = 1 << current.bit_length()
        if step_up <= ceiling:
            return step_up
        # Already at the largest power of two the device allows.
        return max(ceiling // 2, 1)

lisa/microsoft/testsuites/network/sriov.py:865

  • This failure path raises with only Couldn't set ..., without the command output or guidance for investigation. Include stdout/stderr and point to checking ethtool netlink/driver support so an unexpected rejection is diagnosable.
                result.assert_exit_code(
                    message=f"Couldn't set {vf_nic} {parameter} to {candidate}.",
                    include_output=True,
                )

lisa/microsoft/testsuites/network/sriov.py:403

  • These cases mutate VF network settings and interface state but never mark the node dirty. If cleanup is incomplete or the driver leaves transient state, LISA can reuse a contaminated VM; mark the node dirty when mutation is attempted, or provide an explicit reuse-safe cleanup contract.
            actual_settings = ethtool.change_device_ring_buffer_settings(
                vf_nic, expected_rx, expected_tx
            )

lisa/tools/ethtool.py:1100

  • The successful set_device_rss_indirection_table path leaves DeviceSettings.device_rss_indirection_table untouched. After a caller sets a table, a later get_device_rss_indirection_table(interface) without force_run=True can therefore return the old cached table instead of the active one. Invalidate or refresh this cache after a successful set.
        return self.run(
            f"-X {interface} {spec}",
            sudo=True,
            force_run=True,
            shell=True,
        )

lisa/tools/ethtool.py:1148

  • The successful set_device_coalesce_setting path does not invalidate device_coalesce_settings. Once a value has been cached, callers that invoke this setter and then use the default get_device_coalesce_settings call will observe stale settings unless they know to pass force_run=True; invalidate or refresh the cache after a successful set.
        return self.run(
            f"-C {shlex.quote(interface)} {shlex.quote(parameter)} "
            f"{shlex.quote(str(value))}",
            sudo=True,
            force_run=True,
            shell=True,
        )

lisa/tools/ethtool.py:424

  • The new DeviceRssIndirectionTable parser has no unit coverage in selftests/test_ethtool.py, even though that file tests the other new parsers. Add cases for a normal multi-row table and malformed or missing rows so format changes cannot silently corrupt the table used by all RSS tests.
class DeviceRssIndirectionTable:
    # The indirection table shares the "ethtool -x" output with the hash key:
    #   RX flow hash indirection table for eth0 with 4 RX ring(s):
    #       0:      0     1     2     3     0     1     2     3
    #       8:      0     1     2     3     0     1     2     3
  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lisa/tools/ethtool.py Outdated
Comment thread lisa/microsoft/testsuites/network/sriov.py Outdated
Comment thread lisa/microsoft/testsuites/network/sriov.py Outdated
Comment thread lisa/microsoft/testsuites/network/sriov.py
Copilot AI review requested due to automatic review settings September 24, 2026 09:39
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Addressed the suppressed findings in 9e605bb: exact/default-safe RSS restoration (skipping custom initial tables), non-positive/no-alternate ring handling, node.mark_dirty, RSS/coalesce cache invalidation, indirection parser tests, and improved coalesce diagnostics. Validation: Black, isort, Flake8, mypy, compileall, Pylint 10/10, focused 11 tests, and full 330 selftests all passed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved cleanup, restoration, cache invalidation, and fallback-build issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (3)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Restore coalescing value before post-change readback

lisa/​microsoft/​testsuites/​network/​sriov.py:865

If the post-change readback fails, this first get_device_coalesce_settings call in finally raises before the setter is reached, leaving the VF with the modified coalescing value. Restore the original value unconditionally in finally, then perform the readback/assertion afterward so cleanup also covers readback failures.

Comment thread lisa/microsoft/testsuites/network/sriov.py
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Addressed the suppressed findings in 9e605bb: exact/default-safe RSS restoration (skipping custom initial tables), non-positive/no-alternate ring handling, node.mark_dirty, RSS/coalesce cache invalidation, indirection parser tests, and improved coalesce diagnostics. Validation: Black, isort, Flake8, mypy, compileall, Pylint 10/10, focused 11 tests, and full 330 selftests all passed.

Comment thread lisa/microsoft/testsuites/network/sriov.py
Comment thread lisa/microsoft/testsuites/network/sriov.py
Comment thread lisa/microsoft/testsuites/network/sriov.py
Comment thread lisa/microsoft/testsuites/network/sriov.py
Comment thread lisa/tools/ethtool.py
@LiliDeng

Copy link
Copy Markdown
Collaborator

Copilot resolve the merge conflicts in this pull request

Remove the added selftests/test_ethtool.py file as requested by Lili. Keep all Ethtool implementation and SR-IOV integration cases unchanged.

Validation: production files compile successfully, diff whitespace checks pass, and discovery confirms the removed module is absent. Merge conflicts with main are intentionally not addressed in this change.
Copilot AI lite review requested due to automatic review settings October 12, 2026 04:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Two unresolved moderate issues affect cleanup reliability and RSS key validation.

0 open findings

5 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Restore rx-cqe-frames before readback in finally

lisa/​microsoft/​testsuites/​network/​sriov.py:865

Major: after a successful coalescing change, this finally block performs a readback before attempting restoration. If that readback fails (for example, the driver temporarily rejects -c while reconfiguring), the exception exits the finally and the original rx-cqe-frames value is never restored. Issue the restore command directly in the finally first, then read back afterward so cleanup is attempted on every path.

🧠 Review effort: Lite

Restore the original rx-cqe-frames value unconditionally in finally instead of reading the active value before deciding whether to restore. A failed readback can no longer prevent the cleanup command from being attempted. Keep the existing post-restoration readback assertion and interface-state cleanup.

Validation: executed the actual helper with mocked normal completion, post-change readback failure, and post-restoration readback failure; all three verified restoration ordering and exception propagation. Black, flake8, mypy, and whitespace checks passed. No selftest file or Azure integration run was added. Merge conflicts are not addressed.
Copilot AI lite review requested due to automatic review settings October 12, 2026 04:44
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Addressed the coalescing cleanup concern from the latest Copilot review in 7940ec2. The original rx-cqe-frames value is now restored unconditionally in finally, before any cleanup readback can fail. The existing readback assertion and interface-state cleanup remain.

Three local checks using the actual helper passed: normal completion, post-change readback failure, and post-restoration readback failure. They verify restoration ordering and exception propagation. Black, flake8, mypy, and whitespace checks passed. No selftest files were added; no new Azure integration run was performed. Merge conflicts were left untouched.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Five unresolved moderate findings affect cleanup hygiene, unsupported operations, RSS completeness, and coalescing support detection.

0 open findings

Previously missed (3)

In code that hasn't changed since last review

Medium severity Unsupported ring updates are reported as driver failures

lisa/​microsoft/​testsuites/​network/​sriov.py:405

Major: The test only converts an unsupported -g query into SkippedException, but change_device_ring_buffer_settings() asserts the -G result directly. A VF can expose ring parameters for reading while rejecting updates, in which case the first set raises an assertion and reports a driver failure instead of a legitimate unsupported-operation skip. Have the setter surface UnsupportedOperationException when _is_unsupported(change_result) matches, or translate that result here before treating it as a test failure.

This issue also appears on line 1063 of the same file.

Medium severity NIC initialization can return a modified VM to the pool

lisa/​microsoft/​testsuites/​network/​sriov.py:1111

Major: initialize_nic_info can call Ip.up() and Dhclient.renew() when a NIC has no address (see lisa/microsoft/testsuites/network/common.py:38-41). This statistics case invokes it without marking the node dirty or restoring the interface, so that fallback path can return a modified VM to the pool; mark the node dirty before the call (or add guaranteed state cleanup).

Medium severity Coalesce feature probe falsely triggers package installation

lisa/​tools/​ethtool.py:642

Major: ethtool --help advertises top-level commands such as -C/--coalesce, but it does not enumerate the individual -C parameter names. Consequently this probe will normally return false even when the installed client already accepts rx-cqe-frames, forcing a compiler/package install and network download on every such node (and potentially failing before the test can run). Detect support from the actual coalesce output for the target interface or use a reliable version/feature probe before rebuilding.

🧠 Review effort: Lite

Separate ring SET from readback and surface explicit unsupported update responses as UnsupportedOperationException. Skip only an unsupported first SET in the ring testcase without issuing another unsupported restore. Preserve restoration after accepted updates, readback failures, and other command failures; restoration failures remain failures. Invalidate the cached ring settings after successful SET.

Mark both statistics nodes dirty before initialize_nic_info can raise interfaces or renew DHCP. Keep the coalescing help probe unchanged: official ethtool 7.1 help and parser include rx-cqe-frames, while earlier checked releases lack the option.

Validation: 14 focused checks of actual methods passed for SET results, cache invalidation, skip/fail distinctions, cleanup, and dirty-marking order. Black, isort, flake8, mypy, and whitespace checks passed. No selftest files were added and no new Azure integration run was performed. Merge conflicts are untouched.
Copilot AI lite review requested due to automatic review settings October 12, 2026 05:30
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Addressed the latest review concerns in 39ebf91:

  • Explicit unsupported initial ring SET responses now skip. SET and readback are separate, so runtime readback errors are not mistaken for unsupported mutation. Other failures still attempt restoration, and restoration failures remain failures.
  • Both statistics nodes are marked dirty before NIC initialization can change interface state or renew DHCP.
  • Kept the coalescing support probe unchanged after verifying upstream source. Official ethtool 7.1 ethtool.c includes [rx-cqe-frames N] in -C extended help, which show_usage prints, and netlink/coalesce.c includes the parser. Checked older releases lack the option. See https://www.kernel.org/pub/software/network/ethtool/ethtool-7.1.tar.gz . The claimed help-probe false negative is not supported by upstream evidence.

14 focused local behavior checks and Black, isort, flake8, mypy, and whitespace checks passed. No selftest files were added; no new Azure integration run was performed. Merge conflicts remain untouched.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved shell-injection risk and cleanup/node-dirty handling issues remain.

1 open finding

🧠 Review effort: Lite

Comment thread lisa/tools/ethtool.py Outdated
Quote the interface argument with shlex.quote before constructing the privileged shell command for ring buffer updates, matching the existing RSS and coalescing setters. Interface text containing shell metacharacters remains a single literal argument.

Validation: five focused actual-setter checks passed for normal, spaced, apostrophe, semicolon, and command-substitution interface values, preserving SET results and cache invalidation. Black, flake8, mypy, and whitespace checks passed. No selftest files or Azure integration run were added; merge conflicts remain untouched.
Copilot AI lite review requested due to automatic review settings October 12, 2026 06:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Four unresolved moderate issues affect unsupported-operation handling, restoration, and node hygiene.

0 open findings

1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Handle unsupported RSS hash-key SET without failed restoration

lisa/​microsoft/​testsuites/​network/​sriov.py:580

Major: The RSS hash-key setter can return UnsupportedOperationException even when the key was readable, but this exception is not converted to SkippedException here. The finally then attempts the unsupported restore as well, turning an unsupported VF capability into a failure instead of a legitimate skip. Handle unsupported SET separately and retain restoration for paths where the SET may have succeeded.

This issue also appears on line 703 of the same file.

Medium severity Handle unsupported VF channel SET as a capability skip

lisa/​microsoft/​testsuites/​network/​sriov.py:1075

Major: a VF can report channel information successfully but reject ethtool -L with Operation not supported (on stderr). change_device_channels_info() currently turns that result into an AssertionError, and this loop only maps the initial -l failure to SkippedException, so an unsupported setter is reported as a testcase failure instead of a capability skip. Add unsupported-result handling to the channel setter and handle it consistently here (while preserving restoration of any earlier VFs).

🧠 Review effort: Lite

Separate RSS hash-key and channel SET operations from forced readback. Recognize explicit unsupported responses, quote shell arguments, and invalidate successful SET caches. Skip only initial capability rejection; readback errors and failures after an accepted channel update remain failures.

Do not restore an explicitly rejected initial update. Retain restoration after possible mutations and for earlier modified VFs when a later VF skips. Assert aggregate channel restoration failures inside finally so cleanup failure cannot be hidden by a pending capability skip.

Validation: 25 focused checks of actual methods passed for skip/failure distinctions, multi-VF restoration, restoration failures, quoting, cache invalidation, and wrapper behavior. Black, isort, flake8, mypy, call-site checks, and whitespace checks passed. No selftest files were added; no new Azure integration run was performed. Merge conflicts remain untouched.
Copilot AI lite review requested due to automatic review settings October 12, 2026 06:19
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Addressed both detailed concerns from the 06:06 UTC Copilot review in fbbdf49. RSS-key and channel SETs are separate from readback; explicit initial capability rejection skips without attempting the same unsupported restoration. Readback errors and failures after an accepted channel SET remain failures. Previously modified VFs are restored when a later VF skips, and cleanup failures override a pending skip. SET caches are invalidated and shell arguments quoted.

25 focused checks of actual methods passed, including multi-VF cleanup and restoration failure paths. Black, isort, flake8, mypy, call-site and whitespace checks passed. No selftest files were added, no new Azure integration run was performed, and merge conflicts remain untouched.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Interface restoration and statistics ping-binding issues remain unresolved.

1 open finding

🧠 Review effort: Lite

Comment thread lisa/microsoft/testsuites/network/sriov.py
Copilot AI lite review requested due to automatic review settings October 13, 2026 05:52
@VENNELA2132

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict with current main (7dfac8b) in commit 60863ad and pushed it to this PR. The SR-IOV suite retains both the upstream debugfs diagnostics and all reviewed ethtool ring-buffer, RSS, channel, coalescing, and statistics tests. AST comparisons confirmed that every method and decorator, class constant, and import from both merge parents is preserved unchanged, with no duplicate methods. Validation: all 386 existing selftests pass; Python compilation, Black, Flake8, isort, and git diff --check pass. No new selftest files were added. Live Azure integration tests were not rerun for this merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Three moderate findings remain around interface-state restoration and unsupported RSS handling.

0 open findings

1 resolved since last review

🧠 Review effort: Lite

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants