Documentation
¶
Index ¶
Constants ¶
const ( // ProviderKubelet is a constant to distinguish that topology hint comes // from parameters passed to CRI create/update requests from Kubelet. ProviderKubelet = "kubelet" )
Variables ¶
This section is empty.
Functions ¶
func FindGivenSysFsDevice ¶
FindGivenSysFsDevice returns the physical device with the given device type, major, and minor numbers.
func FindSysFsDevice ¶
FindSysFsDevice for given argument returns physical device where it is linked to. For device nodes it will return path for device itself. For regular files or directories this function returns physical device where this inode resides (storage device). If result device is a virtual one (e.g. tmpfs), error will be returned. For non-existing path, no error returned and path is empty.
Types ¶
type Hint ¶
type Hint struct {
// Provider is the sysfs path this hint was collected from.
Provider string
// CPUs is the CPU list the device is affine to, in Linux list
// format (e.g. "0-3,7").
CPUs string
// NUMAs is the list of NUMA nodes the device is attached to.
NUMAs string
// Sockets is the list of physical sockets the device is on. Set
// only as a fallback, when a kernel/BIOS quirk leaves NUMAs set
// but no usable CPU list to derive it from.
Sockets string
// PCIeChain lists the device's ancestor PCI bridges and its root
// complex, ordered from the nearest bridge to the root. Empty for
// devices with no PCI ancestry.
PCIeChain []PCIeHop
// IRQs lists the interrupt numbers tied to the device, read from
// its own sysfs "irq" file and "msi_irqs" entries.
IRQs []int
}
Hint represents various hints that can be detected from sysfs for the device.
type Hints ¶
Hints represents set of hints collected from multiple providers.
func MergeTopologyHints ¶
MergeTopologyHints combines org and hints.
func NewTopologyHints ¶
NewTopologyHints return array of hints for the main device and its depended devices (e.g. RAID).
func (Hints) ResolvePartialHints ¶
ResolvePartialHints resolves NUMA-only hints to CPU hints using the given function.
type Logger ¶
type Logger interface {
Debugf(format string, v ...interface{})
}
Logger is interface we expect from an optional, externally set logger.
type PCIeHop ¶
type PCIeHop struct {
// Address is the PCI address (e.g. "0000:00:1c.0"), or the sysfs
// root bridge directory name (e.g. "pci0000:00") when Type is
// PCIeHopRoot.
Address string
Type PCIeHopType
}
PCIeHop is one ancestor bridge or the root complex above a device in its PCIe hierarchy.
type PCIeHopType ¶
type PCIeHopType string
PCIeHopType tells what kind of node a PCIeHop entry refers to.
const ( // PCIeHopBridge marks a PCI-to-PCI bridge (class 0604): a root // port, a switch upstream or downstream port, or a plain bridge. // Sysfs has no separate class for switches, so a switch just // shows up as consecutive bridge hops in the chain. PCIeHopBridge PCIeHopType = "bridge" // PCIeHopRoot marks the host bridge / root complex at the top of // a device's PCI hierarchy. PCIeHopRoot PCIeHopType = "root" )