Giter Club home page Giter Club logo

ipmctl's Introduction

ipmctl

ipmctl is a utility for configuring and managing Intel® Optane™ Persistent Memory modules (PMem).

Packaging status

It supports functionality to:

  • Discover PMems on the platform.
  • Provision the platform memory configuration.
  • View and update the firmware on PMems.
  • Configure data-at-rest security on PMems.
  • Track health and performance of PMems.
  • Debug and troubleshoot PMems.

ipmctl refers to the following interface components:

  • libipmctl: An Application Programming Interface (API) library for managing PMems.
  • ipmctl: A Command Line Interface (CLI) application for configuring and managing PMems from the command line.

Also, metrics exporter for Prometheus based on libipmctl was provided. For more details take a look here

Workarounds

Slow Firmware Updates

When using 02.00.00.x versions of ipmctl software to update or downgrade firmware on Intel® Optane™ PMem 100 Series modules, please use the “-lpmb” CLI option (use DDRT Large Payload transfer). Otherwise the operation may take significantly longer than it normally would.

Commands Fail on Older Platforms

Some platforms that targeted the Gen 100 modules do not generate a ACPI PMTT table which causes ipmctl (version v02.00.00.xxxx) commands to fail. Particularly

  • create -goal
  • show -topology
  • show -memoryresources
  • show -dimm

If these commands are ran with -v option they present a message about failing to get the PMTT table.

A corrected version is being developed and will hopefully be available soon. Until that is available the best option is to use ipmctl v01.00.00.xxxx or go through the BIOS menus.

Releases

01.00.00.xxxx (master_1_0 branch) is for Intel Optane Persistent Memory 100 Series

02.00.00.xxxx (master_2_0 branch) is for Intel Optane Persistent Memory 200 Series (and is backwards compatible with 100 series)

03.00.00.xxxx (master_3_0 branch) is the latest version and supports all series of Intel Optane Persistent Memory.

Note: Branches may differ fundamentally. Please pay close attention to README.md of the respective branch.

Packages

Some distributions include ipmctl allowing installation via their package manager. For example (on Fedora):

dnf install ipmctl This will update the required dependencies.

For systems that cannot reach the Internet use another system to download the following rpms required to install ipmctl and then copy them to the original system (e.g. via thumb drive).

ipmctl.rpm, libipmctl.rpm, libsafec.rpm (only needed for 1.x releases), libndctl, json-c.rpm Run

rpm –ivh *.rpm

CentOS and RHEL systems maybe able to use an EPEL package found at: https://src.fedoraproject.org/rpms/ipmctl

OpenSUSE and SLES packages can be found at: https://build.opensuse.org/package/show/hardware:nvdimm/ipmctl

Ubuntu releases can be found at: https://launchpad.net/ubuntu/+source/ipmctl

libndctl

ipmctl depends on libndctl (ndctl-libs).

It can be found here https://github.com/pmem/ndctl if not available as a package.

Build

Note: Each branch may require different building procedures. Please follow README.md of the respective branch.

building latest (03.00.00.xxxx) on Linux

  1. clone the ipmctl and edk2 repositories:

git clone -b master https://github.com/intel/ipmctl.git

git clone https://github.com/tianocore/edk2.git

cd ipmctl

  1. Run updateedk.sh, this will copy relevant folders from edk2 into ipmctl

./updateedk.sh

  1. Build the ipmctl rpms specifying the version number to use

./rpmbuild.sh 03.00.00.1234

building latest (03.00.00.xxxx) on Windows

Install Visual Studio 2017 (or newer). Be sure to install optional component:

  • Workloads -> Desktop Development with C++
  • Individual Components -> Compilers, build tools, and runtimes -> Visual C++ tools for CMake

clone the ipmctl project

Clone the edk2 repository and copy the directories BaseTools, MdeModulePkg, MdePkg and ShellPkg into the clone of the ipmctl project

Open CMakeLists.txt as a CMake project in Visual Studio. See: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio

Specific Instructions Reported as Working for 02.00.00.xxxx versions on SUSE for build in home directory

Replace homedir with the actual account

git clone https://github.com/intel/ipmctl.git

zypper in libndctl-devel ruby2.5-rubygem-asciidoctor

cd ipmctl

mkdir output

cd output

cmake -DRELEASE=ON -DSAFECLIB_SRC_DOWNLOAD_AND_STATIC_LINK=ON -DCMAKE_INSTALL_PREFIX=/home/homedir/ipmctl/ ..

make all

Specific Instructions Reported as Working for 02.00.00.xxxx versions on RHEL7.6, CentOS7.6 and Fedora 30.

Ipmctl has dependency on libsafec-devel (for 1.x builds only), libndctl-devel and rubygem-asciidoctor

  • copr/jhli repo has libipmctl and its dependency, libsafec-devel.
    • cd /etc/yum.repos.d/
  wget https://copr.fedorainfracloud.org/coprs/jhli/ipmctl/repo/epel-7/jhli-ipmctl-epel-7.repo
  wget https://copr.fedorainfracloud.org/coprs/jhli/safeclib/repo/epel-7/jhli-safeclib-epel-7.repo

  * This should bring down both libipmctl and its dependency, libsafec-devel and
  • epel repos has rubygem-asciidoctor
    • get the epel repos
 yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • Enable extra packages in RHEL for ndctl-devel or any other dependencies
    • EPEL packages may depend on packages from these repositories:
# subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"
  • Install the prerequisite packages

sudo yum install ndctl ndctl-libs ndctl-devel libsafec rubygem-asciidoctor

  • Either Follow ipmctl make, rpmbuild instructions, or install the ipmctl package

ipmctl's People

Contributors

amy2wang avatar chrisnjohnson avatar dchanman avatar dkhoff avatar dkosawa avatar gldiviney avatar grom72 avatar herrera-luis-alberto avatar janandra-blue avatar jandrachal avatar karolzmijewski avatar kellycouch avatar kilobyte avatar mhfey-blue avatar mikolajkolakowski avatar mplucins avatar niruiyu avatar nolanhergert avatar patelnix avatar pawelnass avatar rdower avatar saininav avatar snanja avatar sshetty1991 avatar stevenpontsler avatar swetha-intel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipmctl's Issues

show -system NFIT doesn't print SMBIOS Management Information structure

show -system NFIT doesn't decode the NFIT SMBIOS Management Information structure. It should decode the data.

Output:

Type: 0x3
Length: 0x20
TypeEquals: Smbios

Code:

  case NVDIMM_SMBIOS_MGMT_INFO_TYPE:
    Print(L"TypeEquals: Smbios\n"
        );
    break;

acpidump -b, iasl -d nfit.dat does not decode them either, but shows the raw contents. On one system those are reported as:

[970h 2416   2]                Subtable Type : 0003 [SMBIOS Information]
[972h 2418   2]                       Length : 0020

[974h 2420   4]                     Reserved : 00000000
[008h 0008  24]         SMBIOS Table Entries : \
    20 00 22 00 24 00 25 00 27 00 29 00 2C 00 2E 00 \
    30 00 31 00 33 00 35 00

Those are 2-byte SMBIOS handle values, pointing to the type 17 records corresponding to the NVDIMMs. That data is incorrect; it's supposed to be reporting raw SMBIOS record data (that dmidecode parses). So, this should confuse ipmctl and result in an error message as it tried to parse the record as:

  • 1 byte Type (e.g., 17)
  • 1 byte Length
  • 2-byte Handle
  • variable length data for the record

