dpdk

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package dpdk provides DPDK device binding and management functionality for the AWS Multi-ENI Controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingError

type BindingError struct {
	PCIAddr string
	Driver  string
	Reason  string
	Err     error
}

BindingError represents a device binding error

func NewBindingError

func NewBindingError(pciAddr, driver, reason string, err error) *BindingError

NewBindingError creates a new binding error

func (*BindingError) Error

func (e *BindingError) Error() string

func (*BindingError) Unwrap

func (e *BindingError) Unwrap() error

type BindingRequest

type BindingRequest struct {
	PCIAddress    string
	Driver        string
	NodeENIName   string
	ENIID         string
	InterfaceName string
	ResourceName  string
}

BindingRequest represents a DPDK binding request

type BindingStatus

type BindingStatus struct {
	IsBound      bool
	Driver       string
	PCIAddress   string
	ResourceName string
	Error        error
}

BindingStatus represents the status of a DPDK binding

type BoundInterface

type BoundInterface struct {
	PCIAddress    string
	Driver        string
	NodeENIName   string
	ENIID         string
	InterfaceName string
	BoundAt       time.Time
}

BoundInterface represents a DPDK bound interface

type CircuitBreaker

type CircuitBreaker struct {
	// contains filtered or unexported fields
}

CircuitBreaker implements the circuit breaker pattern for DPDK operations

func NewCircuitBreaker

func NewCircuitBreaker(config CircuitBreakerConfig) *CircuitBreaker

NewCircuitBreaker creates a new circuit breaker

func (*CircuitBreaker) Execute

func (cb *CircuitBreaker) Execute(ctx context.Context, operation string, fn func() error) error

Execute executes a function with circuit breaker protection

func (*CircuitBreaker) GetState

func (cb *CircuitBreaker) GetState() CircuitBreakerState

GetState returns the current state of the circuit breaker

func (*CircuitBreaker) GetStats

func (cb *CircuitBreaker) GetStats() map[string]interface{}

GetStats returns statistics about the circuit breaker

func (*CircuitBreaker) Reset

func (cb *CircuitBreaker) Reset()

Reset resets the circuit breaker to closed state

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	FailureThreshold int           // Number of failures before opening
	SuccessThreshold int           // Number of successes before closing from half-open
	Timeout          time.Duration // Time to wait before trying half-open
}

CircuitBreakerConfig holds configuration for the circuit breaker

func DefaultCircuitBreakerConfig

func DefaultCircuitBreakerConfig() CircuitBreakerConfig

DefaultCircuitBreakerConfig returns default circuit breaker configuration

type CircuitBreakerState

type CircuitBreakerState int

CircuitBreakerState represents the state of a circuit breaker

const (
	// StateClosed means the circuit breaker is closed (normal operation)
	StateClosed CircuitBreakerState = iota
	// StateOpen means the circuit breaker is open (failing fast)
	StateOpen
	// StateHalfOpen means the circuit breaker is half-open (testing)
	StateHalfOpen
)

func (CircuitBreakerState) String

func (s CircuitBreakerState) String() string

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

Coordinator orchestrates DPDK binding operations for NodeENI resources

func NewCoordinator

func NewCoordinator(cfg *config.ENIManagerConfig) *Coordinator

NewCoordinator creates a new DPDK coordinator

func (*Coordinator) CheckForUnbinding

func (c *Coordinator) CheckForUnbinding(ctx context.Context, nodeName string, nodeENIs []networkingv1alpha1.NodeENI) error

CheckForUnbinding checks for interfaces that need to be unbound from DPDK

func (*Coordinator) ProcessNodeENIBindings

func (c *Coordinator) ProcessNodeENIBindings(ctx context.Context, nodeName string, nodeENIs []networkingv1alpha1.NodeENI) error

ProcessNodeENIBindings processes DPDK bindings for all NodeENI resources

type Error

type Error struct {
	Operation string
	PCIAddr   string
	Driver    string
	Err       error
	Timestamp time.Time
}

Error represents a DPDK-specific error

func NewError

func NewError(operation, pciAddr, driver string, err error) *Error

NewError creates a new DPDK error

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsRetryable

func (e *Error) IsRetryable() bool

IsRetryable determines if a DPDK error is retryable

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles DPDK device binding operations

func NewManager

func NewManager(cfg *config.ENIManagerConfig) *Manager

NewManager creates a new DPDK manager instance

func (*Manager) BindInterfaceToDPDK

func (m *Manager) BindInterfaceToDPDK(link vnetlink.Link, driver string) error

BindInterfaceToDPDK binds a network interface to a DPDK driver

func (*Manager) BindPCIDeviceToDPDK

func (m *Manager) BindPCIDeviceToDPDK(pciAddress string, driver string) error

BindPCIDeviceToDPDK binds a PCI device to a DPDK driver

func (*Manager) GetBoundInterfaces

func (m *Manager) GetBoundInterfaces() map[string]BoundInterface

GetBoundInterfaces returns a map of currently bound DPDK interfaces

func (*Manager) GetManagerStatus

func (m *Manager) GetManagerStatus() map[string]any

GetManagerStatus returns the current status of the DPDK manager

func (*Manager) IsInterfaceBound

func (m *Manager) IsInterfaceBound(ifaceName string) bool

IsInterfaceBound checks if an interface is bound to DPDK

func (*Manager) IsPCIDeviceBoundToDPDK

func (m *Manager) IsPCIDeviceBoundToDPDK(pciAddress string, driver string) (bool, error)

IsPCIDeviceBoundToDPDK checks if a PCI device is bound to a DPDK driver

func (*Manager) ResetCircuitBreaker

func (m *Manager) ResetCircuitBreaker()

ResetCircuitBreaker resets the circuit breaker to closed state

func (*Manager) UnbindInterfaceFromDPDK

func (m *Manager) UnbindInterfaceFromDPDK(ifaceName string) error

UnbindInterfaceFromDPDK unbinds an interface from DPDK

type SRIOVUpdate

type SRIOVUpdate struct {
	PCIAddress     string
	Driver         string
	ResourceName   string
	ResourcePrefix string
}

SRIOVUpdate represents an SR-IOV configuration update for DPDK

type TimeoutError

type TimeoutError struct {
	Operation string
	Duration  time.Duration
}

TimeoutError represents a timeout error

func NewTimeoutError

func NewTimeoutError(operation string, duration time.Duration) *TimeoutError

NewTimeoutError creates a new timeout error

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type ValidationError

type ValidationError struct {
	Field  string
	Value  string
	Reason string
}

ValidationError represents a validation error

func NewValidationError

func NewValidationError(field, value, reason string) *ValidationError

NewValidationError creates a new validation error

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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