Skip to content

fix(System Devices) only show igpu SRIOV if plugin installed.#2643

Open
SimonFair wants to merge 2 commits into
unraid:masterfrom
SimonFair:fix/eng-xx-igpu-sriov-hide
Open

fix(System Devices) only show igpu SRIOV if plugin installed.#2643
SimonFair wants to merge 2 commits into
unraid:masterfrom
SimonFair:fix/eng-xx-igpu-sriov-hide

Conversation

@SimonFair
Copy link
Copy Markdown
Contributor

@SimonFair SimonFair commented May 18, 2026

Only show available SR-IOV VFs for the igpu at 00:02.0 if the SR-IOV plugin is installed.

The VFs show currently but the VFs are not selectable without the plugin. This change hides the SR-IOV options if not installed.

Summary by CodeRabbit

  • Bug Fixes
    • Improved SR-IOV virtual function enumeration logic.
    • Restricted SR-IOV configuration options for Intel i915 devices to only display when the required plugin is installed.

Review Change Stack

OS-195

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Walkthrough

The PR refactors SR-IOV sysfs file handling in the helper module and adjusts device UI logic to gate SR-IOV VF options for Intel i915 GPUs using a cached plugin-detection check. Two files are updated with focused, low-impact changes.

Changes

SR-IOV Functionality Refinement

Layer / File(s) Summary
SR-IOV sysfs path extraction and helper comments
emhttp/plugins/dynamix/include/SriovHelpers.php
getSriovInfoJson() assigns the sriov_numvfs sysfs path to a local $numVfsFile and reads/casts it separately; a comment was inserted before rebindVfDriver().
Intel i915 SR-IOV UI conditional rendering
emhttp/plugins/dynamix/include/SysDevs.php
SR-IOV VFs UI display now computes a general eligibility flag and, for PCI address 00:02.0, additionally requires a cached i915-sriov plugin detection (/boot/config/plugins/i915-sriov.plg or /var/log/plugins/i915-sriov.plg) before showing options.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through sysfs paths with care,

numVFs counted, tidy and fair,
For i915 a little gate I spy,
A cached plugin check before options fly,
Tiny hops, stable code — a rabbit's happy sigh.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding a plugin installation check for iGPU SR-IOV display, which is the core purpose of the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.05.18.0748
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2643/webgui-pr-2643.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/include/SriovHelpers.php
emhttp/plugins/dynamix/include/SysDevs.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2643, or run:

plugin remove webgui-pr-2643

🤖 This comment is automatically generated and will be updated with each new push to this PR.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@emhttp/plugins/dynamix/include/SysDevs.php`:
- Around line 390-400: The current if uses $showI915SriovOptions to gate all
SR-IOV controls, which hides VF controls for non-i915 devices; update the
condition in the block containing $showI915SriovOptions/$isI915SriovPci to allow
SR-IOV UI when the device is in $sriov and its class_id is allowed even if
$showI915SriovOptions is false — e.g. change the if to check
($showI915SriovOptions || (array_key_exists($pciaddress,$sriov) &&
in_array(substr($sriov[$pciaddress]['class_id'],0,4),$allowedPCIClass))) so
i915-specific plugin gating only affects i915 paths while regular NIC SR-IOV
devices still show VF controls.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 911ea63b-a0c9-41fb-98df-d97982b6a9e7

📥 Commits

Reviewing files that changed from the base of the PR and between b78d577 and afa4503.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/include/SriovHelpers.php
  • emhttp/plugins/dynamix/include/SysDevs.php

Comment thread emhttp/plugins/dynamix/include/SysDevs.php Outdated
@SimonFair SimonFair marked this pull request as ready for review May 19, 2026 15:15
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.

1 participant