package deviceattribute
import "k8s.io/dynamic-resource-allocation/deviceattribute"
Index ¶
Constants ¶
const ( // StandardDeviceAttributePrefix is the prefix used for standard device attributes. StandardDeviceAttributePrefix = "resource.kubernetes.io/" // StandardDeviceAttributePCIeRoot is a standard device attribute name // which describe PCIe Root Complex of the PCIe device. // The value is a string value in the format `pci<domain>:<bus>`, // referring to a PCIe (Peripheral Component Interconnect Express) Root Complex. // This attribute can be used to identify devices that share the same PCIe Root Complex. StandardDeviceAttributePCIeRoot resourceapi.QualifiedName = StandardDeviceAttributePrefix + "pcieRoot" )
Types ¶
type DeviceAttribute ¶
type DeviceAttribute struct { // Name is the qualified name of the device attribute. Name resourceapi.QualifiedName // Value is the value of the device attribute. Value resourceapi.DeviceAttribute }
DeviceAttribute represents a device attribute name and its value
func GetPCIeRootAttributeByPCIBusID ¶
func GetPCIeRootAttributeByPCIBusID(pciBusID string) (DeviceAttribute, error)
GetPCIeRootAttributeByPCIBusID retrieves the PCIe Root Complex for a given PCI Bus ID. in BDF (Bus-Device-Function) format, e.g., "0123:45:1e.7".
It returns a DeviceAttribute with the PCIe Root Complex information("pci<domain>:<bus>") as a string value or an error if the PCI Bus ID is invalid or the root complex cannot be determined.
ref: https://wiki.xenproject.org/wiki/Bus:Device.Function_(BDF)_Notation
Source Files ¶
attribute.go pci_linux.go sysfs_linux.go
- Version
- v0.35.0-alpha.0
- Published
- Aug 7, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 46 seconds ago –
Tools for package owners.