Limited decode would suffice for ipmctl - let dmidecode do the full decoding.

  • Type: display this
  • Length: to process all the records
  • Handle: display this
  • Locator: already parsed by ipmctl for show -topology
  • Bank Locator: already parsed by ipmctl for show -topology
  • Manufacturer: already parsed by ipmctl for show -topology

Add an option to output the content to a binary file that dmidecode --from-dump can parse in more detail.

Documentation errors in nvm_management.h

Hi there,

One example of incorrect documentation is here:

* @return Returns the number of regions on success

The function claims to return the number of regions when the implementation clearly returns status codes. This led to some developer errors where we were checking code like this:

int num_regions = nvm_get_regions(...);
if (num_regions < 0) {
  // Expect error
}
// BUT: function actually returns a positive-integer error code, so we're getting bugs here.

We are now vetting our code to make sure we follow this semantic for this specific function:

int count = 1;
int rc = nvm_get_regions(..., &count);
if (rc != NVM_SUCCESS) {
    // ...
}
// ...

One suggestion we have is to keep the api in nvm_management consistent. For example, nvm_get_devices actually returns the number of devices or -1, even though it claims to return the same NVM_API int. This differs from nvm_get_regions which returns codes and led to some bugs on our side due to confusion and documentation errors.

show -system NFIT SPA Range structure is broken

