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.
Package controller is a generated GoMock package.
Package controller is a generated GoMock package.
Package controller is a generated GoMock package.
Copyright 2026 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.
Index ¶
- Constants
- func AddInterfacesToOvs(ctx context.Context, ovs ovsutils.API, ...) error
- func AddPatchPort(ctx context.Context, ovs ovsutils.API, brA, brB string, ...) error
- func AddPort(ctx context.Context, ovs ovsutils.API, portName string, ...) error
- func DeleteInterfacesFromOvs(ctx context.Context, ovs ovsutils.API, ...) error
- func DeletePatchPorts(ctx context.Context, ovs ovsutils.API, brA, brB string, ...) error
- func FigureOutName(ctx context.Context, networkHelper networkhelper.NetworkHelper, ...) (string, error)
- func GetMgrCache(nodeName string, syncPeriod time.Duration) cache.Options
- type MockBridge
- func (m *MockBridge) AddFlowsInBundle(addflows, modFlows, delFlows []*openflow15.FlowMod) error
- func (m *MockBridge) AddOFEntriesInBundle(addEntries, modEntries, delEntries []openflow.OFEntry) error
- func (m *MockBridge) BuildPacketOut() openflow.PacketOutBuilder
- func (m *MockBridge) Connect(maxRetrySec int, connectCh chan struct{}) error
- func (m *MockBridge) DeleteFlowsByCookie(cookieID, cookieMask uint64) error
- func (m *MockBridge) DeleteGroupAll() error
- func (m *MockBridge) DeleteMeterAll() error
- func (m *MockBridge) Disconnect() error
- func (m *MockBridge) DumpFlows(cookieID, cookieMask uint64) (map[uint64]*openflow.FlowStates, error)
- func (m *MockBridge) DumpTableStatus() []openflow.TableStatus
- func (m *MockBridge) EXPECT() *MockBridgeMockRecorder
- func (m *MockBridge) GetMeterStats(handleMeterStatsReply func(int, int64)) error
- func (m *MockBridge) GetTableByID(id uint8) (openflow.Table, error)
- func (m *MockBridge) IsConnected() bool
- func (m *MockBridge) NewGroup(id openflow.GroupIDType) openflow.Group
- func (m *MockBridge) NewGroupTypeAll(id openflow.GroupIDType) openflow.Group
- func (m *MockBridge) NewMeter(id openflow.MeterIDType, flags ofctrl.MeterFlag) openflow.Meter
- func (m *MockBridge) NewTable(table openflow.Table, next uint8, missAction openflow.MissActionType) openflow.Table
- func (m *MockBridge) ResumePacket(packetIn *ofctrl.PacketIn) error
- func (m *MockBridge) SendPacketOut(packetOut *ofctrl.PacketOut) error
- func (m *MockBridge) SubscribePacketIn(category uint8, pktInQueue *openflow.PacketInQueue) error
- type MockBridgeMockRecorder
- func (mr *MockBridgeMockRecorder) AddFlowsInBundle(addflows, modFlows, delFlows any) *gomock.Call
- func (mr *MockBridgeMockRecorder) AddOFEntriesInBundle(addEntries, modEntries, delEntries any) *gomock.Call
- func (mr *MockBridgeMockRecorder) BuildPacketOut() *gomock.Call
- func (mr *MockBridgeMockRecorder) Connect(maxRetrySec, connectCh any) *gomock.Call
- func (mr *MockBridgeMockRecorder) DeleteFlowsByCookie(cookieID, cookieMask any) *gomock.Call
- func (mr *MockBridgeMockRecorder) DeleteGroupAll() *gomock.Call
- func (mr *MockBridgeMockRecorder) DeleteMeterAll() *gomock.Call
- func (mr *MockBridgeMockRecorder) Disconnect() *gomock.Call
- func (mr *MockBridgeMockRecorder) DumpFlows(cookieID, cookieMask any) *gomock.Call
- func (mr *MockBridgeMockRecorder) DumpTableStatus() *gomock.Call
- func (mr *MockBridgeMockRecorder) GetMeterStats(handleMeterStatsReply any) *gomock.Call
- func (mr *MockBridgeMockRecorder) GetTableByID(id any) *gomock.Call
- func (mr *MockBridgeMockRecorder) IsConnected() *gomock.Call
- func (mr *MockBridgeMockRecorder) NewGroup(id any) *gomock.Call
- func (mr *MockBridgeMockRecorder) NewGroupTypeAll(id any) *gomock.Call
- func (mr *MockBridgeMockRecorder) NewMeter(id, flags any) *gomock.Call
- func (mr *MockBridgeMockRecorder) NewTable(table, next, missAction any) *gomock.Call
- func (mr *MockBridgeMockRecorder) ResumePacket(packetIn any) *gomock.Call
- func (mr *MockBridgeMockRecorder) SendPacketOut(packetOut any) *gomock.Call
- func (mr *MockBridgeMockRecorder) SubscribePacketIn(category, pktInQueue any) *gomock.Call
- type MockCmd
- func (m *MockCmd) CombinedOutput() ([]byte, error)
- func (m *MockCmd) EXPECT() *MockCmdMockRecorder
- func (m *MockCmd) Output() ([]byte, error)
- func (m *MockCmd) Run() error
- func (m *MockCmd) SetDir(dir string)
- func (m *MockCmd) SetEnv(env []string)
- func (m *MockCmd) SetStderr(out io.Writer)
- func (m *MockCmd) SetStdin(in io.Reader)
- func (m *MockCmd) SetStdout(out io.Writer)
- func (m *MockCmd) Start() error
- func (m *MockCmd) StderrPipe() (io.ReadCloser, error)
- func (m *MockCmd) StdoutPipe() (io.ReadCloser, error)
- func (m *MockCmd) Stop()
- func (m *MockCmd) Wait() error
- type MockCmdMockRecorder
- func (mr *MockCmdMockRecorder) CombinedOutput() *gomock.Call
- func (mr *MockCmdMockRecorder) Output() *gomock.Call
- func (mr *MockCmdMockRecorder) Run() *gomock.Call
- func (mr *MockCmdMockRecorder) SetDir(dir any) *gomock.Call
- func (mr *MockCmdMockRecorder) SetEnv(env any) *gomock.Call
- func (mr *MockCmdMockRecorder) SetStderr(out any) *gomock.Call
- func (mr *MockCmdMockRecorder) SetStdin(in any) *gomock.Call
- func (mr *MockCmdMockRecorder) SetStdout(out any) *gomock.Call
- func (mr *MockCmdMockRecorder) Start() *gomock.Call
- func (mr *MockCmdMockRecorder) StderrPipe() *gomock.Call
- func (mr *MockCmdMockRecorder) StdoutPipe() *gomock.Call
- func (mr *MockCmdMockRecorder) Stop() *gomock.Call
- func (mr *MockCmdMockRecorder) Wait() *gomock.Call
- type MockInterface
- type MockInterfaceMockRecorder
- type MockServiceChainAPI
- type MockServiceChainAPIMockRecorder
- type SecureConnection
- type ServiceChain
- type ServiceChainAPI
- type ServiceChainReconciler
- func (r *ServiceChainReconciler) EnsureCustomFlowsForChain(ctx context.Context, sc *dpuservicev1.ServiceChain) error
- func (r *ServiceChainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *ServiceChainReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- type ServiceInterfaceReconciler
- type StaleObjectRemover
Constants ¶
const ( CustomFlowsLabelKey = "svc.dpu.nvidia.com/custom-flows" CustomFlowsFireflyValue = "firefly" )
const ( BridgeSFC = "br-sfc" // Default OVS bridge name for Service Function Chaining 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 )
const ( ServiceInterfaceController = "serviceinterfacecontroller" ServiceInterfaceFinalizer = dpuservicev1.SvcDpuGroupName + "/ServiceInterface-finalizer" RequeueIntervalSuccess = 20 * time.Second RequeueIntervalError = 5 * time.Second SFCBridge = "br-sfc" OVNBridge = "br-ovn" InterfaceTypeDPDK = "dpdk" InterfaceTypePatch = "patch" )
Variables ¶
This section is empty.
Functions ¶
func AddInterfacesToOvs ¶
func AddInterfacesToOvs( ctx context.Context, ovs ovsutils.API, networkHelper networkhelper.NetworkHelper, serviceInterface *dpuservicev1.ServiceInterface, metadata string, ) error
func AddPatchPort ¶
func AddPatchPort(ctx context.Context, ovs ovsutils.API, brA, brB string, patchPort, peerPatchPort patchPortOptions) error
AddPatchPort creates a bidirectional OVS patch port connection between two bridges. The peer patch port is added first to ensure the operation fails if the brB bridge does not exist.
The function performs the following steps:
- Creates a patch port on brB with the given peerPatchPort (without peer option)
- Creates a patch port on brA with the given patchPort (without peer option)
- Sets the peer option on peerPatchPort to reference patchPort
- Sets the peer option on patchPort to reference peerPatchPort
- Sets patchExternalIDs to patchPort for identification
- Sets peerExternalIDs to peerPatchPort for identification
Returns an error if any OVS operation fails; partial state may remain on failure.
func DeleteInterfacesFromOvs ¶
func DeleteInterfacesFromOvs( ctx context.Context, ovs ovsutils.API, networkhelper networkhelper.NetworkHelper, serviceInterface *dpuservicev1.ServiceInterface, ) error
func DeletePatchPorts ¶
func DeletePatchPorts(ctx context.Context, ovs ovsutils.API, brA, brB string, patchPort, peerPatchPort string) error
DeletePatchPorts removes a bidirectional OVS patch port connection between two bridges. This is the inverse operation of AddPatchPort.
The function performs the following steps:
- Deletes the patch port from brA with the given patchPort
- Deletes the peer patch port from brB with the given patchPortPeer
Returns an error if any OVS operation fails; partial state may remain on failure.
func FigureOutName ¶
func FigureOutName(ctx context.Context, networkHelper networkhelper.NetworkHelper, serviceInterface *dpuservicev1.ServiceInterface) (string, error)
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 MockCmd ¶
type MockCmd struct {
// contains filtered or unexported fields
}
MockCmd is a mock of Cmd interface.
func NewMockCmd ¶
func NewMockCmd(ctrl *gomock.Controller) *MockCmd
NewMockCmd creates a new mock instance.
func (*MockCmd) CombinedOutput ¶
CombinedOutput mocks base method.
func (*MockCmd) EXPECT ¶
func (m *MockCmd) EXPECT() *MockCmdMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCmd) StderrPipe ¶
func (m *MockCmd) StderrPipe() (io.ReadCloser, error)
StderrPipe mocks base method.
func (*MockCmd) StdoutPipe ¶
func (m *MockCmd) StdoutPipe() (io.ReadCloser, error)
StdoutPipe mocks base method.
type MockCmdMockRecorder ¶
type MockCmdMockRecorder struct {
// contains filtered or unexported fields
}
MockCmdMockRecorder is the mock recorder for MockCmd.
func (*MockCmdMockRecorder) CombinedOutput ¶
func (mr *MockCmdMockRecorder) CombinedOutput() *gomock.Call
CombinedOutput indicates an expected call of CombinedOutput.
func (*MockCmdMockRecorder) Output ¶
func (mr *MockCmdMockRecorder) Output() *gomock.Call
Output indicates an expected call of Output.
func (*MockCmdMockRecorder) Run ¶
func (mr *MockCmdMockRecorder) Run() *gomock.Call
Run indicates an expected call of Run.
func (*MockCmdMockRecorder) SetDir ¶
func (mr *MockCmdMockRecorder) SetDir(dir any) *gomock.Call
SetDir indicates an expected call of SetDir.
func (*MockCmdMockRecorder) SetEnv ¶
func (mr *MockCmdMockRecorder) SetEnv(env any) *gomock.Call
SetEnv indicates an expected call of SetEnv.
func (*MockCmdMockRecorder) SetStderr ¶
func (mr *MockCmdMockRecorder) SetStderr(out any) *gomock.Call
SetStderr indicates an expected call of SetStderr.
func (*MockCmdMockRecorder) SetStdin ¶
func (mr *MockCmdMockRecorder) SetStdin(in any) *gomock.Call
SetStdin indicates an expected call of SetStdin.
func (*MockCmdMockRecorder) SetStdout ¶
func (mr *MockCmdMockRecorder) SetStdout(out any) *gomock.Call
SetStdout indicates an expected call of SetStdout.
func (*MockCmdMockRecorder) Start ¶
func (mr *MockCmdMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start.
func (*MockCmdMockRecorder) StderrPipe ¶
func (mr *MockCmdMockRecorder) StderrPipe() *gomock.Call
StderrPipe indicates an expected call of StderrPipe.
func (*MockCmdMockRecorder) StdoutPipe ¶
func (mr *MockCmdMockRecorder) StdoutPipe() *gomock.Call
StdoutPipe indicates an expected call of StdoutPipe.
func (*MockCmdMockRecorder) Stop ¶
func (mr *MockCmdMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
func (*MockCmdMockRecorder) Wait ¶
func (mr *MockCmdMockRecorder) Wait() *gomock.Call
Wait indicates an expected call of Wait.
type MockInterface ¶
type MockInterface struct {
// contains filtered or unexported fields
}
MockInterface is a mock of Interface interface.
func NewMockInterface ¶
func NewMockInterface(ctrl *gomock.Controller) *MockInterface
NewMockInterface creates a new mock instance.
func (*MockInterface) Command ¶
func (m *MockInterface) Command(cmd string, args ...string) exec.Cmd
Command mocks base method.
func (*MockInterface) CommandContext ¶
CommandContext mocks base method.
func (*MockInterface) EXPECT ¶
func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockInterfaceMockRecorder ¶
type MockInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockInterfaceMockRecorder is the mock recorder for MockInterface.
func (*MockInterfaceMockRecorder) Command ¶
func (mr *MockInterfaceMockRecorder) Command(cmd any, args ...any) *gomock.Call
Command indicates an expected call of Command.
func (*MockInterfaceMockRecorder) CommandContext ¶
func (mr *MockInterfaceMockRecorder) CommandContext(ctx, cmd any, args ...any) *gomock.Call
CommandContext indicates an expected call of CommandContext.
type MockServiceChainAPI ¶
type MockServiceChainAPI struct {
// contains filtered or unexported fields
}
MockServiceChainAPI is a mock of ServiceChainAPI interface.
func NewMockServiceChainAPI ¶
func NewMockServiceChainAPI(ctrl *gomock.Controller) *MockServiceChainAPI
NewMockServiceChainAPI creates a new mock instance.
func (*MockServiceChainAPI) EXPECT ¶
func (m *MockServiceChainAPI) EXPECT() *MockServiceChainAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockServiceChainAPI) GenerateAndApplyOpenFlows ¶
func (m *MockServiceChainAPI) GenerateAndApplyOpenFlows(ctx context.Context, ports [][]string, hashedName uint64) error
GenerateAndApplyOpenFlows mocks base method.
type MockServiceChainAPIMockRecorder ¶
type MockServiceChainAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceChainAPIMockRecorder is the mock recorder for MockServiceChainAPI.
func (*MockServiceChainAPIMockRecorder) GenerateAndApplyOpenFlows ¶
func (mr *MockServiceChainAPIMockRecorder) GenerateAndApplyOpenFlows(ctx, ports, hashedName any) *gomock.Call
GenerateAndApplyOpenFlows indicates an expected call of GenerateAndApplyOpenFlows.
type SecureConnection ¶
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 ServiceChain ¶
type ServiceChain struct {
OPFlow oflow.OpenFlowAPI
}
func (*ServiceChain) GenerateAndApplyOpenFlows ¶
func (s *ServiceChain) GenerateAndApplyOpenFlows(ctx context.Context, ports [][]string, hashedName uint64) error
GenerateAndApplyOpenFlows generates and applies OpenFlow rules to the service chain. This loop processes each switch in the service chain. For each switch (represented by an array of ports), (chain is an array of switches), builds OpenFlow rules that enable communication between all ports in the switch The flows implement a simple L2 learning switch behavior where:
- Unknown destination traffic is flooded to all other ports
- Known destination traffic is forwarded only to the learned port
For each port in a switch, create
- Learn actions for mac learning that dynamically create flows based on observed traffic
- Output actions to forward traffic to all other ports in the same switch
Sample of generated learning flows inside an array ovs-ofctl add-flow br-sfc "in_port=$a,actions=learn(idle_timeout=10,priority=1,in_port=$b,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),learn(idle_timeout=10,priority=1,
in_port=$c,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),output:$b,output:$c"
ovs-ofctl add-flow br-sfc "in_port=$b,actions=learn(idle_timeout=10,priority=1,in_port=$a,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),learn(idle_timeout=10,priority=1,
in_port=$c,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),output:$a,output:$c"
ovs-ofctl add-flow br-sfc "in_port=$c,actions=learn(idle_timeout=10,priority=1,in_port=$a,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),learn(idle_timeout=10,priority=1,
in_port=$b,dl_dst=dl_src,output:NXM_OF_IN_PORT[]),output:$a,output:$b"
don't fail immediately, operate on best effort basis to enable partial chains to enable some of the traffic to pass
type ServiceChainAPI ¶
type ServiceChainReconciler ¶
type ServiceChainReconciler struct {
client.Client
Scheme *runtime.Scheme
NodeName string
BridgeName string
OFTable openflow.Table
OFBridge openflow.Bridge
OVS ovsutils.API
Exec kexec.Interface
SC ServiceChainAPI
OPFlow oflow.OpenFlowAPI
}
ServiceChainReconciler reconciles a ServiceChain object
func (*ServiceChainReconciler) EnsureCustomFlowsForChain ¶
func (r *ServiceChainReconciler) EnsureCustomFlowsForChain(ctx context.Context, sc *dpuservicev1.ServiceChain) error
func (*ServiceChainReconciler) SetupWithManager ¶
SetupWithManager sets up the controller with the Manager.
type ServiceInterfaceReconciler ¶
type ServiceInterfaceReconciler struct {
client.Client
Scheme *runtime.Scheme
NodeName string
OVS ovsutils.API
NetworkHelper networkhelper.NetworkHelper
}
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
NetworkHelper networkhelper.NetworkHelper
// contains filtered or unexported fields
}
func NewStaleObjectRemover ¶
func NewStaleObjectRemover( duration time.Duration, client client.Client, ofb openflow.Bridge, ovs ovsutils.API, networkHelper networkhelper.NetworkHelper, ) *StaleObjectRemover