Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pcirebind extension #488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mwdomino
Copy link

The pcirebind extension is a simple helper that attempts to rebind the drivers of a given PCI Bus ID during the boot process using a writable sysfs.

This is done by passing kernel args like:

machine:
  install:
    extensions:
      extraKernelArgs:
        - pcirebind.rebind=0000:04:00.00_ixgbe+vfio-pci

The above kernel args would generate actions similar to:

echo "vfio-pci" > /sys/bus/pci/devices/0000:04:00.0/driver_override
echo "0000:04:00.0" > /sys/bus/pci/drivers/ixgbe/unbind
echo "0000:04:00.0" > /sys/bus/pci/drivers/vfio-pci/bind

We're currently using this internally to rebind some NICs to use vfio-pci so that we can utilize them for VPP.

Let me know if you all have any questions, suggestions, or additions you'd like me to make on this!

@mwdomino
Copy link
Author

I'm not sure what any of those CI errors mean so just let me know if I need to make any changes to placate the bots :)

// example:
//
// pcirebind.rebind=0000:04:00.0_ixgbe+vfio-pci
func parseKernelCmdline(readFunc func(string) ([]byte, error)) ([]rebind, error) {
Copy link
Member

Choose a reason for hiding this comment

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

this could probably use go-procfs from here: https://github.com/siderolabs/go-procfs

Copy link
Member

Choose a reason for hiding this comment

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

@smira i wonder if this needs to be an extension or core talos? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

yes, I almost wonder if that should be actually a controller, and operate on a proper machine config document

@smira
Copy link
Member

smira commented Oct 21, 2024

I wonder if that should be a Talos controller which accepts the configuration like:

kind: PCIRebindConfig
apiVersion: v1alpha1
name: 0000:04:00.00
drivers:
  old: ixgbe
  new: vfio-pci

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