daemon

package
v0.0.0-...-81fa6e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionConfigured       string                       = "Configured"
	ConfigurationInProgress   ConfigurationConditionReason = "InProgress"
	ConfigurationFailed       ConfigurationConditionReason = "Failed"
	ConfigurationNotRequested ConfigurationConditionReason = "NotRequested"
	ConfigurationSucceeded    ConfigurationConditionReason = "Succeeded"
)

Variables

View Source
var (
	VrbConfigPath            = "/sriov_config/config/accelerators_vrb.json"
	VrbgetSriovInventory     = VrbGetSriovInventory
	VrbsupportedAccelerators utils.AcceleratorDiscoveryConfig
)
View Source
var (
	RESET_MODE_CMD_ID  = []byte{0x2, 0x0}
	AUTO_RESET_CMD_ID  = []byte{0x3, 0x0}
	CLEAR_LOG_CMD_ID   = []byte{0x4, 0x0}
	REG_DUMP_CMD_ID    = []byte{0x6, 0x0}
	MM_READ_CMD_ID     = []byte{0x8, 0x0}
	DEVICE_DATA_CMD_ID = []byte{0x9, 0x0}
)

pf_bb_config_cli command IDs

View Source
var (
	CLUSTER_RESET_MODE = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
	PF_FLR_MODE        = []byte{0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0}
	AUTO_RESET_OFF     = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
	AUTO_RESET_ON      = []byte{0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0}
	MM_READ_REG_READ   = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
	VOID_PRIVATE       = []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
)

CLI command arguments

View Source
var (
	FecConfigPath = "/sriov_config/config/accelerators.json"
)

Functions

func AsIntString

func AsIntString(v bool) string

func CreateManager

func CreateManager(config *rest.Config, scheme *runtime.Scheme, namespace string, metricsPort int, HealthProbePort int, log *logrus.Logger) (manager.Manager, error)
func CreateNoLinks(path string) (*os.File, error)

func DownloadFile

func DownloadFile(path, url, checksum string, client *http.Client) error

func GetSriovInventory

func GetSriovInventory(log *logrus.Logger) (*sriovv2.NodeInventory, error)

func NewPfBBConfigController

func NewPfBBConfigController(log *logrus.Logger, sharedVfioToken string) *pfBBConfigController

func NewSecureHttpsClient

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 ShowHelp()

func StartPfBbConfigCli

func StartPfBbConfigCli(nodeName string, ns string, directClient client.Client, cmd string, args []string, log *logrus.Logger)

func StartTelemetryDaemon

func StartTelemetryDaemon(mgr manager.Manager, nodeName string, ns string, directClient client.Client, log *logrus.Logger)

func Untar

func Untar(tarFile string, dstPath string, log *logrus.Logger) (string, error)

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 VrbgetTelemetry(pciAddr string, vfs []vrbv1.VF, telemetryGatherer *telemetryGatherer, log *logrus.Logger)

func VrbisConfigurationOfNonExistingInventoryRequested

func VrbisConfigurationOfNonExistingInventoryRequested(
	requestedConfiguration []vrbv1.PhysicalFunctionConfigExt,
	existingInventory *vrbv1.NodeInventory) bool

****************************************************************************

  • Function: VrbisConfigurationOfNonExistingInventoryRequested
  • Description: * ***************************************************************************

func VrbisKnownDevice

func VrbisKnownDevice(device *pci.Device) bool

func VrbparseCounters

func VrbparseCounters(fieldLine, valueLine string, vfs []vrbv1.VF, pfPciAddr string, telemetryGatherer *telemetryGatherer, log *logrus.Logger)

func VrbparseDeviceStatus

func VrbparseDeviceStatus(lines []string, pfPciAddr string, vfs []vrbv1.VF, telemetryGatherer *telemetryGatherer, log *logrus.Logger)

func VrbparseTelemetry

func VrbparseTelemetry(file []byte, vfs []vrbv1.VF, pciAddr string, telemetryGatherer *telemetryGatherer, logger *logrus.Logger)

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) error
}

type DevicePluginController

type DevicePluginController struct {
	client.Client
	// contains filtered or unexported fields
}

func (*DevicePluginController) RestartDevicePlugin

func (d *DevicePluginController) RestartDevicePlugin() error

type DrainAndExecute

type DrainAndExecute func(configurer func(ctx context.Context) bool, drain bool) error

type FecNodeConfigReconciler

type FecNodeConfigReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

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

****************************************************************************

  • 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) error

func (*NodeConfigurator) VrbApplySpec

func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec) 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) error
}

type VrbNodeConfigReconciler

type VrbNodeConfigReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

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

****************************************************************************

  • Method: VrbNodeConfigReconciler::Reconcile
  • Description: * ***************************************************************************

func (*VrbNodeConfigReconciler) SetupWithManager

func (r *VrbNodeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

****************************************************************************

  • Method: VrbNodeConfigReconciler::SetupWithManager
  • Description: * ***************************************************************************

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL