controller

package
v0.0.0-...-14a6586 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

COPYRIGHT 2025 NVIDIA

Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package controller is a generated GoMock package.

Index

Constants

View Source
const (
	CustomFlowsLabelKey     = "svc.dpu.nvidia.com/custom-flows"
	CustomFlowsFireflyValue = "firefly"
)
View Source
const (
	RequeueIntervalFlows = 5 * time.Second

	ServiceChainFinalizer = dpuservicev1.SvcDpuGroupName + "/ServiceChain-finalizer"
	ServiceChainLabel     = dpuservicev1.SvcDpuGroupName + "/service-chain"

	PriorityDropFlows         = 100
	PriorityCustomFlows       = 50
	PriorityLearntFlows       = 30
	PriorityDynamicLearnFlows = 20
	PriorityDefaultFlows      = 10

	ForwardablePTPMulticastMac    = "01:1b:19:00:00:00" // forwardable PTP multicast MAC address
	NonForwardablePTPMulticastMac = "01:80:c2:00:00:0e" // unforwardable PTP multicast MAC address
)
View Source
const (
	ServiceInterfaceController = "serviceinterfacecontroller"
	ServiceInterfaceFinalizer  = dpuservicev1.SvcDpuGroupName + "/ServiceInterface-finalizer"
	RequeueIntervalSuccess     = 20 * time.Second
	RequeueIntervalError       = 5 * time.Second
	OvnPatch                   = "puplinkbrovn"
	OvnPatchPeer               = "puplinkbrsfc"
	SFCBridge                  = "br-sfc"
	OVNBridge                  = "br-ovn"
)

Variables

This section is empty.

Functions

func AddInterfacesToOvs

func AddInterfacesToOvs(ctx context.Context, ovs ovsutils.API, serviceInterface *dpuservicev1.ServiceInterface, metadata string) error

func AddPatchPort

func AddPatchPort(ctx context.Context, ovs ovsutils.API, brA, brB string, ifaceExternalIDs map[string]string) error

func AddPort

func AddPort(ctx context.Context, ovs ovsutils.API, portName string, ifaceExternalIDs, portExternalIDs map[string]string) error

func DeleteInterfacesFromOvs

func DeleteInterfacesFromOvs(ctx context.Context, ovs ovsutils.API, serviceInterface *dpuservicev1.ServiceInterface) error

func DeletePatchPorts

func DeletePatchPorts(ctx context.Context, ovs ovsutils.API, brA, brB string) error

func FigureOutName

func FigureOutName(ctx context.Context, serviceInterface *dpuservicev1.ServiceInterface) string

func GetMgrCache

func GetMgrCache(nodeName string, syncPeriod time.Duration) cache.Options

Types

type MockBridge

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

MockBridge is a mock of Bridge interface.

func NewMockBridge

func NewMockBridge(ctrl *gomock.Controller) *MockBridge

NewMockBridge creates a new mock instance.

func (*MockBridge) AddFlowsInBundle

func (m *MockBridge) AddFlowsInBundle(addflows, modFlows, delFlows []*openflow15.FlowMod) error

AddFlowsInBundle mocks base method.

func (*MockBridge) AddOFEntriesInBundle

func (m *MockBridge) AddOFEntriesInBundle(addEntries, modEntries, delEntries []openflow.OFEntry) error

AddOFEntriesInBundle mocks base method.

func (*MockBridge) BuildPacketOut

func (m *MockBridge) BuildPacketOut() openflow.PacketOutBuilder

BuildPacketOut mocks base method.

func (*MockBridge) Connect

func (m *MockBridge) Connect(maxRetrySec int, connectCh chan struct{}) error

Connect mocks base method.

func (*MockBridge) DeleteFlowsByCookie

func (m *MockBridge) DeleteFlowsByCookie(cookieID, cookieMask uint64) error

DeleteFlowsByCookie mocks base method.

func (*MockBridge) DeleteGroupAll

func (m *MockBridge) DeleteGroupAll() error

DeleteGroupAll mocks base method.

func (*MockBridge) DeleteMeterAll

func (m *MockBridge) DeleteMeterAll() error

DeleteMeterAll mocks base method.

func (*MockBridge) Disconnect

func (m *MockBridge) Disconnect() error

Disconnect mocks base method.

func (*MockBridge) DumpFlows

func (m *MockBridge) DumpFlows(cookieID, cookieMask uint64) (map[uint64]*openflow.FlowStates, error)