The SPA Range structure decodes are broken, generally off by 4 bytes:

  • SpaRangeDescriptionTableIndex has bogus values (it doesn't even look like a UINT16 integer)
  • AddressRangeTypeGUID is missing
  • Flags has the SPA Range Structure Index
  • ProximityDomain has the Flags
  • SystemPhysicalAddressRangeLimit has the SystemPhysicalAddressRangeBase
  • MemoryMappingAttribute has the SystemPhysicalAddressRangeLimit
    etc.
Type: 0x0
Length: 0x38
TypeEquals: SpaRange
AddressRangeType: 0
SpaRangeDescriptionTableIndex: 0x134fb00
Flags: 0x1
ProximityDomain: 0x0
SystemPhysicalAddressRangeBase: 0x0
SystemPhysicalAddressRangeLength: 0x17740000000
MemoryMappingAttribute: 0x1fc00000

Type: 0x0
Length: 0x38
TypeEquals: SpaRange
AddressRangeType: 0
SpaRangeDescriptionTableIndex: 0x1351b20
Flags: 0x2
ProximityDomain: 0x0
SystemPhysicalAddressRangeBase: 0x0
SystemPhysicalAddressRangeLength: 0x17760000000
MemoryMappingAttribute: 0x1fc00000

Type: 0x0
Length: 0x38
TypeEquals: SpaRange
AddressRangeType: 0
SpaRangeDescriptionTableIndex: 0x1351e70
Flags: 0x3
ProximityDomain: 0x0
SystemPhysicalAddressRangeBase: 0x0
SystemPhysicalAddressRangeLength: 0x17780000000
MemoryMappingAttribute: 0x1fc00000

Correct decode per acpidump -b and iasl -d nfit.dat:

[028h 0040   2]                Subtable Type : 0000 [System Physical Address Range]
[02Ah 0042   2]                       Length : 0038

[02Ch 0044   2]                  Range Index : 0001
[02Eh 0046   2]        Flags (decoded below) : 0000
                   Add/Online Operation Only : 0
                      Proximity Domain Valid : 0
[030h 0048   4]                     Reserved : 00000000
[034h 0052   4]             Proximity Domain : 00000000
[038h 0056  16]           Address Range GUID : 92F701F6-13B4-405D-910B-299367E8234C
[048h 0072   8]           Address Range Base : 0000017740000000
[050h 0080   8]         Address Range Length : 000000001FC00000
[058h 0088   8]         Memory Map Attribute : 0000000000000001

[2A0h 0672   2]                Subtable Type : 0000 [System Physical Address Range]
[2A2h 0674   2]                       Length : 0038

[2A4h 0676   2]                  Range Index : 0002
[2A6h 0678   2]        Flags (decoded below) : 0000
                   Add/Online Operation Only : 0
                      Proximity Domain Valid : 0
[2A8h 0680   4]                     Reserved : 00000000
[2ACh 0684   4]             Proximity Domain : 00000000
[2B0h 0688  16]           Address Range GUID : 92F701F6-13B4-405D-910B-299367E8234C
[2C0h 0704   8]           Address Range Base : 0000017760000000
[2C8h 0712   8]         Address Range Length : 000000001FC00000
[2D0h 0720   8]         Memory Map Attribute : 0000000000000001

[518h 1304   2]                Subtable Type : 0000 [System Physical Address Range]
[51Ah 1306   2]                       Length : 0038

[51Ch 1308   2]                  Range Index : 0003
[51Eh 1310   2]        Flags (decoded below) : 0000
                   Add/Online Operation Only : 0
                      Proximity Domain Valid : 0
[520h 1312   4]                     Reserved : 00000000
[524h 1316   4]             Proximity Domain : 00000000
[528h 1320  16]           Address Range GUID : 92F701F6-13B4-405D-910B-299367E8234C
[538h 1336   8]           Address Range Base : 0000017780000000
[540h 1344   8]         Address Range Length : 000000001FC00000
[548h 1352   8]         Memory Map Attribute : 0000000000000001

Install, and search for, `ipmctl.conf` in proper paths.

Problem: currently, by default, ipmctl.conf is installed by the package in /<prefix>/etc/ipmctl.conf, which results in /usr/etc/ and is ... definitely wrong.

Better to search for, and use, the config file in several places and include a distribution-wide config location as a fallback, and only install the package default config into that location. Packages should not install files in /etc if it can be avoided (so, never).

The code in ini.c should scan, in order, in these locations for an ipmctl.conf file, and process the first file found:

pwd -P # this is what the code does
/etc/ipmctl.conf # this one is missed
<prefix>/etc/ipmctl.conf # this is what the code does
<prefix>/usr/share/ipmctl/ipmctl.conf # this one needs adding

Something like the following things are needed:

#define INI_DEFAULT_INSTALL_FILEPATH "/usr/share/ipmctl/"
snprintf(g_ini_path_filename, sizeof(g_ini_path_filename), "%s%s", INI_INSTALL_FILEPATH, p_ini_file_name);
snprintf(g_ini_path_filename, sizeof(g_ini_path_filename), "%s%s%s", APP_DATA_FILE_PATH, INI_DEFAULT_INSTALL_FILEPATH, p_ini_file_name);

Then, adjust the make install rules to install the sample config file only into INI_DEFAULT_INSTALL_FILEPATH.

build error

I am trying to build ipmctl in Ubuntu, the CMakeError.log show the following error:

/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_44c63.dir/CheckFunctionExists.c.o -o cmTC_44c63 -lpthreads
/usr/bin/x86_64-linux-gnu-ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_44c63.dir/build.make:97: recipe for target 'cmTC_44c63' failed
make[1]: *** [cmTC_44c63] Error 1
make[1]: Leaving directory '/root/temp/ipmctl/output/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_44c63/fast' failed
make: *** [cmTC_44c63/fast] Error 2

after I have added the following library:

apt search libpthread-stubs0-dev
Sorting... Done
Full Text Search... Done
libpthread-stubs0-dev/bionic,now 0.3-4 amd64 [installed]
pthread stubs not provided by native libc, development files

How can I fix this problem?

Thank you

Creating Goal on Another Socket After Reboot Setting First Goal Does Nothing

This may be directly related to issue 57

This happens too if I configure a goal on socket 1 first, then cycle (Which will fail?, then create a goal on socket 0. It also does the same thing if I perform a goal w/ appdirectnoninterleaved.

This functions correctly if I configure per-socket goals and do not reboot until I'm done creating all goals.

[root@101-249 ~]# ipmctl create -goal -socket 0x0000 MemoryMode=50 PersistentMemoryType=AppDirect

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  246.0 GiB               256.0 GiB       0.0 GiB
0x0000          0x0101  246.0 GiB               256.0 GiB       0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  246.0 GiB               256.0 GiB       0.0 GiB
0x0000          0x0101  246.0 GiB               256.0 GiB       0.0 GiB
A reboot is required to process new memory allocation goals.
[root@101-249 ~]# reboot

*System Reboots*

[root@101-249 ~]# ipmctl show -region

SocketID             ISetID    PersistentMemoryType  Capacity FreeCapacity HealthState
       0 0x4940eeb8c1772444               AppDirect 512.0 GiB    512.0 GiB     Healthy
[root@101-249 ~]# ipmctl create -goal -socket 0x0001 MemoryMode=80 PersistentMemoryType=AppDirect

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0001          0x1001  406.0 GiB               96.0 GiB        0.0 GiB
0x0001          0x1101  406.0 GiB               96.0 GiB        0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0001          0x1001  406.0 GiB               96.0 GiB        0.0 GiB
0x0001          0x1101  406.0 GiB               96.0 GiB        0.0 GiB
A reboot is required to process new memory allocation goals.
[root@101-249 ~]# reboot 

*System Reboots*

[root@101-249 ~]# ipmctl show -region

SocketID             ISetID    PersistentMemoryType  Capacity FreeCapacity HealthState
       0 0x4940eeb8c1772444               AppDirect 512.0 GiB    512.0 GiB     Healthy

libipmctl changed soname

the library changed SONAME in the last release, breaking existing apps/etc

please consider the following courtesy to linux distributions wanting to ship your software

  1. Please don't break ABI
  2. Please don't change the SONAME unless you break the ABI (see item 1)

Can Ipmctl show LSS and AIT DRAM Status?

Some questions for ipmctl:

1.Can ipmctl show LSS and AIT DRAM Status?
As part of SMART Health info,LSS and AIT DRAM Status are important parameters. However, ipmctl seems unable to show these info.Will it be available in newer versions to come?Or i missed it?

2.Can ipmctl show detailed SMART Health info?
Detailed SMART info would help problem tracking,so i think it is meaningful.

3.How to clear the poison indicator?
Knowing the location of poison indicator,how can i clear the poison indicator? Does ipmctl support this or i should use raw mailbox command to do this?

ipmctl option to clear StagedFWVersion

An option to clear StagedFWVersion might be useful in scenario where user wants to avoid activating new version after doing load (eg user error). In the absence of this option, the next power cycle will make the staged version to be the active one. One work-around is for user to run load command again. But an explicit option may come in handy in some cases where there are multiple dimms in a server and user realizes they want to roll back after starting to update.

ipmctl for Windows

Hello All,

We are working on migrating our applications to Windows and am trying to identify if there is an ipmctl for Windows? If yes, could someone please point me to a CLI based installer?
Thanks in advance.

Make safeclib optional

Also, if safeclib is required, why are there additional versions of s_strrchr etc? These are already provided by safeclib instead.

ideally, we avoid using all these and just properly use static code analysis and good review to make sure code is doing the right thing.

Random region id getting generated

Random region id is getting generated for creating namespace and is getting changed after creating the goal again on the same server.
Steps followed
1.In the UEFI shell, create goal
2.Reboot the server
3.Again go to UEFI shell prompt check for region using "ipmctl show -region" - The region id getting generated here are random numbers and not from 0
4.Create namespace using region id and reboot the server
5.Delete the existing goal and namespace
6.Create new goal
7.Reboot the server
8.Again check for region - the region id generated will be random and different from the previous one.

build error

$cmake -DRELEASE=ON -DCMAKE_INSTALL_PREFIX=/ ..
CMake Error: File /home///ipmctl/DcpmemPkg/driver/Doxyfile_nvm_dimm_config_protocol.in does not exist.
CMake Error at CMakeLists.txt:557 (configure_file):

At 557 line number the doxygen is unable to generate the documentation , so it fails.

Doxyfile_nvm_dimm_config_protocol.in is not comitted part of the repository , please add the corresponding file

show and create -goal don't report Interleaved

create -goal and show -goal do not display if the AppDirect regions are requested to be interleaved or not, which is one of the arguments for create -goal.

ipmctl create -goal Reserved=50 PersistentMemoryType=AppDirectNotInterleaved

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB

ipmctl show -goal

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB

prints the same as:

ipmctl create -goal Reserved=50 PersistentMemoryType=AppDirect

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB
 ipmctl show -goal

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB

show -a -goal does include that information under AppDirect1Settings:

---DimmID=0x0001---
   SocketID=0x0000
   MemorySize=0.0 GiB
   AppDirect1Size=62.0 GiB
   AppDirect1Index=1
   AppDirect1Settings=x1 - 4KB IMC x 4KB Channel
   AppDirect2Size=0.0 GiB
   AppDirect2Index=N/A
   AppDirect2Settings=N/A
   Status=New: A reboot is required for the memory allocation goal to be processed by the BIOS.
   ActionRequired=0
   ActionRequiredEvents=N/A

vs.

---DimmID=0x0001---
   SocketID=0x0000
   MemorySize=0.0 GiB
   AppDirect1Size=62.0 GiB
   AppDirect1Index=1
   AppDirect1Settings=x6 - 4KB IMC x 4KB Channel
   AppDirect2Size=0.0 GiB
   AppDirect2Index=N/A
   AppDirect2Settings=N/A
   Status=New: A reboot is required for the memory allocation goal to be processed by the BIOS.
   ActionRequired=0
   ActionRequiredEvents=N/A

Suggestion: add a column showing those settings.

Unable to create goal on individual AEP dimms using ipmctl

On running the ipmctl goal creation command with the dimm ID, the command is getting failed

Steps followed
On the OS (Linux)
Run Command e.g.-"ipmctl create -goal -dimm [dimm ID] persistentmemorytype=AppdirectNotInterleaved"

Kernel version used is 4.18 upstream.

Unable to create namespace using ipmctl

The goal has been set using the ipmctl and is successful, after that

$ipmctl create -namespace -region 0
get the below error , from the master branch latest code as below ,
on a fedora 28 , with kernel 4.17 , with pmdk and all the pre-requisite software installed

Syntax Error: Invalid or unexpected token -namespace.
Did you mean:
create [-help|-h] [-force|-f] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] [-dimm (DimmIDs)] -goal [-socket (SocketIDs)] [MemoryMode=(0|%)] [PersistentMemoryType=(AppDirect|AppDirectNotInterleaved)] [Reserved=(0|%)] [Config=(MM|AD|MM+AD)] [NamespaceLabelVersion=(1.1|1.2)]

ipmctl help says its program name is ipmctl.efi in linux

$ sudo ipmctl help

Intel(R) Optane(TM) DC Persistent Memory Command Line Interface

Usage: ipmctl.efi <verb>[<options>][<targets>][<properties>]

due to:

DcpmemPkg/cli/NvmDimmCli.h:#define EXE_NAME               L"ipmctl.efi"
DcpmemPkg/cli/NvmDimmCli.c:    Print(FORMAT_STR_SPACE FORMAT_STR_NL_NL L"    Usage: " FORMAT_STR L" <verb>[<options>][<targets>][<properties>]\n\nCommands:\n", PRODUCT_NAME, APP_DESCRIPTION, EXE_NAME);

Debug log not getting generated by ipmctl dump

On running the ipmctl dump, the command getting failed and is not dumping the data.
Run Command "ipmctl dump -destination dump.bin -debug -dimm [dimm ID]"

Failure message: Dump Debug Log0x0001: Error (3) - Command failed

Missing clear and differentiatable ipmctl version information

The command does not output any meaningful, differentiatable version information.
running ipmctl command on centos 7.5b after git clone and compilation.
(older version).
ipmctl version
Component Version
Intel DIMM Gen 1 Software Version 5.5.5.5555
Intel DIMM Gen 1 Driver Version 0.0.0.0
latest version:
ipmctl version
Intel(R) Optane(TM) DC Persistent Memory Command Line Interface Version 5.5.5.5555
Intel(R) Optane(TM) DC Persistent Memory Driver API Version 0.0.0.0
These are obviously different versions but with the same version output.
Dependencies to different versions of the NVDIMM firmware, ndctl or PMDK cannot be verified this way.
e.g ndctl version works fine

show -dimm default column suggestions

ipmctl show -dimm shows these columns:

DimmID  Capacity        HealthState     ActionRequired  LockState       FWVersion
0x0001  123.4 GiB       Healthy         0               Disabled        01.01.01.0001

This command should show the most important values, as human-friendly as possible. I'm not sure those are the most useful choices.

Suggestions:

  • Drop LockState (the security frozen status). That's not important enough.
  • Drop FWVersion. That's important, but more of a maintenance item.
  • Using Events as an alias for ActionRequired to save column space, change the values from "1" and "0" to "yes" and "no". The recommended action is to fetch the events; this column name suggests that better.
  • Add MemoryCapacity, the amount of volatile memory being provided. Very important; Confirms that a goal configuration was really applied. Create "Volatile" as an alias to save column space.
  • Add AppDirectCapacity, the amount of persistent memory being provided. Very important. Confirms that a goal configuration was really applied. Use "Persistent" as an alias to space column space.
  • Add DimmUID, the name of the device. Used to identify the device everywhere, no matter where it happens to be (doesn't vary based on the DIMM slot or system, and is printed on the label)
  • The DimmID (the NFIT Device Handle) is a 32-bit field, so should show all 8 hex digits (not just 0x0001 like now). Those will be non-zero in systems using node ID bits. If printed with %04x, that'll mess up the column formatting, since there are only 2 spaces before the next column.

This could look like:

DimmID      DimmUID                Capacity   Volatile   Persistent  HealthState  Events
0x00000001  1234-56-1800-abcdabcd  987.6 GiB  123.4 GiB  567.8 GiB     Healthy      yes

The -d option allows selecting the properties to print, but it doesn't print them in human-friendly table format. "fmt" can be used to pack them into one line, but it still doesn't look very nice.
ipmctl show -d DimmID,DimmUID,MemoryCapacity,AppDirectCapacity,HealthState,ActionRequired -dimm | fmt -w 999

Report reason for "Failed to dump FW Debug logs"

In UEFI, this command should report the reason for failure:

ipmctl dump -destination xyz.bin -debug -dimm 0x0021
Failed to dump FW Debug logs to file (xyz.bin)

The only reason DumpDebugCommand(), the function that prints that, currently explains in more detail is EFI_VOLUME_FULL. The function it calls, DumpToFile(), calls NVDIMM_WARN() for many but not all reasons, and it's not clear how to make those prints show up (set EFIDebug 0xffffffff didn't result in any extra prints).

show -topology and show -dimm capacity displays

A few nits using show -topology with different units.

ipmctl show -u B -topology  -dimm 0x0011
ipmctl show -u MB -topology  -dimm 0x0011
ipmctl show -u GB -topology  -dimm 0x0011
ipmctl show -u TB -topology  -dimm 0x0011
ipmctl show -u MiB -topology  -dimm 0x0011
ipmctl show -u GiB -topology  -dimm 0x0011
ipmctl show -u TiB -topology  -dimm 0x0011

DimmID  MemoryType      Capacity        PhysicalID      DeviceLocator
0x0011  DCPMEM          134955925504 B  0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          134955.9 MB     0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          134.9 GB        0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          0.1 TB  0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          128704.0 MiB    0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          125.6 GiB       0x0027          PROC 1 DIMM 9
0x0011  DCPMEM          0.1 TiB 0x0027          PROC 1 DIMM 9

This is based off SMBIOS type 17 record, which in this case is reporting 128704 MiB, so the real values are:

134955925504 B
134955.925504 MB
134.955925504 GB
0.134955925504 TB
128704 MiB
125.6875 GiB
0.12274169921875 TiB

Observations/suggestions:

  1. When the capacity is narrow like 0.1 TB, the columns don't line up. It's using \t TAB characters between columns; the y in capacity is the 32nd column; the B in TB is in the 30th column; the TAB jumps to the 33nd column rather than the 41st column (with tabstop of 8).

  2. The capacities are always rounded down (fractions >= .5 are not rounding up). That's a reasonable conservative convention for capacities, but should be documented.

  3. Capacities are shown with only one decimal digit (due to calling GetDigitsStrAfterPointFromNumber() with an argument of 1). 3 digits would be more useful.

  4. A symbol indicating there is a hidden fractional amount would be helpful. That would provide a clue that displaying in smaller units is necessary to see the exact capacity.

134955925504 B
134955.925+ MB
134.955+ GB
0.134+ TB
128704 MiB
125.687+ GiB
0.122+ TiB
  1. Supporting 3 and 4, show -dimm bases its capacity on a different source than SMBIOS and shows these values:
DimmID  Capacity
0x0011  135014383616 B
0x0011  135014.3 MB
0x0011  135.0 GB
0x0011  0.1 TB
0x0011  128759.7 MiB
0x0011  125.7 GiB

but the values are really:

135014383616 B
135014.383616 MB
135.014383616 GB
0.135014383616 TB
128759.75 MiB
125.741943359375 GiB
0.12279486656189 TiB

The device is not presenting exactly 135 GB, which is what "135.0 GB" suggests.

Use SMBIOS 3.2.0 Memory Technology field to detect DCPMEM

ipmctl should determine DDR4 DIMM vs DCPMEM by looking at the new SMBIOS 3.2.0 type 17 Memory Technology field, in which 0x07 means "Intel persistent memory".

The Memory Type Detail field Nonvolatile bit is also used by NVDIMM-Ns, so is not sufficient.

Also, 0x18 in the Memory Type field means DDR3, so is not a good value to use (even if that's just internal to the program).

Suggestion:

  • "DCPMM" if Memory Technology is 0x07
  • "DDR4 DIMM" if Memory Technology is 0x03
  • "DDR4 NVDIMM-N" if Memory Technology is 0x04
  • "DDR4 NVDIMM-F" if Memory Technology is 0x05
  • "DDR4 NVDIMM-P" if Memory Technology is 0x06
  • "DDR4 NVDIMM" if Memory Technology is 0 and Type Detail bit 12 is set
  • "DDR4 DIMM" if Memory Technology is 0 and Type Detail bit 12 is clear
  • for all of those containing "DIMM":
    • add "R" before "DIMM" if Type Detail bit 13 is set
    • add "U" before "DIMM" if Type Detail bit 14 is set
    • add "LR" before "DIMM" if Type Detail bit 15 is set

Code excerpt:

/**
  @todo(after official SmBIOS spec release): update with correct values from SMBIOS spec
  DIMM type
**/
#define SMBIOS_MEMORY_TYPE_DDR4   0x1A
#define SMBIOS_MEMORY_TYPE_DCPMEM 0x18

  /* SMBIOS type 17 table info */
  if (DmiPhysicalDev.Type17 != NULL) {
    if (DmiPhysicalDev.Type17->MemoryType == SMBIOS_MEMORY_TYPE_DDR4) {
      if (DmiPhysicalDev.Type17->TypeDetail.Nonvolatile) {
        pDimmInfo->MemoryType = MEMORYTYPE_DCPMEM;
      } else {
        pDimmInfo->MemoryType = MEMORYTYPE_DDR4;
      }
    } else {
      pDimmInfo->MemoryType = MEMORYTYPE_UNKNOWN;
    }

Example SMBIOS contents for DCPMEM:

Handle 0x0020, DMI type 17, 84 bytes
Memory Device
        Array Handle: 0x0013
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 128704 MB
        Form Factor: DIMM
        Set: 1
        Locator: PROC 1 DIMM 2
        Bank Locator: Not Specified
        Type: DDR4
        Type Detail: Synchronous Non-Volatile LRDIMM
        Speed: 2666 MT/s
        Manufacturer: UNKNOWN
        Asset Tag: Not Specified
        Part Number: NOT AVAILABLE
        Rank: 1
        Configured Clock Speed: 2666 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V
        Memory Technology: Intel persistent memory
        Memory Operating Mode Capability: Volatile memory Byte-accessible persistent memory
        Firmware Version: Not Specified
        Module Manufacturer ID: Bank 10, Hex 0x83
        Module Product ID: 0x4151
        Memory Subsystem Controller Manufacturer ID: Bank 1, Hex 0x89
        Memory Subsystem Controller Product ID: 0x097A
        Non-Volatile Size: 128704 MB
        Volatile Size: None
        Cache Size: None
        Logical Size: Unknown

NVDIMM-N (before SMBIOS 3.2.0):

Handle 0x000D, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 8192 MB
        Form Factor: DIMM
        Set: 1
        Locator: PROC 1 DIMM 2
        Bank Locator: Not Specified
        Type: DDR4
        Type Detail: Synchronous Non-Volatile Registered (Buffered)
        Speed: 2133 MT/s
        Manufacturer: HP
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: 825108-081
        Rank: 1
        Configured Clock Speed: 1600 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V

Use controller rather than core temperature

For consistency, switch these to use "controller" rather than "core":

src/os/monitor/AcpiEventMonitor.h:#define ACPI_SMART_HEALTH_EVENT_TEMP_CORE_STR "core temp : "
DcpmemPkg/cli/ShowErrorCommand.h:#define ERROR_THERMAL_TYPE_CORE_STR     L"Core Temperature"

I don't see where it comes from, but this message also uses "core temperature threshold":
The firmware consistency and settings check detected that DIMM 0x0011 is reporting a core temperature threshold of 104 C which is above the recommended threshold 102 C.

Make reboot message be OS-specific

DcpmPkg/cli/ShowGoalCommand.c: Print(FORMAT_STR_NL, L"A reboot is required to process new memory allocation goals.");

The name of the command to trigger a reboot varies by OS:

  • UEFI shell: reset
  • Windows: restart ("shutdown /r")
  • linux: reboot

Suggestion:
Make the print be OS-specific.
Print(FORMAT_STR_NL, L"A reset is required to process new memory allocation goals.");
Print(FORMAT_STR_NL, L"A restart (shutdown /r) is required to process new memory allocation goals.");
Print(FORMAT_STR_NL, L"A reboot is required to process new memory allocation goals.");

show -region column header width

The Capacity column header is off by one character with large capacities:

$ sudo ipmctl show -region

SocketID             ISetID    PersistentMemoryType  Capacity FreeCapacity HealthState
       0 0xd2b87f4865622ccc               AppDirect 3012.0 GiB      0.0 GiB     Healthy

Missing Doxyfile when configuring with CMake

Hi there, I was trying to build the latest v01.00.00.3102 and ran into this error during build.

-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13") found components: doxygen dot
CMake Error: File /tmp/ipmctl-v01.00.00.3102/DcpmemPkg/driver/Doxyfile_nvm_dimm_config_protocol.in does not exist.
CMake Error at CMakeLists.txt:557 (configure_file):
configure_file Problem configuring file

I noticed that the .in file does not exist in the repo. Is it supposed to be a generated file?

ipmctl shows that the nvdimm is "non-functional"

ndctl version:61.2
ipmctl version:01.00.00.3279

the nvdimm is intel optane DC Pmem(512G version).

in UEFI shell, the tool provided by intel(ipmctl.efi) can find the nvdimm in heathy state. However,in OS,"ndctl list -D" can not show any information.

Moreover,the ipmctl tool which is provided by INTEL shows that the dimm is non-functional which may be a wrong interpretation since the dimm is actually functional as the UEFI tool shows.

So,can u help me with this?

`show -goal` doesn't show the current goal after reboot

This is with latest commit ipmctl.

The running goal information is not dumped as part of show -goal after a reboot, however the goal settings appear to be utilized correctly.

I know that you reference regions after goals have been set; but it would be useful to have this data on hand after the fact.

[root@101-249 ~]# ipmctl create -goal -socket 0x0000 MemoryMode=50 PersistentMemoryType=AppDirectNotInterleaved

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  246.0 GiB               256.0 GiB       0.0 GiB
0x0000          0x0101  246.0 GiB               256.0 GiB       0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  246.0 GiB               256.0 GiB       0.0 GiB
0x0000          0x0101  246.0 GiB               256.0 GiB       0.0 GiB
A reboot is required to process new memory allocation goals.
[root@101-249 ~]# reboot

*reboot happens*

[root@101-249 ~]# ipmctl show -goal

There are no goal configs defined in the system.
Please use 'show -region' to display currently valid persistent memory regions.

[ipmctl] Config file should live in a common location

Config:
OS: Fedora 27
Kernel: 4.17.9-200.fc28.x86_64
ipctl version: 5.5.5.5555

Issue
Each time ipmctl is executed, it checks for 'ipmctl.conf' in the current working directory and creates it if none exist. The result is orphaned ipmctl.conf files left all over the filesystem depending on the tool, script, or cwd where ipmctl was executed.

The following example creates a new directory, cd's to it, verifies it's empty, runs an ipmctl command (any options will suffice), then checks the directory contents afterward to find a new file.

# mkdir /var/tmp/ipmctl && cd /var/tmp/ipmctl
# ls
# ipmctl show -dimm > /dev/null 2>&1
# ls
ipmctl.conf

Expectation
To have ipmctl.conf live in a common location such as /etc/ipmctl/ipmctl.conf

Improve Failed to get NFIT/PCAT table messages

When running without root permission, ipmctl complains about not being able to get two ACPI tables - NFIT and PCAT.

$ ipmctl

Failed to get the NFIT table.
Failed to get the PCAT table.
Encountered 2 failures.
Intel(R) Optane(TM) DC Persistent Memory Command Line Interface

    Usage: ipmctl <verb>[<options>][<targets>][<properties>]

Commands:
Display the CLI help.
    help [-help|-h] [-output|-o (text|nvmxml)]
Display the CLI version.
    version [-help|-h] [-output|-o (text|nvmxml)]
Update the firmware on one or more DIMMs
...

When they face similar problems, dmidecode reports that there is a permission problem:

$ dmidecode
# dmidecode 3.1
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
Scanning /dev/mem for entry point.
/dev/mem: Permission denied

and acpidump prints that there is an access error:

$ acpidump
Could not open table file: /sys/firmware/acpi/tables/NFIT
Could not get ACPI tables, AE_ACCESS

Suggestions

  1. For help, version, or no command at all, don't even try to fetch the tables.

  2. For other commands, print a better explanation of the reason why. Currently, get_table() calls get_acpi_table() with a buffer length of 0 to test access, but it throws away the return code with the reason and just reports EFI_END_OF_FILE to its caller. If the open() fails, errno needs to be parsed and passed upstream (not just lumped into ACPI_ERR_TABLENOTFOUND and EFI_END_OF_FILE).

int get_acpi_table(const char *signature, struct acpi_table *p_table, const unsigned int size)
{
       int rc = 0;

       char table_path[PATH_MAX];
       snprintf(table_path, sizeof(table_path), "%s%s", SYSFS_ACPI_PATH, signature);

       int fd = open(table_path, O_RDONLY|O_CLOEXEC);
       if (fd < 0)
       {
               rc = ACPI_ERR_TABLENOTFOUND;
       }
...

EFI_STATUS *get_table(  IN CHAR8* currentTableName,  OUT EFI_ACPI_DESCRIPTION_HEADER ** table)
{
 *table = NULL;
 int buf_size = get_acpi_table(currentTableName, NULL, 0);
 if (buf_size <= 0)
 {
   return EFI_END_OF_FILE;
 }

EFI_STATUS get_nfit_table(  OUT EFI_ACPI_DESCRIPTION_HEADER ** table)
{
 return get_table("NFIT", table);
}

...
   if (EFI_ERROR(get_nfit_table(&PtrNfitTable)))
   {
     Print(L"Failed to get the NFIT table.\n");
     failures++;
   }

IPMCTL on Windows shows DIMMs as Non-functional

Hi,

the ipmctl.efi works properly, but when I try the ipmctl.exe from here under Windows Server 2018 (DC Edition on latest updates) it lists all nvdimms as Non-functional. I've tried multiple releases, all with the same result.

ipmctl.exe show -dimm

DimmID  Capacity        HealthState     ActionRequired  LockState       FWVersion
0x0001  0.0 GiB Non-functional  N/A             N/A
0x0101  0.0 GiB Non-functional  N/A             N/A
0x1001  0.0 GiB Non-functional  N/A             N/A
0x1101  0.0 GiB Non-functional  N/A             N/A

I compiled IPMCTL with VS2017 und SDK/WDK version 17733.

Shorten command help prints

The command syntax help prints are too verbose.

The required arguments that differentiate the commands are hidden on the right after a varying number of mostly-common options, making it hard to see the important parts. This is particularly bad on a UEFI 80x25 text console window.

Example of ipmctl show:

show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -region [(RegionIDs)] [-socket (SocketIDs)]
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-actionreq|-ar] [-output|-o (text|nvmxml)] [-dimm [(DimmIDs)]] -goal [-socket [(SocketIDs)]]
show [-help|-h] [-output|-o (text|nvmxml)] -error (Thermal|Media) -dimm [(DimmIDs)] [SequenceNumber=(<0, 65535>)] [Level=(Low|High)] [Count=(<0, 255>)]
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -dimm [(DimmIDs)] [-socket (SocketIDs)]
show [-help|-h] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -socket [(SocketIDs)]
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)] -sensor [(Health|MediaTemperature|ControllerTemperature|PercentageRemaining|DirtyShutdowns|PowerOnTime|UpTime|PowerCycles|FwErrorCount)] [-dimm (DimmIDs)]
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -topology [-dimm (DimmIDs)] [-socket (SocketIDs)]
show [-help|-h] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -memoryresources
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)] -system -capabilities
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)] [-dimm [(DimmIDs)]] -firmware
show [-help|-h] [-output|-o (text|nvmxml)] -system [(NFIT|PCAT|PMTT)]
show [-help|-h] [-output|-o (text|nvmxml)] -dimm [(DimmIDs)] -pcd [(Config|LSA)]
show [-help|-h] [-output|-o (text|nvmxml)] -preferences
show [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)] -system -host
show [-help|-h] [-output|-o (text|nvmxml)] -event [-dimm (DimmIDs)] [Severity=(Info|Warning|Error)] [Category=(Diag|FW|Config|PM|Quick|Security|Health|Mgmt)] [ActionRequired=(1|0)] [Count=(<1..2147483647>)]
show [-help|-h] [-output|-o (text|nvmxml)] -dimm [(DimmIDs)] -performance [(BytesRead|BytesWritten|HostReads|HostWrites|BlockReads|BlockWrites)]

Suggestions (pick one, or a variant of these)

  1. Print the required arguments first, then optional arguments.
    In a few cases, the command is about DIMMs but -dimm is optional; this is because lack of -dimm means "all DIMMs." Include -dimm in the first set.
show -dimm [(DimmIDs)] -error (Thermal|Media) [SequenceNumber=(<0, 65535>)] [Level=(Low|High)] [Count=(<0, 255>)] [-help|-h] [-output|-o (text|nvmxml)]
show [-dimm [(DimmIDs)]] -firmware [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)] 
show [-dimm [(DimmIDs)]] -goal [-socket [(SocketIDs)]] [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-actionreq|-ar] [-output|-o (t
ext|nvmxml)]
show -dimm [(DimmIDs)] -pcd [(Config|LSA)] [-help|-h] [-output|-o (text|nvmxml)]
show -dimm [(DimmIDs)] -performance [(BytesRead|BytesWritten|HostReads|HostWrites|BlockReads|BlockWrites)] [-help|-h] [-output|-o (text|nvmxml)]
show -dimm [(DimmIDs)] [-socket (SocketIDs)] [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show [-dimm (DimmIDs)] -sensor [(Health|MediaTemperature|ControllerTemperature|PercentageRemaining|DirtyShutdowns|PowerOnTime|UpTime|PowerCycles|FwErrorCount)] [-help|-h]
[-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)]
show -event [-dimm (DimmIDs)] [Severity=(Info|Warning|Error)] [Category=(Diag|FW|Config|PM|Quick|Security|Health|Mgmt)] [ActionRequired=(1|0)] [Count=(<1..2147483647>)] [-
help|-h] [-output|-o (text|nvmxml)]
show -memoryresources [-help|-h] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -preferences [-help|-h] [-output|-o (text|nvmxml)]
show -region [(RegionIDs)] [-socket (SocketIDs)] [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -socket [(SocketIDs)] [-help|-h] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -system [(NFIT|PCAT|PMTT)] [-help|-h] [-output|-o (text|nvmxml)]
show -system -capabilities [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -system -host [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)]
show -topology [-dimm (DimmIDs)] [-socket (SocketIDs)] [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
  1. Show the required options on the first line, and the optional arguments indented on the next lines.
show -dimm [(DimmIDs)] -error (Thermal|Media)
        [SequenceNumber=(<0, 65535>)] [Level=(Low|High)] [Count=(<0, 255>)]
        [-help|-h] [-output|-o (text|nvmxml)]
show [-dimm [(DimmIDs)]] -firmware
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)] 
show [-dimm [(DimmIDs)]] -goal
        [-socket [(SocketIDs)]]
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-actionreq|-ar] [-output|-o (text|nvmxml)]
show -dimm [(DimmIDs)] -pcd [(Config|LSA)]
        [-help|-h] [-output|-o (text|nvmxml)]
show -dimm [(DimmIDs)] -performance [(BytesRead|BytesWritten|HostReads|HostWrites|BlockReads|BlockWrites)]
        [-help|-h] [-output|-o (text|nvmxml)]
show -dimm [(DimmIDs)] [-socket (SocketIDs)]
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show [-dimm (DimmIDs)] -sensor [(Health|MediaTemperature|ControllerTemperature|PercentageRemaining|DirtyShutdowns|PowerOnTime|UpTime|PowerCycles|FwErrorCount)]
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)]
show -event [-dimm (DimmIDs)] [Severity=(Info|Warning|Error)] [Category=(Diag|FW|Config|PM|Quick|Security|Health|Mgmt)] [ActionRequired=(1|0)] [Count=(<1..2147483647>)]
        [-help|-h] [-output|-o (text|nvmxml)]
show -memoryresources
        [-help|-h] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -preferences
        [-help|-h] [-output|-o (text|nvmxml)]
show -region [(RegionIDs)] [-socket (SocketIDs)]
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -socket [(SocketIDs)]
        [-help|-h] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -system [(NFIT|PCAT|PMTT)]
        [-help|-h] [-output|-o (text|nvmxml)]
show -system -capabilities
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
show -system -host
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-output|-o (text|nvmxml)]
show -topology [-dimm (DimmIDs)] [-socket (SocketIDs)]
        [-help|-h] [-all|-a] [-display|-d (Attributes)] [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)] [-output|-o (text|nvmxml)]
  1. Show a key for the common options, then just include the one-letter version in the list.
