bdev

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 12

Documentation

Overview

(C) Copyright 2019-2020 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019-2020 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

(C) Copyright 2019-2020 Intel Corporation.

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.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

Index

Constants

This section is empty.

Variables

View Source
var (
	FaultUnknown = bdevFault(code.BdevUnknown, "unknown bdev error", "")
)

Functions

func FaultFormatBadPciAddr added in v0.9.0

func FaultFormatBadPciAddr(pciAddr string) *fault.Fault

func FaultFormatError added in v0.9.0

func FaultFormatError(err error) *fault.Fault

func FaultFormatUnknownClass added in v0.8.0

func FaultFormatUnknownClass(class string) *fault.Fault

Types

type Backend added in v0.8.0

type Backend interface {
	Init(shmID ...int) error
	Reset() error
	Prepare(hugePageCount int, targetUser string, pciWhitelist string) error
	Scan() (storage.NvmeControllers, error)
	Format(pciAddr string) (*storage.NvmeController, error)
}

Backend defines a set of methods to be implemented by a Block Device backend.

type ClassProvider

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

ClassProvider implements functionality for a given bdev class

func NewClassProvider

func NewClassProvider(log logging.Logger, cfgDir string, cfg *storage.BdevConfig) (*ClassProvider, error)

func (*ClassProvider) GenConfigFile

func (p *ClassProvider) GenConfigFile() (err error)

func (*ClassProvider) PrepareDevices

func (p *ClassProvider) PrepareDevices() error

type DeviceFormatResponse added in v0.8.0

type DeviceFormatResponse struct {
	Formatted  bool
	Error      *fault.Fault
	Controller *storage.NvmeController
}

DeviceFormatResponse contains device-specific Format operation results.

type DeviceFormatResponses added in v0.8.0

type DeviceFormatResponses map[string]*DeviceFormatResponse

DeviceFormatResponses is a map of device identifiers to device Format results.

type FormatRequest added in v0.8.0

type FormatRequest struct {
	pbin.ForwardableRequest
	Class      storage.BdevClass
	DeviceList []string
}

FormatRequest defines the parameters for a Format operation.

type FormatResponse added in v0.8.0

type FormatResponse struct {
	DeviceResponses DeviceFormatResponses
}

FormatResults contains the results of a Format operation.

type Forwarder added in v0.9.0

type Forwarder struct {
	pbin.Forwarder
}

func NewForwarder added in v0.9.0

func NewForwarder(log logging.Logger) *Forwarder

func (*Forwarder) Format added in v0.9.0

func (f *Forwarder) Format(req FormatRequest) (*FormatResponse, error)

func (*Forwarder) Init added in v0.9.0

func (f *Forwarder) Init(req InitRequest) error

func (*Forwarder) Prepare added in v0.9.0

func (f *Forwarder) Prepare(req PrepareRequest) (*PrepareResponse, error)

func (*Forwarder) Scan added in v0.9.0

func (f *Forwarder) Scan(req ScanRequest) (*ScanResponse, error)

type InitRequest added in v0.8.0

type InitRequest struct {
	pbin.ForwardableRequest
	SPDKShmID int
}

InitRequest defines the parameters for initializing the provider.

type InitResponse added in v0.9.0

type InitResponse struct{}

InitResponse contains the results of a successful Init operation.

type MockBackend added in v0.8.0

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

func DefaultMockBackend added in v0.8.0

func DefaultMockBackend() *MockBackend

func NewMockBackend added in v0.8.0

func NewMockBackend(cfg *MockBackendConfig) *MockBackend

func (*MockBackend) Format added in v0.8.0

func (mb *MockBackend) Format(pciAddr string) (*storage.NvmeController, error)

func (*MockBackend) Init added in v0.8.0

func (mb *MockBackend) Init(_ ...int) error

func (*MockBackend) Prepare added in v0.8.0

func (mb *MockBackend) Prepare(_ int, _, _ string) error

func (*MockBackend) Reset added in v0.8.0

func (mb *MockBackend) Reset() error

func (*MockBackend) Scan added in v0.8.0

func (mb *MockBackend) Scan() (storage.NvmeControllers, error)

type MockBackendConfig added in v0.8.0

type MockBackendConfig struct {
	InitErr       error
	ResetErr      error
	PrepareErr    error
	FormatRes     *storage.NvmeController
	FormatFailIdx int
	FormatErr     error
	ScanRes       storage.NvmeControllers
	ScanErr       error
	// contains filtered or unexported fields
}

type PrepareRequest added in v0.8.0

type PrepareRequest struct {
	pbin.ForwardableRequest
	HugePageCount int
	PCIWhitelist  string
	TargetUser    string
	ResetOnly     bool
}

PrepareRequest defines the parameters for a Prepare operation.

type PrepareResponse added in v0.8.0

type PrepareResponse struct{}

PrepareResponse contains the results of a successful Prepare operation.

type Provider added in v0.8.0

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

Provider encapsulates configuration and logic for interacting with a Block Device Backend.

func DefaultMockProvider added in v0.8.0

func DefaultMockProvider(log logging.Logger) *Provider

func DefaultProvider added in v0.8.0

func DefaultProvider(log logging.Logger) *Provider

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

func NewMockProvider added in v0.8.0

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

func NewProvider added in v0.8.0

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

NewProvider returns an initialized *Provider.

func (*Provider) Format added in v0.8.0

func (p *Provider) Format(req FormatRequest) (*FormatResponse, error)

Format attempts to initialize NVMe devices for use by DAOS (NB: no-op for non-NVMe devices).

func (*Provider) Init added in v0.8.0

func (p *Provider) Init(req InitRequest) error

Init performs any initialization steps required by the provider.

func (*Provider) Prepare added in v0.8.0

func (p *Provider) Prepare(req PrepareRequest) (*PrepareResponse, error)

Prepare attempts to perform all actions necessary to make NVMe components available for use by DAOS.

func (*Provider) Scan added in v0.8.0

func (p *Provider) Scan(req ScanRequest) (*ScanResponse, error)

Scan attempts to perform a scan to discover NVMe components in the system.

func (*Provider) WithForwardingDisabled added in v0.9.0

func (p *Provider) WithForwardingDisabled() *Provider

type ScanRequest added in v0.8.0

type ScanRequest struct {
	pbin.ForwardableRequest
}

ScanRequest defines the parameters for a Scan operation.

type ScanResponse added in v0.8.0

type ScanResponse struct {
	Controllers storage.NvmeControllers
}

ScanResponse contains information gleaned during a successful Scan operation.

Jump to

Keyboard shortcuts

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