Documentation
¶
Index ¶
- Constants
- Variables
- func AsIntString(v bool) string
- func CreateManager(config *rest.Config, scheme *runtime.Scheme, namespace string, metricsPort int, ...) (manager.Manager, error)
- func CreateNoLinks(path string) (*os.File, error)
- func DownloadFile(path, url, checksum string, client *http.Client) error
- func GetSriovInventory(log *logrus.Logger) (*sriovv2.NodeInventory, error)
- func NewPfBBConfigController(log *logrus.Logger, sharedVfioToken string) *pfBBConfigController
- func NewSecureHTTPSClient(cert *x509.Certificate) (*http.Client, error)
- func OpenFileNoLinks(path string, flag int, perm os.FileMode) (*os.File, error)
- func OpenNoLinks(path string) (*os.File, error)
- func ShowHelp()
- func StartPfBbConfigCli(nodeName string, ns string, directClient client.Client, cmd string, ...)
- func StartTelemetryDaemon(mgr manager.Manager, nodeName string, ns string, directClient client.Client, ...)
- func Untar(tarFile string, dstPath string, log *logrus.Logger) (string, error)
- func VrbGetSriovInventory(log *logrus.Logger) (*vrbv1.NodeInventory, error)
- func Vrbacc100BBDevConfigToIniStruct(in *vrbv1.ACC100BBDevConfig) interface{}
- func VrbfindOrCreateConfigurationStatusCondition(nc *vrbv1.SriovVrbNodeConfig) metav1.Condition
- func VrbgetMatchingConfiguration(pciAddress string, configurations []vrbv1.PhysicalFunctionConfigExt) *vrbv1.PhysicalFunctionConfigExt
- func VrbgetTelemetry(pciAddr string, vfs []vrbv1.VF, telemetryGatherer *telemetryGatherer, ...)
- func VrbisConfigurationOfNonExistingInventoryRequested(requestedConfiguration []vrbv1.PhysicalFunctionConfigExt, ...) bool
- func VrbisKnownDevice(device *pci.Device) bool
- func VrbparseCounters(fieldLine, valueLine string, vfs []vrbv1.VF, pfPciAddr string, ...)
- func VrbparseDeviceStatus(lines []string, pfPciAddr string, vfs []vrbv1.VF, ...)
- func VrbparseTelemetry(file []byte, vfs []vrbv1.VF, pciAddr string, ...)
- func VrbqueueGroupConfigToIniStruct(in vrbv1.QueueGroupConfig) queueGroupConfigIniWrapper
- func VrbremoveVFs(nc *NodeConfigurator, acc vrbv1.SriovAccelerator) error
- func VrbunbindVFs(nc *NodeConfigurator, acc vrbv1.SriovAccelerator) error
- type ConfigurationConditionReason
- type Configurer
- type DevicePluginController
- type DrainAndExecute
- type FecNodeConfigReconciler
- type NodeConfigurator
- func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec, ...) error
- func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, ...) error
- func (n *NodeConfigurator) VrbcleanAcceleratorConfig(acc vrbv1.SriovAccelerator) error
- func (n *NodeConfigurator) VrbconfigureAccelerator(acc vrbv1.SriovAccelerator, requestedConfig *vrbv1.PhysicalFunctionConfigExt) error
- type RestartDevicePluginFunction
- type VFUnion
- type VrbConfigurer
- type VrbNodeConfigReconciler
Constants ¶
const ( ConditionConfigured string = "Configured" ConfigurationInProgress ConfigurationConditionReason = "InProgress" ConfigurationFailed ConfigurationConditionReason = "Failed" ConfigurationNotRequested ConfigurationConditionReason = "NotRequested" ConfigurationSucceeded ConfigurationConditionReason = "Succeeded" )
Variables ¶
var ( VrbConfigPath = "/sriov_config/config/accelerators_vrb.json" VrbgetSriovInventory = VrbGetSriovInventory VrbsupportedAccelerators utils.AcceleratorDiscoveryConfig )
var ( ResetModeCmdID = []byte{0x2, 0x0} AutoResetCmdID = []byte{0x3, 0x0} ClearLogCmdID = []byte{0x4, 0x0} RegDumpCmdID = []byte{0x6, 0x0} MmReadCmdID = []byte{0x8, 0x0} DeviceDataCmdID = []byte{0x9, 0x0} )
pf_bb_config_cli command IDs
var ( ClusterResetMode = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} PfFlrMode = []byte{0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0} AutoResetOff = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} AutoResetOn = []byte{0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0} MmReadRegRead = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} VoidPrivate = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} )
CLI command arguments
var (
FecConfigPath = "/sriov_config/config/accelerators.json"
)
Functions ¶
func AsIntString ¶
func CreateManager ¶
func GetSriovInventory ¶
func GetSriovInventory(log *logrus.Logger) (*sriovv2.NodeInventory, error)
func NewPfBBConfigController ¶
func NewSecureHTTPSClient ¶
func NewSecureHTTPSClient(cert *x509.Certificate) (*http.Client, error)
func OpenFileNoLinks ¶
func StartPfBbConfigCli ¶
func StartTelemetryDaemon ¶
func VrbGetSriovInventory ¶
func VrbGetSriovInventory(log *logrus.Logger) (*vrbv1.NodeInventory, error)
func Vrbacc100BBDevConfigToIniStruct ¶
func Vrbacc100BBDevConfigToIniStruct(in *vrbv1.ACC100BBDevConfig) interface{}
func VrbfindOrCreateConfigurationStatusCondition ¶
func VrbfindOrCreateConfigurationStatusCondition(nc *vrbv1.SriovVrbNodeConfig) metav1.Condition
****************************************************************************
- Function: VrbfindOrCreateConfigurationStatusCondition
- Description: * ***************************************************************************
func VrbgetMatchingConfiguration ¶
func VrbgetMatchingConfiguration(pciAddress string, configurations []vrbv1.PhysicalFunctionConfigExt) *vrbv1.PhysicalFunctionConfigExt
func VrbgetTelemetry ¶
func VrbisConfigurationOfNonExistingInventoryRequested ¶
func VrbisConfigurationOfNonExistingInventoryRequested( requestedConfiguration []vrbv1.PhysicalFunctionConfigExt, existingInventory *vrbv1.NodeInventory) bool
****************************************************************************
- Function: VrbisConfigurationOfNonExistingInventoryRequested
- Description: * ***************************************************************************
func VrbisKnownDevice ¶
func VrbparseCounters ¶
func VrbparseCounters(fieldLine, valueLine string, vfs []vrbv1.VF, pfPciAddr string, telemetryGatherer *telemetryGatherer, log *logrus.Logger)
*****************************************************************************
- Function: VrbparseCounters
- Description: Parses and processes telemetry counters for VFs and PFs.
- Updates the telemetryGatherer with the parsed metrics. ****************************************************************************
func VrbparseDeviceStatus ¶
func VrbparseDeviceStatus(lines []string, pfPciAddr string, vfs []vrbv1.VF, telemetryGatherer *telemetryGatherer, log *logrus.Logger)
*****************************************************************************
- Function: VrbparseDeviceStatus
- Description: Parses the device status and updates the telemetryGatherer.
- Calls parseVFStatus to parse and update the VF status. ****************************************************************************
func VrbparseTelemetry ¶
func VrbqueueGroupConfigToIniStruct ¶
func VrbqueueGroupConfigToIniStruct(in vrbv1.QueueGroupConfig) queueGroupConfigIniWrapper
func VrbremoveVFs ¶
func VrbremoveVFs(nc *NodeConfigurator, acc vrbv1.SriovAccelerator) error
func VrbunbindVFs ¶
func VrbunbindVFs(nc *NodeConfigurator, acc vrbv1.SriovAccelerator) error
Types ¶
type ConfigurationConditionReason ¶
type ConfigurationConditionReason string
type Configurer ¶
type Configurer interface {
ApplySpec(nodeConfig fec.SriovFecNodeConfigSpec, fecDeviceUpdateRequired map[string]bool) error
}
type DevicePluginController ¶
func NewDevicePluginController ¶
func NewDevicePluginController(c client.Client, log *logrus.Logger, nnr types.NamespacedName) *DevicePluginController
func (*DevicePluginController) RestartDevicePlugin ¶
func (d *DevicePluginController) RestartDevicePlugin() error
type DrainAndExecute ¶
type FecNodeConfigReconciler ¶
func FecNewNodeConfigReconciler ¶
func FecNewNodeConfigReconciler(k8sClient client.Client, drainer DrainAndExecute, nodeNameRef types.NamespacedName, sriovfecconfigurer Configurer, restartDevicePluginFunction RestartDevicePluginFunction) (r *FecNodeConfigReconciler, err error)
****************************************************************************
- Function: FecNewNodeConfigReconciler
- Description: * ***************************************************************************
func (*FecNodeConfigReconciler) CreateEmptyNodeConfigIfNeeded ¶
func (r *FecNodeConfigReconciler) CreateEmptyNodeConfigIfNeeded(c client.Client) error
****************************************************************************
- Method: FecNodeConfigReconciler::
- Description:
- CreateEmptyNodeConfigIfNeeded creates empty CR to be Reconciled in
- near future and filled with Status.
- If invoked before manager's Start, it'll need a direct API client
- (Manager's/Controller's client is cached and cache is not initialized yet). ***************************************************************************
func (*FecNodeConfigReconciler) Reconcile ¶
func (r *FecNodeConfigReconciler) Reconcile(_ context.Context, req ctrl.Request) (ctrl.Result, error)
****************************************************************************
- Method: FecNodeConfigReconciler::Reconcile
- Description: * ***************************************************************************
func (*FecNodeConfigReconciler) SetupWithManager ¶
func (r *FecNodeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
****************************************************************************
- Method: FecNodeConfigReconciler::
- Description: * ***************************************************************************
type NodeConfigurator ¶
type NodeConfigurator struct {
client.Client
Log *logrus.Logger
// contains filtered or unexported fields
}
func NewNodeConfigurator ¶
func NewNodeConfigurator(logger *logrus.Logger, pfBBConfigController *pfBBConfigController, client client.Client, nodeNameRef types.NamespacedName) *NodeConfigurator
func (*NodeConfigurator) ApplySpec ¶
func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec, fecDeviceUpdateRequired map[string]bool) error
func (*NodeConfigurator) VrbApplySpec ¶
func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, vrbDeviceUpdateRequired map[string]bool) error
func (*NodeConfigurator) VrbcleanAcceleratorConfig ¶
func (n *NodeConfigurator) VrbcleanAcceleratorConfig(acc vrbv1.SriovAccelerator) error
func (*NodeConfigurator) VrbconfigureAccelerator ¶
func (n *NodeConfigurator) VrbconfigureAccelerator(acc vrbv1.SriovAccelerator, requestedConfig *vrbv1.PhysicalFunctionConfigExt) error
type RestartDevicePluginFunction ¶
type RestartDevicePluginFunction func() error
type VrbConfigurer ¶
type VrbConfigurer interface {
VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, vrbDeviceUpdateRequired map[string]bool) error
}
type VrbNodeConfigReconciler ¶
func VrbNewNodeConfigReconciler ¶
func VrbNewNodeConfigReconciler(k8sClient client.Client, drainer DrainAndExecute, nodeNameRef types.NamespacedName, vrbconfigurer VrbConfigurer, restartDevicePluginFunction RestartDevicePluginFunction) (r *VrbNodeConfigReconciler, err error)
****************************************************************************
- Function: VrbNewNodeConfigReconciler
- Description: * ***************************************************************************
func (*VrbNodeConfigReconciler) CreateEmptyNodeConfigIfNeeded ¶
func (r *VrbNodeConfigReconciler) CreateEmptyNodeConfigIfNeeded(c client.Client) error
****************************************************************************
- Method: VrbNodeConfigReconciler::CreateEmptyNodeConfigIfNeeded
- Description: * ***************************************************************************
func (*VrbNodeConfigReconciler) Reconcile ¶
func (r *VrbNodeConfigReconciler) Reconcile(_ context.Context, req ctrl.Request) (ctrl.Result, error)
****************************************************************************
- Method: VrbNodeConfigReconciler::Reconcile
- Description: This function is the main reconciliation loop for the VrbNodeConfig
- custom resource. It is triggered by changes to the resource and
- performs the following steps:
- 1. Reads the VrbNodeConfig resource.
- 2. Reads the existing inventory of the node.
- 3. Validates the VrbNodeConfig specification.
- 4. Checks if the requested configuration refers to non-existing
- accelerators and updates the status accordingly.
- 5. Determines if a card update is required based on the current
- and requested configurations.
- 6. If an update is required, it updates the status to indicate
- that the configuration is in progress.
- 7. Configures the node based on the VrbNodeConfig specification.
- 8. Updates the status to indicate whether the configuration
- succeeded or failed. ***************************************************************************
func (*VrbNodeConfigReconciler) SetupWithManager ¶
func (r *VrbNodeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
****************************************************************************
- Method: VrbNodeConfigReconciler::SetupWithManager
- Description: * ***************************************************************************