Options supported by many commands:
        [-all|-a]
        [-display|-d (Attributes)]
        [-help|-h]
        [-output|-o (text|nvmxml)]
        [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)]

show -dimm [(DimmIDs)] -pcd [(Config|LSA)] [-h][-o]
show -dimm [(DimmIDs)] -performance [(BytesRead|BytesWritten|HostReads|HostWrites|BlockReads|BlockWrites)] [-h][-o]
show -dimm [(DimmIDs)] -error (Thermal|Media) [SequenceNumber=(<0, 65535>)] [Level=(Low|High)] [Count=(<0, 255>)] [-h][-o]
show [-dimm (DimmIDs)] -event [Severity=(Info|Warning|Error)] [Category=(Diag|FW|Config|PM|Quick|Security|Health|Mgmt)] [ActionRequired=(1|0)] [Count=(<1..2147483647>)] [-
h][-o]
show [-dimm [(DimmIDs)]] -firmware [-a][-d][-h][-o]
show [-dimm [(DimmIDs)]] -goal [-socket [(SocketIDs)]] [-actionreq|-ar] [-a][-d][-h][-o][-u]
show [-dimm (DimmIDs)] -sensor [(Health|MediaTemperature|ControllerTemperature|PercentageRemaining|DirtyShutdowns|PowerOnTime|UpTime|PowerCycles|FwErrorCount)]
show -dimm [(DimmIDs)] [-socket (SocketIDs)] [-a][-h][-d][-u][-o]
show [-dimm (DimmIDs)] -topology [-socket (SocketIDs)] [-a][-d][-h][-o][-u]
show -memoryresources [-h][-o][-u]
show -preferences [-h][-o]
show -region [(RegionIDs)] [-socket (SocketIDs)] [-a][-d][-h][-u][-o]
[-a][-d]-h][-o]
show -socket [(SocketIDs)] [-d][-h][-o][-u]
show -system [(NFIT|PCAT|PMTT)] [-h][-o]
show -system -capabilities [-a][-d][-h][-o][-u]
show -system -host [-a][-d][-h][-o]

