Documentation
¶
Overview ¶
Package ipmctl provides Go bindings for libipmctl Native Management API
Package ipmctl provides Go bindings for libipmctl Native Management API
Index ¶
- Constants
- Variables
- func Rc2err(label string, rc C.int) error
- type DeviceDiscovery
- type DeviceFirmwareInfo
- type DeviceUID
- type IpmCtl
- type NvmMgmt
- func (n *NvmMgmt) DeleteConfigGoals(log logging.Logger) error
- func (n *NvmMgmt) GetFirmwareInfo(uid DeviceUID) (fw DeviceFirmwareInfo, err error)
- func (n *NvmMgmt) GetModules(log logging.Logger) (devices []DeviceDiscovery, err error)
- func (n *NvmMgmt) GetRegions(log logging.Logger) (regions []PMemRegion, err error)
- func (n *NvmMgmt) Init(log logging.Logger) error
- func (n *NvmMgmt) UpdateFirmware(uid DeviceUID, fwPath string, force bool) error
- type PMemRegion
- type PMemRegionHealth
- type PMemRegionType
- type PartNumber
- type Version
Constants ¶
const ( // FWUpdateStatusUnknown represents unknown status FWUpdateStatusUnknown = 0 // FWUpdateStatusStaged represents a staged FW update to be loaded on reboot FWUpdateStatusStaged = 1 // FWUpdateStatusSuccess represents a successfully applied FW update FWUpdateStatusSuccess = 2 // FWUpdateStatusFailed represents a failed FW update FWUpdateStatusFailed = 3 )
FWUpdateStatus values represent the ipmctl fw_update_status enum
Variables ¶
var (
NVMMajorVersionsSupported = []int{2, 3}
)
Functions ¶
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 PartNumber
Fw_revision Version
Fw_api_version Version
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 DeviceUID
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 DeviceFirmwareInfo ¶
type DeviceFirmwareInfo struct {
ActiveFWVersion Version // currently running FW version
StagedFWVersion Version // FW version to be applied on next reboot
FWImageMaxSize uint32 // maximum FW image size in 4096-byte chunks
FWUpdateStatus uint32 // last update status
Reserved [4]uint8
}
DeviceFirmwareInfo represents an ipmctl device_fw_info structure
type DeviceUID ¶
type DeviceUID [22]byte
DeviceUID represents the Go equivalent of an NVM_UID string buffer
type IpmCtl ¶
type IpmCtl interface {
// Init verifies the version of the library is compatible.
Init(logging.Logger) error
// GetModules discovers persistent memory modules. Note that the Linux
// implementation has been seen to have intermittent long latency (multiple minutes)
// on calls to this API endpoint (27-Feb-2024).
GetModules(logging.Logger) ([]DeviceDiscovery, error)
// GetRegions discovers persistent memory regions.
GetRegions(logging.Logger) ([]PMemRegion, error)
// DeleteConfigGoals removes any pending but not yet applied PMem configuration goals.
DeleteConfigGoals(logging.Logger) error
// GetFirmwareInfo retrieves firmware information from persistent memory modules.
GetFirmwareInfo(uid DeviceUID) (DeviceFirmwareInfo, error)
// UpdateFirmware updates persistent memory module firmware.
UpdateFirmware(uid DeviceUID, fwPath string, force bool) error
}
IpmCtl is the interface that provides access to libipmctl.
type NvmMgmt ¶
type NvmMgmt struct {
// contains filtered or unexported fields
}
NvmMgmt is an implementation of the IpmCtl interface which exercises libipmctl's NVM API.
func (*NvmMgmt) DeleteConfigGoals ¶
DeleteConfigGoals removes any pending but not yet applied PMem configuration goals.
func (*NvmMgmt) GetFirmwareInfo ¶
func (n *NvmMgmt) GetFirmwareInfo(uid DeviceUID) (fw DeviceFirmwareInfo, err error)
GetFirmwareInfo fetches the firmware revision and other information from the device
func (*NvmMgmt) GetModules ¶
func (n *NvmMgmt) GetModules(log logging.Logger) (devices []DeviceDiscovery, err error)
GetModules queries number of PMem modules and retrieves device_discovery structs for each before converting to Go DeviceDiscovery structs.
func (*NvmMgmt) GetRegions ¶
func (n *NvmMgmt) GetRegions(log logging.Logger) (regions []PMemRegion, err error)
GetRegions queries number of PMem regions and retrieves region structs for each before converting to Go PMemRegion structs.
type PMemRegion ¶
type PMemRegion struct {
IsetId uint64 // Unique identifier of the region.
Type uint32 // The type of region.
Capacity uint64 // Size of the region in bytes.
Free_capacity uint64 // Available size of the region in bytes.
Socket_id int16 // socket ID
Dimm_count uint16 // The number of PMem modules in this region.
Dimms [24]uint16 // Unique ID's of underlying PMem modules.
Health uint32 // Rolled up health of the underlying PMem modules.
Reserved [40]uint8 // reserved
}
PMemRegion represents Go equivalent of C.struct_region from nvm_management.h (NVM API) as reported by "go tool cgo -godefs nvm.go".
type PMemRegionHealth ¶
type PMemRegionHealth uint32
PMemRegionHealth represents PMem region health.
const ( RegionHealthNormal PMemRegionHealth // All underlying PMem module capacity is available. RegionHealthError // Issue with some or all of the underlying PMem module capacity. RegionHealthUnknown // The region health cannot be determined. RegionHealthPending // A new memory allocation goal has been created but not applied. RegionHealthLocked // One or more of the underlying PMem modules are locked. )
PMemRegionHealth values represent the ipmctl region_health enum. Rolled-up health of the underlying PMem modules from which the REGION is created. Constant values start at 1.
func PMemRegionHealthFromString ¶
func PMemRegionHealthFromString(in string) PMemRegionHealth
func (PMemRegionHealth) String ¶
func (pmrh PMemRegionHealth) String() string
type PMemRegionType ¶
type PMemRegionType uint32
PMemRegionType represents PMem region type.
const ( RegionTypeUnknown PMemRegionType = iota RegionTypeAppDirect // App Direct mode. RegionTypeNotInterleaved // Non-interleaved App Direct mode. RegionTypeVolatile // Volatile. )
PMemRegionType values represent the ipmctl region_type enum. Type of region.
func PMemRegionTypeFromString ¶
func PMemRegionTypeFromString(in string) PMemRegionType
func (PMemRegionType) String ¶
func (pmrt PMemRegionType) String() string
type PartNumber ¶
type PartNumber [21]byte
PartNumber represents the part number string for an NVM device.
func (PartNumber) String ¶
func (p PartNumber) String() string
String converts the PartNumber bytes to a string