Skip to content

fix(workermgr): correct vfio unbind path test - #673

Open
johnahull wants to merge 1 commit into
ROCm:mainfrom
johnahull:fix/vfio-unbind-path-test
Open

johnahull wants to merge 1 commit into
ROCm:mainfrom
johnahull:fix/vfio-unbind-path-test

Conversation

@johnahull

@johnahull johnahull commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

Fix the shell test used by the VFIO worker before unbinding an AMD GPU virtual function from its current PCI driver.

This is a small correctness fix in the GIM/VF passthrough path. When the worker prepares a VF for vfio-pci, it checks whether the device has an existing driver and unbinds it before applying driver_override and binding the device to vfio-pci.

Root cause

The script currently uses:

if [-e "/sys/bus/pci/devices/$VFIO_DEVICE/driver/unbind"]; then

The [ token is the shell test command and must be separated from the -e operator by whitespace. Without that space, the shell parses [-e as the command name instead of invoking the test command. As a result, the unbind check does not execute correctly, and the existing driver may remain attached when the worker attempts the VFIO transition.

Change

Change the condition to:

if [ -e "/sys/bus/pci/devices/$VFIO_DEVICE/driver/unbind" ]; then

Only internal/controllers/workermgr/scripts/vfio_bind.sh is changed.

Impact

This restores the intended unbind behavior for VF passthrough devices managed by the worker. It is relevant to AMD GIM enablement because the GIM driver creates the VFs, after which the operator must move those VFs to vfio-pci for KubeVirt passthrough.

The fix does not change device selection, GIM package URLs, KMM configuration, node selectors, or KubeVirt configuration. Those concerns are outside the scope of this focused shell correctness fix.

Validation

  • bash -n internal/controllers/workermgr/scripts/vfio_bind.sh
  • git diff --check
  • Confirmed the PR contains exactly one insertion and one deletion in the VFIO bind script.

A full hardware-backed VFIO/KubeVirt E2E test was not run in this environment.

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.

1 participant