DumpFlows mocks base method.

func (*MockBridge) DumpTableStatus

func (m *MockBridge) DumpTableStatus() []openflow.TableStatus

DumpTableStatus mocks base method.

func (*MockBridge) EXPECT

func (m *MockBridge) EXPECT() *MockBridgeMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBridge) GetMeterStats

func (m *MockBridge) GetMeterStats(handleMeterStatsReply func(int, int64)) error

GetMeterStats mocks base method.

func (*MockBridge) GetTableByID

func (m *MockBridge) GetTableByID(id uint8) (openflow.Table, error)

GetTableByID mocks base method.

func (*MockBridge) IsConnected

func (m *MockBridge) IsConnected() bool

IsConnected mocks base method.

func (*MockBridge) NewGroup

func (m *MockBridge) NewGroup(id openflow.GroupIDType) openflow.Group

NewGroup mocks base method.

func (*MockBridge) NewGroupTypeAll

func (m *MockBridge) NewGroupTypeAll(id openflow.GroupIDType) openflow.Group

NewGroupTypeAll mocks base method.

func (*MockBridge) NewMeter

func (m *MockBridge) NewMeter(id openflow.MeterIDType, flags ofctrl.MeterFlag) openflow.Meter

NewMeter mocks base method.

func (*MockBridge) NewTable

func (m *MockBridge) NewTable(table openflow.Table, next uint8, missAction openflow.MissActionType) openflow.Table

NewTable mocks base method.

func (*MockBridge) ResumePacket

func (m *MockBridge) ResumePacket(packetIn *ofctrl.PacketIn) error

ResumePacket mocks base method.

func (*MockBridge) SendPacketOut

func (m *MockBridge) SendPacketOut(packetOut *ofctrl.PacketOut) error

SendPacketOut mocks base method.

func (*MockBridge) SubscribePacketIn

func (m *MockBridge) SubscribePacketIn(category uint8, pktInQueue *openflow.PacketInQueue) error

SubscribePacketIn mocks base method.

type MockBridgeMockRecorder

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

MockBridgeMockRecorder is the mock recorder for MockBridge.

func (*MockBridgeMockRecorder) AddFlowsInBundle

func (mr *MockBridgeMockRecorder) AddFlowsInBundle(addflows, modFlows, delFlows any) *gomock.Call

AddFlowsInBundle indicates an expected call of AddFlowsInBundle.

func (*MockBridgeMockRecorder) AddOFEntriesInBundle

func (mr *MockBridgeMockRecorder) AddOFEntriesInBundle(addEntries, modEntries, delEntries any) *gomock.Call

AddOFEntriesInBundle indicates an expected call of AddOFEntriesInBundle.

func (*MockBridgeMockRecorder) BuildPacketOut

func (mr *MockBridgeMockRecorder) BuildPacketOut() *gomock.Call

BuildPacketOut indicates an expected call of BuildPacketOut.

func (*MockBridgeMockRecorder) Connect

func (mr *MockBridgeMockRecorder) Connect(maxRetrySec, connectCh any) *gomock.Call

Connect indicates an expected call of Connect.

func (*MockBridgeMockRecorder) DeleteFlowsByCookie

func (mr *MockBridgeMockRecorder) DeleteFlowsByCookie(cookieID, cookieMask any) *gomock.Call

DeleteFlowsByCookie indicates an expected call of DeleteFlowsByCookie.

func (*MockBridgeMockRecorder) DeleteGroupAll

func (mr *MockBridgeMockRecorder) DeleteGroupAll() *gomock.Call

DeleteGroupAll indicates an expected call of DeleteGroupAll.

func (*MockBridgeMockRecorder) DeleteMeterAll

func (mr *MockBridgeMockRecorder) DeleteMeterAll() *gomock.Call

DeleteMeterAll indicates an expected call of DeleteMeterAll.

func (*MockBridgeMockRecorder) Disconnect

func (mr *MockBridgeMockRecorder) Disconnect() *gomock.Call

Disconnect indicates an expected call of Disconnect.

func (*MockBridgeMockRecorder) DumpFlows

func (mr *MockBridgeMockRecorder) DumpFlows(cookieID, cookieMask any) *gomock.Call

DumpFlows indicates an expected call of DumpFlows.

func (*MockBridgeMockRecorder) DumpTableStatus

func (mr *MockBridgeMockRecorder) DumpTableStatus() *gomock.Call

