bdev

package
v0.0.0-...-3a1d29c Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: BSD-2-Clause-Patent Imports: 23 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Dup2

func Dup2(oldfd, newfd int) error

func FaultBadPCIAddr

func FaultBadPCIAddr(pciAddr string) *fault.Fault

FaultBadPCIAddr creates a Fault for the case where a user-provided PCI address was invalid.

func FaultFormatError

func FaultFormatError(dev string, err error) *fault.Fault

FaultFormatError creates a Fault for the case where an attempted device format failed.

func FaultFormatUnknownClass

func FaultFormatUnknownClass(class string) *fault.Fault

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

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

type HotplugBusidRangeParams struct {
	Begin uint8 `json:"begin"`
	End   uint8 `json:"end"`
}

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 (*MockBackend) Prepare

func (*MockBackend) Reset

func (*MockBackend) Scan

func (*MockBackend) UpdateFirmware

func (mb *MockBackend) UpdateFirmware(_ string, _ string, _ int32) error

func (*MockBackend) WriteConfig

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 DefaultMockProvider(log logging.Logger) *Provider

func DefaultProvider

func DefaultProvider(log logging.Logger) *Provider

DefaultProvider returns an initialized *Provider suitable for use in production code.

func NewMockProvider

func NewMockProvider(log logging.Logger, mbc *MockBackendConfig) *Provider

func NewProvider

func NewProvider(log logging.Logger, backend Backend) *Provider

NewProvider returns an initialized *Provider.

func (*Provider) Format

Format attempts to initialize NVMe devices for use by DAOS. Note that this is a no-op for non-NVMe devices.

func (*Provider) Prepare

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

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

UpdateFirmware updates the NVMe device controller firmware.

func (*Provider) WriteConfig

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.

Jump to

Keyboard shortcuts

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