Documentation
¶
Index ¶
- Variables
- func DetectVMD() (*hardware.PCIAddressSet, error)
- func Dup2(oldfd, newfd int) error
- func FaultBadPCIAddr(pciAddr string) *fault.Fault
- func FaultFormatError(dev string, err error) *fault.Fault
- func FaultFormatUnknownClass(class string) *fault.Fault
- type AccelPropsParams
- type AioCreateParams
- type AutoFaultyParams
- type Backend
- type DaosConfig
- type DaosConfigParams
- type DaosData
- type HotplugBusidRangeParams
- type MockBackend
- func (mb *MockBackend) Format(req storage.BdevFormatRequest) (*storage.BdevFormatResponse, error)
- func (mb *MockBackend) Prepare(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
- func (mb *MockBackend) Reset(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
- func (mb *MockBackend) Scan(req storage.BdevScanRequest) (*storage.BdevScanResponse, error)
- func (mb *MockBackend) UpdateFirmware(_ string, _ string, _ int32) error
- func (mb *MockBackend) WriteConfig(req storage.BdevWriteConfigRequest) (*storage.BdevWriteConfigResponse, error)
- type MockBackendConfig
- type NvmeAttachControllerParams
- type NvmeSetHotplugParams
- type NvmeSetOptionsParams
- type Provider
- func (p *Provider) Format(req storage.BdevFormatRequest) (*storage.BdevFormatResponse, error)
- func (p *Provider) Prepare(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
- func (p *Provider) QueryFirmware(req storage.NVMeFirmwareQueryRequest) (*storage.NVMeFirmwareQueryResponse, error)
- func (p *Provider) Scan(req storage.BdevScanRequest) (resp *storage.BdevScanResponse, err error)
- func (p *Provider) UpdateFirmware(req storage.NVMeFirmwareUpdateRequest) (*storage.NVMeFirmwareUpdateResponse, error)
- func (p *Provider) WriteConfig(req storage.BdevWriteConfigRequest) (*storage.BdevWriteConfigResponse, error)
- type SetOptionsParams
- type SpdkConfig
- type SpdkRpcServerParams
- type SpdkSubsystem
- type SpdkSubsystemConfig
- type SpdkSubsystemConfigParams
- type VmdEnableParams
Constants ¶
This section is empty.
Variables ¶
var ( // FaultUnknown represents an unspecified bdev error. FaultUnknown = bdevFault(code.BdevUnknown, "unknown bdev error", "") // FaultDuplicateDevices represents an error where a user provided duplicate // device IDs in an input. FaultDuplicateDevices = bdevFault(code.BdevDuplicatesInDeviceList, "duplicates in NVMe device list", "check your device list and try again") // FaultNoFilterMatch represents an error where no devices were found that // matched user-provided filter criteria. FaultNoFilterMatch = bdevFault(code.BdevNoDevicesMatchFilter, "no NVMe device controllers matched the filter criteria", "adjust or relax the filters and try again") )
Functions ¶
func DetectVMD ¶
func DetectVMD() (*hardware.PCIAddressSet, error)
DetectVMD returns whether VMD devices have been found and a slice of VMD PCI addresses if found. Implements vmdDetectFn.
func FaultBadPCIAddr ¶
FaultBadPCIAddr creates a Fault for the case where a user-provided PCI address was invalid.
func FaultFormatError ¶
FaultFormatError creates a Fault for the case where an attempted device format failed.
func FaultFormatUnknownClass ¶
FaultFormatUnknownClass creates a Fault for the case where a user requested a device format for an unknown device class.
Types ¶
type AccelPropsParams ¶
type AccelPropsParams storage.AccelProps
AccelPropsParams specifies details for a storage.ConfSetAccelProps method.
type AioCreateParams ¶
type AioCreateParams struct { BlockSize uint64 `json:"block_size"` DeviceName string `json:"name"` Filename string `json:"filename"` }
AioCreateParams specifies details for a storage.ConfAioCreate method.
type AutoFaultyParams ¶
type AutoFaultyParams storage.BdevAutoFaulty
AutoFaultyParams specifies details for a storage.ConfSetAutoFaultyProp method.
type Backend ¶
type Backend interface { Prepare(storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error) Reset(storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error) Scan(storage.BdevScanRequest) (*storage.BdevScanResponse, error) Format(storage.BdevFormatRequest) (*storage.BdevFormatResponse, error) UpdateFirmware(pciAddr string, path string, slot int32) error WriteConfig(storage.BdevWriteConfigRequest) (*storage.BdevWriteConfigResponse, error) }
Backend defines a set of methods to be implemented by a Block Device backend.
type DaosConfig ¶
type DaosConfig struct { Params DaosConfigParams `json:"params"` Method string `json:"method"` }
DaosConfig entries apply to the DAOS entry.
type DaosConfigParams ¶
type DaosConfigParams interface {
// contains filtered or unexported methods
}
DaosConfigParams is an interface that defines an object that contains details for a DAOS configuration method.
type DaosData ¶
type DaosData struct {
Configs []*DaosConfig `json:"config"`
}
DaosData entries contain a number of DaosConfig entries and make up the DaosData field of a SpdkConfig.
type HotplugBusidRangeParams ¶
HotplugBusidRangeParams specifies details for a storage.ConfSetHotplugBusidRange method.
type MockBackend ¶
type MockBackend struct { sync.RWMutex PrepareCalls []storage.BdevPrepareRequest ResetCalls []storage.BdevPrepareRequest WriteConfCalls []storage.BdevWriteConfigRequest ScanCalls []storage.BdevScanRequest // contains filtered or unexported fields }
func DefaultMockBackend ¶
func DefaultMockBackend() *MockBackend
func NewMockBackend ¶
func NewMockBackend(cfg *MockBackendConfig) *MockBackend
func (*MockBackend) Format ¶
func (mb *MockBackend) Format(req storage.BdevFormatRequest) (*storage.BdevFormatResponse, error)
func (*MockBackend) Prepare ¶
func (mb *MockBackend) Prepare(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
func (*MockBackend) Reset ¶
func (mb *MockBackend) Reset(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
func (*MockBackend) Scan ¶
func (mb *MockBackend) Scan(req storage.BdevScanRequest) (*storage.BdevScanResponse, error)
func (*MockBackend) UpdateFirmware ¶
func (mb *MockBackend) UpdateFirmware(_ string, _ string, _ int32) error
func (*MockBackend) WriteConfig ¶
func (mb *MockBackend) WriteConfig(req storage.BdevWriteConfigRequest) (*storage.BdevWriteConfigResponse, error)
type MockBackendConfig ¶
type MockBackendConfig struct { VMDEnabled bool // VMD is disabled by default PrepareRes *storage.BdevPrepareResponse PrepareErr error ResetRes *storage.BdevPrepareResponse ResetErr error ScanRes *storage.BdevScanResponse ScanErr error FormatRes *storage.BdevFormatResponse FormatErr error WriteConfRes *storage.BdevWriteConfigResponse WriteConfErr error UpdateErr error }
type NvmeAttachControllerParams ¶
type NvmeAttachControllerParams struct { TransportType string `json:"trtype"` DeviceName string `json:"name"` TransportAddress string `json:"traddr"` }
NvmeAttachControllerParams specifies details for a storage.ConfBdevNvmeAttachController method.
type NvmeSetHotplugParams ¶
type NvmeSetHotplugParams struct { Enable bool `json:"enable"` PeriodUsec uint64 `json:"period_us"` }
NvmeSetHotplugParams specifies details for a storage.ConfBdevNvmeSetHotplug method.
type NvmeSetOptionsParams ¶
type NvmeSetOptionsParams struct { RetryCount uint32 `json:"retry_count"` TimeoutUsec uint64 `json:"timeout_us"` NvmeAdminqPollPeriodUsec uint32 `json:"nvme_adminq_poll_period_us"` ActionOnTimeout string `json:"action_on_timeout"` NvmeIoqPollPeriodUsec uint32 `json:"nvme_ioq_poll_period_us"` }
NvmeSetOptionsParams specifies details for a storage.ConfBdevNvmeSetOptions method.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider encapsulates configuration and logic for interacting with a Block Device Backend.
func DefaultMockProvider ¶
func DefaultProvider ¶
DefaultProvider returns an initialized *Provider suitable for use in production code.
func NewMockProvider ¶
func NewMockProvider(log logging.Logger, mbc *MockBackendConfig) *Provider
func NewProvider ¶
NewProvider returns an initialized *Provider.
func (*Provider) Format ¶
func (p *Provider) Format(req storage.BdevFormatRequest) (*storage.BdevFormatResponse, error)
Format attempts to initialize NVMe devices for use by DAOS. Note that this is a no-op for non-NVMe devices.
func (*Provider) Prepare ¶
func (p *Provider) Prepare(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error)
Prepare attempts to perform all actions necessary to make NVMe components available for use by DAOS. If Reset_ is set, rebind devices to kernel and reset allocation of hugepages, otherwise rebind devices to user-space driver compatible with SPDK and allocate hugeages.
func (*Provider) QueryFirmware ¶
func (p *Provider) QueryFirmware(req storage.NVMeFirmwareQueryRequest) (*storage.NVMeFirmwareQueryResponse, error)
QueryFirmware requests the firmware information for the NVMe device controller.
func (*Provider) Scan ¶
func (p *Provider) Scan(req storage.BdevScanRequest) (resp *storage.BdevScanResponse, err error)
Scan calls into the backend to discover NVMe components in the system.
func (*Provider) UpdateFirmware ¶
func (p *Provider) UpdateFirmware(req storage.NVMeFirmwareUpdateRequest) (*storage.NVMeFirmwareUpdateResponse, error)
UpdateFirmware updates the NVMe device controller firmware.
func (*Provider) WriteConfig ¶
func (p *Provider) WriteConfig(req storage.BdevWriteConfigRequest) (*storage.BdevWriteConfigResponse, error)
WriteConfig calls into the bdev backend to create an nvme config file.
type SetOptionsParams ¶
type SetOptionsParams struct { BdevIoPoolSize uint64 `json:"bdev_io_pool_size"` BdevIoCacheSize uint64 `json:"bdev_io_cache_size"` }
SetOptionsParams specifies details for a storage.ConfBdevSetOptions method.
type SpdkConfig ¶
type SpdkConfig struct { DaosData *DaosData `json:"daos_data"` Subsystems []*SpdkSubsystem `json:"subsystems"` }
SpdkConfig is used to indicate which devices are to be used by SPDK and the desired behavior of SPDK subsystems.
func (*SpdkConfig) WithBdevConfigs ¶
func (sc *SpdkConfig) WithBdevConfigs(log logging.Logger, req *storage.BdevWriteConfigRequest) *SpdkConfig
WithBdevConfigs adds config methods derived from the input BdevWriteConfigRequest to the bdev subsystem of an SpdkConfig.
func (*SpdkConfig) WithVMDEnabled ¶
func (sc *SpdkConfig) WithVMDEnabled() *SpdkConfig
WithVMDEnabled adds vmd subsystem with enable method to an SpdkConfig.
type SpdkRpcServerParams ¶
type SpdkRpcServerParams storage.SpdkRpcServer
SpdkRpcServerParams specifies details for a storage.ConfSetSpdkRpcServer method.
type SpdkSubsystem ¶
type SpdkSubsystem struct { Name string `json:"subsystem"` Configs []*SpdkSubsystemConfig `json:"config"` }
SpdkSubsystem entries make up the Subsystems field of a SpdkConfig.
type SpdkSubsystemConfig ¶
type SpdkSubsystemConfig struct { Params SpdkSubsystemConfigParams `json:"params"` Method string `json:"method"` }
SpdkSubsystemConfig entries apply to any SpdkSubsystem.
type SpdkSubsystemConfigParams ¶
type SpdkSubsystemConfigParams interface {
// contains filtered or unexported methods
}
SpdkSubsystemConfigParams is an interface that defines an object that contains details for a subsystem configuration method.
type VmdEnableParams ¶
type VmdEnableParams struct{}
VmdEnableParams specifies details for a storage.ConfVmdEnable method.