Unable to view the region

Unable to see the regions listed , when executing the command on fedora 28 , with kernel 4.17 and all the pre-requisite software

ipmctl show -region

SocketID ISetID PersistentMemoryType Capacity FreeCapacity HealthState
0 0xf455da901f248a22 AppDirectNotInterleaved 125.0 GiB 0.0 GiB Healthy
0 0x4c5fda905b258a22 AppDirectNotInterleaved 125.0 GiB 0.0 GiB Healthy
1 0x9a4bda9016238a22 AppDirectNotInterleaved 125.0 GiB 0.0 GiB Healthy
1 0xa055da90fd248a22 AppDirectNotInterleaved 125.0 GiB 0.0 GiB Healthy

Viral Policy information unsupported

In #43 I added some logic to not error out when calling unsupported commands. I believe I found a related issue.

In the latest release v01.00.00.3262, DIMM_INFO_CATEGORY_VIRAL_POLICY was added in commit 989c1b8. Since then, our code for configuring regions using the toplevel ipmctl API nvm_get_device_details() has broken.

nvm_get_device_details() is returning an error because our firmware appears to not support retrieval of viral policy. In

ReturnCode = gNvmDimmDriverNvmDimmConfig.GetDimm(&gNvmDimmDriverNvmDimmConfig, dimm_id, DIMM_INFO_CATEGORY_ALL, &dimm_info);
the parameter DIMM_INFO_CATEGORY_ALL is provided. There seems to be no check for whether viral policy is supported or not, and since fetching viral policy fails, nvm_get_device_details() fails.

nvm_get_device_details() should be fixed to either poll and respect the capabilities reported by the firmware, or ignore info categories which could potentially be unsupported. We can workaround for now by commenting out the invocations of FwCmdGetViralPolicy().

Decode System Timestamp from UNIX epoch into human-readable format

In ipmctl show -dimm -error Media and -error Thermal, it would be helpful to decode the timestamp (which is in UNIX epoch format) into a human-readable timestamp.

Media Error occurred on Dimm (0x1001):
System Timestamp : 1531324416
DPA : 2097136
PDA : 0
Range : 6
Error Type : 4

The linux date command does that conversion to UTC or local time. For the above timestamp, it calculates:

$ date --date @1531324416 -u
Wed Jul 11 15:53:36 UTC 2018
$ date --date @1531324416
Wed Jul 11 10:53:36 CDT 2018

Reserved has different meanings for create -goal and show -dimm

