fabric

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FabricId = "Rabbit"
)

Variables

This section is empty.

Functions

func FabricIdConnectionsConnectionIdGet

func FabricIdConnectionsConnectionIdGet(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error

FabricIdConnectionsConnectionIdGet

func FabricIdConnectionsConnectionIdPatch

func FabricIdConnectionsConnectionIdPatch(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error

FabricIdConnectionsConnectionIdPatch -

func FabricIdConnectionsGet

func FabricIdConnectionsGet(fabricId string, model *sf.ConnectionCollectionConnectionCollection) error

FabricIdConnectionsGet -

func FabricIdEndpointGroupsEndpointIdGet

func FabricIdEndpointGroupsEndpointIdGet(fabricId string, groupId string, model *sf.EndpointGroupV130EndpointGroup) error

func FabricIdEndpointGroupsGet

func FabricIdEndpointGroupsGet(fabricId string, model *sf.EndpointGroupCollectionEndpointGroupCollection) error

FabricIdEndpointGroupsGet -

func FabricIdEndpointsEndpointIdGet

func FabricIdEndpointsEndpointIdGet(fabricId string, endpointId string, model *sf.EndpointV150Endpoint) error

FabricIdEndpointsEndpointIdGet -

func FabricIdEndpointsGet

func FabricIdEndpointsGet(fabricId string, model *sf.EndpointCollectionEndpointCollection) error

FabricIdEndpointsGet -

func FabricIdGet

func FabricIdGet(fabricId string, model *sf.FabricV120Fabric) error

FabricIdGet -

func FabricIdSwitchesGet

func FabricIdSwitchesGet(fabricId string, model *sf.SwitchCollectionSwitchCollection) error

FabricIdSwitchesGet -

func FabricIdSwitchesSwitchIdGet

func FabricIdSwitchesSwitchIdGet(fabricId string, switchId string, model *sf.SwitchV140Switch) error

FabricIdSwitchesSwitchIdGet -

func FabricIdSwitchesSwitchIdPortsGet

func FabricIdSwitchesSwitchIdPortsGet(fabricId string, switchId string, model *sf.PortCollectionPortCollection) error

FabricIdSwitchesSwitchIdPortsGet -

func FabricIdSwitchesSwitchIdPortsPortIdGet

func FabricIdSwitchesSwitchIdPortsPortIdGet(fabricId string, switchId string, portId string, model *sf.PortV130Port) error

FabricIdSwitchesSwitchIdPortsPortIdGet -

func Get

Get -

func GetPortPDFID

func GetPortPDFID(fabricId, switchId, portId string, controllerId uint16) (uint16, error)

GetPortPDFID

func GetSwitchDevice

func GetSwitchDevice(fabricId, switchId string) *switchtec.Device

func GetSwitchPath

func GetSwitchPath(fabricId, switchId string) *string

func Initialize

func Initialize(log ec.Logger, ctrl SwitchtecControllerInterface) error

Initialize

func NewDefaultApiRouter

func NewDefaultApiRouter(s Api, c SwitchtecControllerInterface) ec.Router

NewDefaultApiRouter -

func NewFabricMonitor

func NewFabricMonitor(f *Fabric) *monitor

The Fabric Monitor is responsible for ensuring that the fabriic and related sub-resource are updated with the latest information from the switch. This runs as a background thread, and periodically queries the fabric.

func Start

func Start() error

Start -

Types

type Api

type Api interface {
	RedfishV1FabricsGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdGet(w http.ResponseWriter, r *http.Request)

	RedfishV1FabricsFabricIdSwitchesGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdSwitchesSwitchIdGet(w http.ResponseWriter, r *http.Request)

	RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet(w http.ResponseWriter, r *http.Request)

	RedfishV1FabricsFabricIdEndpointsGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdEndpointsEndpointIdGet(w http.ResponseWriter, r *http.Request)

	RedfishV1FabricsFabricIdEndpointGroupsGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet(w http.ResponseWriter, r *http.Request)

	RedfishV1FabricsFabricIdConnectionsGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdConnectionsConnectionIdGet(w http.ResponseWriter, r *http.Request)
	RedfishV1FabricsFabricIdConnectionsConnectionIdPatch(w http.ResponseWriter, r *http.Request)
}

Api - defines an interface for Near-Node Flash related methods

func NewDefaultApiService

func NewDefaultApiService() Api

NewDefaultApiService -

type ConfigFile

type ConfigFile struct {
	Version  string
	Metadata struct {
		Name string
	}

	ManagementConfig ManagementConfig `yaml:"managementConfig"`
	Switches         []SwitchConfig

	ManagementPortCount int
	UpstreamPortCount   int
	DownstreamPortCount int
}

func (*ConfigFile) IsManagementRoutingEnabled

func (c *ConfigFile) IsManagementRoutingEnabled() bool

Method returns True if the management configuration has routing enabled, False otherwise. Management Routing is when one PAX is controlled through another device - this is needed on bringup configurations where there is not a Rabbit-P that is connected to both systems.

type Connection

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

type DefaultApiRouter

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

DefaultApiRouter -

func (*DefaultApiRouter) Close

func (r *DefaultApiRouter) Close() error

Close -

func (*DefaultApiRouter) Init

func (r *DefaultApiRouter) Init(log ec.Logger) error

Init -

func (*DefaultApiRouter) Name

func (*DefaultApiRouter) Name() string

Name -

func (*DefaultApiRouter) Routes

func (r *DefaultApiRouter) Routes() ec.Routes

Routes -

func (*DefaultApiRouter) Start

func (r *DefaultApiRouter) Start() error

Start -

type DefaultApiService

type DefaultApiService struct {
}

DefaultApiService -

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdConnectionsConnectionIdGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdConnectionsConnectionIdPatch -

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsGet

func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdConnectionsGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet(w http.ResponseWriter, r *http.Request)

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsGet

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsGet(w http.ResponseWriter, r *http.Request)

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsEndpointIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsEndpointIdGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdEndpointsEndpointIdGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsGet

func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdEndpointsGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesGet

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdSwitchesGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdSwitchesSwitchIdGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet -

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet

func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet -

func (*DefaultApiService) RedfishV1FabricsGet

func (*DefaultApiService) RedfishV1FabricsGet(w http.ResponseWriter, r *http.Request)

RedfishV1FabricsGet -

type Endpoint

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

func GetEndpoint

func GetEndpoint(switchId, portId string) (*Endpoint, error)

GetEndpoint - Returns the first endpoint for the given switch port. For USP, there will only ever be one ID. For DSP there will be an endpoint for each Physical and Virtual Functions on the DSP, but the first ID (corresponding to the PF) is what is returned.

func (*Endpoint) ControllerId

func (e *Endpoint) ControllerId() uint16

func (*Endpoint) Id

func (e *Endpoint) Id() string

Getters for common endpoint calls

func (*Endpoint) Index

func (e *Endpoint) Index() int

func (*Endpoint) Name

func (e *Endpoint) Name() string

func (*Endpoint) OdataId

func (e *Endpoint) OdataId() string

func (*Endpoint) Type

type EndpointGroup

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

Endpoint Group is represents a collection of endpoints and the related Connection. Only one Endpoint Intitator may belong to a group, with the remaining endpoints expected to be Drive types. An Endpoint Group is equivalent to a Host-Virtualization Domain defiend on the Switchtec device, with the exception of the Endpoint Group containing the Processor (i.e Rabbit) - for this EPG contains two, smaller HVDs that point to the switch-local DSPs.

type Fabric

type Fabric struct {
	// contains filtered or unexported fields
}
var FabricController *Fabric

Used to provide access to exported functions while protecting the singleton (i.e. manager)

func (*Fabric) EventHandler

func (m *Fabric) EventHandler(e event.Event) error

func (*Fabric) FindDownstreamEndpoint

func (f *Fabric) FindDownstreamEndpoint(portId, functionId string) (string, error)

FindDownstreamEndpoint -

func (*Fabric) GetDownstreamPortRelativePortIndex

func (f *Fabric) GetDownstreamPortRelativePortIndex(switchId, portId string) (int, error)

func (*Fabric) GetSwitchPort

func (f *Fabric) GetSwitchPort(switchId, portId string) (*Port, error)

func (*Fabric) ResetEndpoint

func (f *Fabric) ResetEndpoint(switchId, portId string, vfIndex int) error

type ManagementConfig

type ManagementConfig struct {
	PrimaryDevice   int32 `yaml:"primaryDevice"`
	SecondaryDevice int32 `yaml:"secondaryDevice"`
}

type MockSwitchtecController

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

func (*MockSwitchtecController) Open

func (*MockSwitchtecController) SetSwitchNotExists

func (c *MockSwitchtecController) SetSwitchNotExists(switchIdx int)

type MockSwitchtecDevice

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

func (*MockSwitchtecDevice) Bind

func (d *MockSwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error

func (*MockSwitchtecDevice) Close

func (d *MockSwitchtecDevice) Close()

func (*MockSwitchtecDevice) Device

func (*MockSwitchtecDevice) EnumerateEndpoint

func (d *MockSwitchtecDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error

func (*MockSwitchtecDevice) GetEvents

func (d *MockSwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)

func (*MockSwitchtecDevice) GetFirmwareVersion

func (d *MockSwitchtecDevice) GetFirmwareVersion() (string, error)

func (*MockSwitchtecDevice) GetManufacturer

func (d *MockSwitchtecDevice) GetManufacturer() (string, error)

func (*MockSwitchtecDevice) GetModel

func (d *MockSwitchtecDevice) GetModel() (string, error)

func (*MockSwitchtecDevice) GetPortMetrics

func (d *MockSwitchtecDevice) GetPortMetrics() (PortMetrics, error)

func (*MockSwitchtecDevice) GetPortStatus

func (d *MockSwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)

func (*MockSwitchtecDevice) GetSerialNumber

func (d *MockSwitchtecDevice) GetSerialNumber() (string, error)

func (*MockSwitchtecDevice) Identify

func (d *MockSwitchtecDevice) Identify() (int32, error)

func (*MockSwitchtecDevice) Path

func (*MockSwitchtecDevice) Path() *string

func (*MockSwitchtecDevice) ResetEndpoint

func (d *MockSwitchtecDevice) ResetEndpoint(pdfid uint16) error

type MockSwitchtecPort

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

type Port

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

func (*Port) GetBaseEndpointIndex

func (p *Port) GetBaseEndpointIndex() int

func (*Port) GetSlot

func (p *Port) GetSlot() int64

func (*Port) Initialize

func (p *Port) Initialize() error

type PortConfig

type PortConfig struct {
	Id    string
	Name  string
	Type  string
	Port  int
	Slot  int
	Width int
}

type PortMetric

type PortMetric struct {
	PhysPortId uint8

	// NOTE: This is a terrible definition in the switchtec package - these are raw Tx/Rx counter values
	// that can be _used_ for calculating the bandwidth. Think about renaming this in the switchtec package
	// to something like "PortMetrics"
	switchtec.BandwidthCounter
}

type PortMetrics

type PortMetrics []PortMetric

type Switch

type Switch struct {
	DEBUG_NEXT_SWITCH_LOG_PORT_ID int
	// contains filtered or unexported fields
}

type SwitchConfig

type SwitchConfig struct {
	Id       string
	Metadata struct {
		Name string
	}
	PciGen int32 `yaml:"pciGen"`
	Ports  []PortConfig

	ManagementPortCount int
	UpstreamPortCount   int
	DownstreamPortCount int
}

type SwitchtecCliController

type SwitchtecCliController struct{}

func (SwitchtecCliController) Exists

func (c SwitchtecCliController) Exists(path string) bool

func (SwitchtecCliController) Open

type SwitchtecCliDevice

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

func (*SwitchtecCliDevice) Bind

func (d *SwitchtecCliDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error

func (*SwitchtecCliDevice) Close

func (d *SwitchtecCliDevice) Close()

func (*SwitchtecCliDevice) Device

func (d *SwitchtecCliDevice) Device() *switchtec.Device

func (*SwitchtecCliDevice) EnumerateEndpoint

func (d *SwitchtecCliDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error

func (*SwitchtecCliDevice) GetEvents

func (d *SwitchtecCliDevice) GetEvents() ([]switchtec.GfmsEvent, error)

func (*SwitchtecCliDevice) GetFirmwareVersion

func (d *SwitchtecCliDevice) GetFirmwareVersion() (string, error)

func (*SwitchtecCliDevice) GetManufacturer

func (d *SwitchtecCliDevice) GetManufacturer() (string, error)

func (*SwitchtecCliDevice) GetModel

func (d *SwitchtecCliDevice) GetModel() (string, error)

func (*SwitchtecCliDevice) GetPortMetrics

func (d *SwitchtecCliDevice) GetPortMetrics() (PortMetrics, error)

func (*SwitchtecCliDevice) GetPortStatus

func (d *SwitchtecCliDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)

func (*SwitchtecCliDevice) GetSerialNumber

func (d *SwitchtecCliDevice) GetSerialNumber() (string, error)

func (*SwitchtecCliDevice) Identify

func (d *SwitchtecCliDevice) Identify() (int32, error)

func (*SwitchtecCliDevice) Path

func (d *SwitchtecCliDevice) Path() *string

func (*SwitchtecCliDevice) ResetEndpoint

func (d *SwitchtecCliDevice) ResetEndpoint(pdfid uint16) error

type SwitchtecController

type SwitchtecController struct{}

func (SwitchtecController) Exists

func (SwitchtecController) Exists(path string) bool

func (SwitchtecController) Open

type SwitchtecControllerInterface

type SwitchtecControllerInterface interface {
	Open(path string) (SwitchtecDeviceInterface, error)
}

func NewMockSwitchtecController

func NewMockSwitchtecController() SwitchtecControllerInterface

func NewSwitchtecCliController

func NewSwitchtecCliController() SwitchtecControllerInterface

func NewSwitchtecController

func NewSwitchtecController() SwitchtecControllerInterface

type SwitchtecDevice

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

func (*SwitchtecDevice) Bind

func (d *SwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error

func (*SwitchtecDevice) Close

func (d *SwitchtecDevice) Close()

func (*SwitchtecDevice) Device

func (d *SwitchtecDevice) Device() *switchtec.Device

func (*SwitchtecDevice) EnumerateEndpoint

func (d *SwitchtecDevice) EnumerateEndpoint(id uint8, f func(epPort *switchtec.DumpEpPortDevice) error) error

func (*SwitchtecDevice) GetEvents

func (d *SwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)

func (*SwitchtecDevice) GetFirmwareVersion

func (d *SwitchtecDevice) GetFirmwareVersion() (string, error)

func (*SwitchtecDevice) GetManufacturer

func (d *SwitchtecDevice) GetManufacturer() (string, error)

func (*SwitchtecDevice) GetModel

func (d *SwitchtecDevice) GetModel() (string, error)

func (*SwitchtecDevice) GetPortMetrics

func (d *SwitchtecDevice) GetPortMetrics() (PortMetrics, error)

func (*SwitchtecDevice) GetPortStatus

func (d *SwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)

func (*SwitchtecDevice) GetSerialNumber

func (d *SwitchtecDevice) GetSerialNumber() (string, error)

func (*SwitchtecDevice) Identify

func (d *SwitchtecDevice) Identify() (int32, error)

func (*SwitchtecDevice) Path

func (d *SwitchtecDevice) Path() *string

func (*SwitchtecDevice) ResetEndpoint

func (d *SwitchtecDevice) ResetEndpoint(pdfid uint16) error

type SwitchtecDeviceInterface

type SwitchtecDeviceInterface interface {
	// these are ugly getters for the nvme devices to get attributes
	// about the device interface. Not sure how to make this less crap
	// without adding an unnecessarily large abstraction. I'll keep it
	// for now until something better is found.
	Device() *switchtec.Device
	Path() *string

	Close()

	Identify() (int32, error)

	GetFirmwareVersion() (string, error)
	GetModel() (string, error)
	GetManufacturer() (string, error)
	GetSerialNumber() (string, error)

	GetPortStatus() ([]switchtec.PortLinkStat, error)
	GetPortMetrics() (PortMetrics, error)
	GetEvents() ([]switchtec.GfmsEvent, error)

	EnumerateEndpoint(uint8, func(epPort *switchtec.DumpEpPortDevice) error) error
	ResetEndpoint(uint16) error

	Bind(uint8, uint8, uint16) error
}

Jump to

Keyboard shortcuts

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