DumpTableStatus indicates an expected call of DumpTableStatus.

func (*MockBridgeMockRecorder) GetMeterStats

func (mr *MockBridgeMockRecorder) GetMeterStats(handleMeterStatsReply any) *gomock.Call

GetMeterStats indicates an expected call of GetMeterStats.

func (*MockBridgeMockRecorder) GetTableByID

func (mr *MockBridgeMockRecorder) GetTableByID(id any) *gomock.Call

GetTableByID indicates an expected call of GetTableByID.

func (*MockBridgeMockRecorder) IsConnected

func (mr *MockBridgeMockRecorder) IsConnected() *gomock.Call

IsConnected indicates an expected call of IsConnected.

func (*MockBridgeMockRecorder) NewGroup

func (mr *MockBridgeMockRecorder) NewGroup(id any) *gomock.Call

NewGroup indicates an expected call of NewGroup.

func (*MockBridgeMockRecorder) NewGroupTypeAll

func (mr *MockBridgeMockRecorder) NewGroupTypeAll(id any) *gomock.Call

NewGroupTypeAll indicates an expected call of NewGroupTypeAll.

func (*MockBridgeMockRecorder) NewMeter

func (mr *MockBridgeMockRecorder) NewMeter(id, flags any) *gomock.Call

NewMeter indicates an expected call of NewMeter.

func (*MockBridgeMockRecorder) NewTable

func (mr *MockBridgeMockRecorder) NewTable(table, next, missAction any) *gomock.Call

NewTable indicates an expected call of NewTable.

func (*MockBridgeMockRecorder) ResumePacket

func (mr *MockBridgeMockRecorder) ResumePacket(packetIn any) *gomock.Call

ResumePacket indicates an expected call of ResumePacket.

func (*MockBridgeMockRecorder) SendPacketOut

func (mr *MockBridgeMockRecorder) SendPacketOut(packetOut any) *gomock.Call

SendPacketOut indicates an expected call of SendPacketOut.

func (*MockBridgeMockRecorder) SubscribePacketIn

func (mr *MockBridgeMockRecorder) SubscribePacketIn(category, pktInQueue any) *gomock.Call

SubscribePacketIn indicates an expected call of SubscribePacketIn.

type SecureConnection

type SecureConnection struct {
	OFBridge openflow.Bridge
	// contains filtered or unexported fields
}

SecureConnection encapsulates configuration for monitoring server connection

func NewSecureConnection

func NewSecureConnection(mgr manager.Manager, bridge openflow.Bridge, timeout time.Duration) (*SecureConnection, error)

NewSecureConnection creates a new SecureConnection

func (*SecureConnection) DeleteAllFlows

func (sc *SecureConnection) DeleteAllFlows() error

func (*SecureConnection) Monitor

func (sc *SecureConnection) Monitor(ctx context.Context)

Monitor starts a goroutine to periodically check the server connection status. If check fails, attempt to reconnect using exponential backoff. If it cannot re-establish a connection within the specified time, it flags and process disconnection event handler.

type ServiceChainReconciler

type ServiceChainReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	NodeName string
	OFTable  openflow.Table
	OFBridge openflow.Bridge
	OVS      ovsutils.API
	Exec     kexec.Interface
}

ServiceChainReconciler reconciles a ServiceChain object

func (*ServiceChainReconciler) EnsureCustomFlowsForChain

func (r *ServiceChainReconciler) EnsureCustomFlowsForChain(ctx context.Context, sc *dpuservicev1.ServiceChain) error

func (*ServiceChainReconciler) Reconcile

func (r *ServiceChainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

func (*ServiceChainReconciler) SetupWithManager

func (r *ServiceChainReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ServiceInterfaceReconciler

type ServiceInterfaceReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	NodeName string
	OVS      ovsutils.API
}

ServiceInterfaceReconciler reconciles a ServiceInterface object

func (*ServiceInterfaceReconciler) Reconcile

func (r *ServiceInterfaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ServiceInterfaceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type StaleObjectRemover

type StaleObjectRemover struct {
	OFBridge openflow.Bridge
	OVS      ovsutils.API
	// contains filtered or unexported fields
}

func NewStaleObjectRemover

func NewStaleObjectRemover(duration time.Duration, client client.Client, ofb openflow.Bridge, ovs ovsutils.API) *StaleObjectRemover

func (*StaleObjectRemover) Start

func (r *StaleObjectRemover) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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