Setting a goal configuration with some capacity set to "Reserved":

$ sudo ipmctl create -goal Reserved=100

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0101  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0011  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0111  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0021  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0121  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1001  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1101  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1011  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1111  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1021  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1121  0.0 GiB         0.0 GiB 0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0101  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1001  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1101  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0011  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0111  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1011  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1111  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0021  0.0 GiB         0.0 GiB 0.0 GiB
0x0000          0x0121  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1021  0.0 GiB         0.0 GiB 0.0 GiB
0x0001          0x1121  0.0 GiB         0.0 GiB 0.0 GiB
A reboot is required to process new memory allocation goals.

results in that memory being reported as "Unconfigured" rather than "Reserved":

$ sudo ipmctl show -a -dimm 0x11 | grep Capacity
   Capacity=125.7 GiB
   MemoryCapacity=0.0 GiB
   AppDirectCapacity=0.0 GiB
   UnconfiguredCapacity=125.6 GiB
   InaccessibleCapacity=0.0 GiB
   ReservedCapacity=0.0 GiB

The terminology should match. I think Reserved is intended to report capacity that has been thrown away for alignment purposes, so a new name for that might be best. It might be OK to just include that in the Inaccessible Capacity.

veryfication typo

Spelling error in the word "verification":

DcpmemPkg/driver/Core/Diagnostics/FwDiagnostic.c: NVDIMM_DBG("Dimm 0x%x time veryfication diagnostic test: success", pDimm->DeviceHandle.AsUint32);

show system -NFIT doesn't print Platform Capabilities structure

show -system NFIT does not understand the NFIT Platform Capabilities structure (type 7).

NvmTables.h includes the structure definition and AcpiParsing.c decodes into it, but PrintNFit() and other functions ignore it.

PrintNFit(
  IN     ParsedFitHeader *pHeader
  )
{
  UINT16 Index = 0;

  if (pHeader == NULL) {
    return;
  }

  PrintAcpiHeader(&pHeader->pFit->Header);

  Print(L"\n");

  Print(L"BwRegionTablesNum: %d\n"
      L"ControlRegionTablesNum: %d\n"
      L"FlushHintTablesNum: %d\n"
      L"InterleaveTablesNum: %d\n"
      L"NVDIMMRegionTablesNum: %d\n"
      L"SmbiosTablesNum: %d\n"
      L"SpaRangeTablesNum: %d\n",
      pHeader->BWRegionTblesNum,
      pHeader->ControlRegionTblesNum,
      pHeader->FlushHintTblesNum,
      pHeader->InterleaveTblesNum,
      pHeader->NvDimmRegionTblesNum,
      pHeader->SmbiosTblesNum,
      pHeader->SpaRangeTblesNum
      );

In comparison, acpidump -b and iasl -d nfit.dat print it like this:

[990h 2448   2]                Subtable Type : 0007 [Platform Capabilities]
[992h 2450   2]                       Length : 0010

[994h 2452   1]           Highest Capability : 02
[995h 2453   3]                     Reserved : 000000
[998h 2456   4] Capabilities (decoded below) : 00000002
                       Cache Flush to NVDIMM : 0
                      Memory Flush to NVDIMM : 1
                            Memory Mirroring : 0
[99Ch 2460   4]                     Reserved : 00000000

Replace AppDirect2Size with ReservedSize in -goal commands

create -goal and show -goal include two AppDirectSize values, but only one is used; AppDirect2Size doesn't really exist.

SocketID DimmID MemorySize AppDirect1Size AppDirect2Size
0x0000 0x0001 0.0 GiB 125.0 GiB 0.0 GiB
0x0000 0x0011 0.0 GiB 125.0 GiB 0.0 GiB

Suggestions:

  1. Delete AppDirect2Size (and drop the 1 from AppDirect1Size).

  2. Since create -goal works by selecting the memory size and reserved size (implying the persistent memory size), show the Reserved size instead.

ipmctl create -goal PersistentMemoryType=AppDirect

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         125.0 GiB       0.0 GiB
0x0000          0x0011  0.0 GiB         125.0 GiB       0.0 GiB
ipmctl create -goal Reserved=50 PersistentMemoryType=AppDirect

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0000          0x0001  0.0 GiB         62.0 GiB        0.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        0.0 GiB

It'd be helpful to show:

SocketID        DimmID  MemorySize      AppDirectSize  ReservedSize
0x0000          0x0001  0.0 GiB         62.0 GiB        63.0 GiB
0x0000          0x0011  0.0 GiB         62.0 GiB        63.0 GiB

ipmctl's create arguments are:

    create [-help|-h] [-force|-f] 
        [-units|-u (B|MB|MiB|GB|GiB|TB|TiB)]
        [-output|-o (text|nvmxml)]
        [-dimm (DimmIDs)]
        -goal
        [-socket (SocketIDs)]
        [MemoryMode=(0|%)]
        [PersistentMemoryType=(AppDirect|AppDirectNotInterleaved)]
        [Reserved=(0|%)]
        [NamespaceLabelVersion=(1.1|1.2)]

Error: There is not enough memory to complete the requested operation

Hi,

I installed ipmctl on a new environment and received below response:

~# ipmctl list

Error: There is not enough memory to complete the requested operation.

No matter what instruction I use, it always throws this. However, I use /proc/meminfo and see there is a lot of memory space actually. Never seen this before. Does anyone know why?

Environment:

  • OS: Ubuntu 18.04.1 (kernel: 4.15.0-33-generic)
  • ipmctl commit : 63b8823b326b6e2

Creating Goals on Socket 0x0001 First Instead Creates a Goal on Socket 0x0000

If I create a goal on socket 0x0001 only, and reboot, the region allocated is on socket 0.

[root@101-249 ~]# ipmctl create -goal -socket 0x0001 MemoryMode=60 PersistentMemoryType=AppDirectNotInterleaved

The following configuration will be applied:

SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0001          0x1001  310.0 GiB               192.0 GiB       0.0 GiB
0x0001          0x1101  310.0 GiB               192.0 GiB       0.0 GiB
Do you want to continue? [y/n] y
Created following region configuration goal
SocketID        DimmID  MemorySize      AppDirect1Size  AppDirect2Size
0x0001          0x1001  310.0 GiB               192.0 GiB       0.0 GiB
0x0001          0x1101  310.0 GiB               192.0 GiB       0.0 GiB
A reboot is required to process new memory allocation goals.
[root@101-249 ~]# reboot

*System Reboots*

[root@101-249 ~]# ipmctl show -region

SocketID             ISetID    PersistentMemoryType  Capacity FreeCapacity HealthState
       0 0x3e3ada90583b8a22 AppDirectNotInterleaved 288.0 GiB    288.0 GiB     Healthy
       0 0xe83ada90693b8a22 AppDirectNotInterleaved 288.0 GiB    288.0 GiB     Healthy

Fix dimmm typo in NVDIMM_ERR messages

There is an extra m in "dimm" some of the error messages:

src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", nvm_status);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm by Pid (%d)\n", dimm_id);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm by Pid (%d)\n", dimm_id);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm by Pid (%d)\n", dimm_id);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:      NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", nvm_status);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);
src/os/nvm_api/nvm_management.c:    NVDIMM_ERR("Failed to get dimmm ID %d\n", rc);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.