ipmctl

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

README

Go language bindings for the ipmctl API for managing SCM/DCPM modules

Go bindings for the libipmctl native C lib to enable management of DCPM modules from Go source

This is a Go interface for ipmctl

The bindings require ipmctl library to be installed. To install please follow steps in the ipmctl github

Documentation

Overview

Package ipmctl provides Go bindings for libipmctl Native Management API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rc2err

func Rc2err(label string, rc C.int) error

Rc2err returns an failure if rc != NVM_SUCCESS.

TODO: print human readable error with provided lib macros

Types

type DeviceDiscovery

type DeviceDiscovery struct {
	All_properties_populated uint8
	Pad_cgo_0                [3]byte
	Device_handle            [4]byte
	Physical_id              uint16
	Vendor_id                uint16
	Device_id                uint16
	Revision_id              uint16
	Channel_pos              uint16
	Channel_id               uint16
	Memory_controller_id     uint16
	Socket_id                uint16
	Node_controller_id       uint16
	Pad_cgo_1                [2]byte
	Memory_type              uint32
	Dimm_sku                 uint32
	Manufacturer             [2]uint8
	Serial_number            [4]uint8
	Subsystem_vendor_id      uint16
	Subsystem_device_id      uint16
	Subsystem_revision_id    uint16
	Manufacturing_info_valid uint8
	Manufacturing_location   uint8
	Manufacturing_date       uint16
	Part_number              [21]int8
	Fw_revision              [25]int8
	Fw_api_version           [25]int8
	Pad_cgo_2                [5]byte
	Capacity                 uint64
	Interface_format_codes   [9]uint16
	Security_capabilities    _Ctype_struct_device_security_capabilities
	Device_capabilities      _Ctype_struct_device_capabilities
	Uid                      [22]int8
	Lock_state               uint32
	Manageability            uint32
	Controller_revision_id   uint16
	Reserved                 [48]uint8
	Pad_cgo_3                [6]byte
}

DeviceDiscovery struct represents Go equivalent of C.struct_device_discovery from nvm_management.h (NVM API) as reported by "go tool cgo -godefs nvm.go"

type IpmCtl

type IpmCtl interface {
	// SetInterleaved mode for app-direct regions
	// process referred to as "set goal" in NVM API
	//SetRegion(...)
	// Discover persistent memory modules
	Discover() ([]DeviceDiscovery, error)
}

IpmCtl is the interface that provides access to libipmctl.

type NvmMgmt

type NvmMgmt struct{}

NvmMgmt is an implementation of the IpmCtl interface which exercises libipmctl's NVM API.

func (*NvmMgmt) Discover

func (n *NvmMgmt) Discover() (devices []DeviceDiscovery, err error)

Discover queries number of SCM modules and retrieves device_discovery structs for each.

Jump to

Keyboard shortcuts

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