OK, got it.
I have figured out the problem.
I pass wrong parameter to util_daxctl_region_filter.
But I found two other problems before I apply my patch.
1. DAX device already online after reconfigure it to system-ram.
"$DAXCTL" reconfigure-device -N -m system-ram "$daxdev"
If daxctl-device.sh do online-memory again,
it makes FAIL daxctl-devices.sh (exit status: 1) even I add --no-online when
reconfigure-device
+ ../daxctl/daxctl reconfigure-device -N -m system-ram --no-online dax0.0
libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
reconfigured 1 device
[
{
"chardev":"dax0.0",
"size":262144000,
"target_node":0,
"mode":"system-ram",
"movable":false
}
]
++ daxctl_get_mode dax0.0
++ ../daxctl/daxctl list -d dax0.0
++ jq -er '.[].mode'
libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
+ [[ system-ram == \s\y\s\t\e\m\-\r\a\m ]]
+ ../daxctl/daxctl online-memory dax0.0
libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
libdaxctl: memblock_in_dev: dax0.0: memory0: Unable to determine phys_index: Success
dax0.0:
WARNING: detected a race while onlining memory
Some memory may not be in the expected zone. It is
recommended to disable any other onlining mechanisms,
and retry. If onlining is to be left to other agents,
use the --no-online option to suppress this warning
dax0.0: all memory sections (1) already online
onlined memory for 0 devices
++ cleanup 76
++ printf 'Error at line %d\n' 76
Error at line 76
++ [[ -n namespace0.0 ]]
++ reset_dev
++ ../ndctl/ndctl destroy-namespace -f -b ACPI.NFIT namespace0.0
libndctl: ndctl_namespace_enable: namespace0.0: failed to enable
destroyed 1 namespace
++ exit 1
FAIL daxctl-devices.sh (exit status: 1)
2. 2 nvdimm will make daxctl-devices.sh FAIL
+ testbus=ACPI.NFIT
++ ../ndctl/ndctl list -b ACPI.NFIT -Ni
++ jq -er '.[0].dev | .//""'
+ testdev=namespace1.0
+ [[ ! -n namespace1.0 ]]
+ printf 'Found victim dev: %s on bus: %s\n' namespace1.0 ACPI.NFIT
Found victim dev: namespace1.0 on bus: ACPI.NFIT
+ setup_dev
+ test -n ACPI.NFIT
+ test -n namespace1.0
+ ../ndctl/ndctl destroy-namespace -f -b ACPI.NFIT namespace1.0
destroyed 1 namespace
++ ../ndctl/ndctl create-namespace -b ACPI.NFIT -m devdax -fe namespace1.0 -s 256M
++ jq -er .dev
+ testdev=namespace1.0
+ test -n namespace1.0
+ rc=1
+ daxctl_test
+ local daxdev
++ daxctl_get_dev namespace1.0
++ ../ndctl/ndctl list -n namespace1.0 -X
++ jq -er '.[].daxregion.devices[0].chardev'
+ daxdev=dax1.0
+ test -n dax1.0
+ ../daxctl/daxctl reconfigure-device -N -m system-ram dax1.0
libdaxctl: daxctl_dev_enable: dax1.0: failed to enable
error reconfiguring devices: No such device
reconfigured 0 devices
++ cleanup 74
++ printf 'Error at line %d\n' 74
Error at line 74
++ [[ -n namespace1.0 ]]
++ reset_dev
++ ../ndctl/ndctl destroy-namespace -f -b ACPI.NFIT namespace1.0
destroyed 1 namespace
++ exit 1
FAIL daxctl-devices.sh (exit status: 1)
-----Original Message-----
From: Dan Williams <dan.j.williams(a)intel.com>
Sent: Friday, December 27, 2019 1:54 AM
To: Li, Redhairer <redhairer.li(a)intel.com>
Cc: linux-nvdimm(a)lists.01.org
Subject: Re: [PATCH] daxctl: Change region input type from INTEGER to STRING.
The way to fix this is mentioned in the log, see below...
On Wed, Dec 25, 2019 at 8:01 PM Li, Redhairer <redhairer.li(a)intel.com> wrote:
I saw daxctl-devices.sh is still failed before I apply my patch.
root@ubuntu-red:~/git/ndctl# vi test/test-suite.log
=========================================
ndctl 67.dirty: test/test-suite.log
=========================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: daxctl-devices.sh
=======================
+ rc=77
+ . ./common
++ '[' -f ../ndctl/ndctl ']'
++ '[' -x ../ndctl/ndctl ']'
++ export NDCTL=../ndctl/ndctl
++ NDCTL=../ndctl/ndctl
++ '[' -f ../daxctl/daxctl ']'
++ '[' -x ../daxctl/daxctl ']'
++ export DAXCTL=../daxctl/daxctl
++ DAXCTL=../daxctl/daxctl
++ NFIT_TEST_BUS0=nfit_test.0
++ NFIT_TEST_BUS1=nfit_test.1
++ ACPI_BUS=ACPI.NFIT
++ E820_BUS=e820
+ trap 'cleanup $LINENO' ERR
+ find_testdev
+ local rc=77
+ modinfo kmem
filename: /lib/modules/5.4.0-rc5_red_ndctltest_VM/kernel/drivers/dax/kmem.ko
alias: dax:t0*
license: GPL v2
author: Intel Corporation
srcversion: A0712EA9D9E63723E6B4CDA
depends:
retpoline: Y
intree: Y
name: kmem
vermagic: 5.4.0-rc5_red_ndctltest_VM SMP mod_unload
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
+ testbus=ACPI.NFIT
++ ../ndctl/ndctl list -b ACPI.NFIT -Ni jq -er '.[0].dev | .//""'
+ testdev=namespace0.0
+ [[ ! -n namespace0.0 ]]
+ printf 'Found victim dev: %s on bus: %s\n' namespace0.0 ACPI.NFIT
Found victim dev: namespace0.0 on bus: ACPI.NFIT
+ setup_dev
+ test -n ACPI.NFIT
+ test -n namespace0.0
+ ../ndctl/ndctl destroy-namespace -f -b ACPI.NFIT namespace0.0
destroyed 1 namespace
++ ../ndctl/ndctl create-namespace -b ACPI.NFIT -m devdax -fe
++ namespace0.0 -s 256M jq -er .dev
+ testdev=namespace0.0
+ test -n namespace0.0
+ rc=1
+ daxctl_test
+ local daxdev
++ daxctl_get_dev namespace0.0
++ ../ndctl/ndctl list -n namespace0.0 -X jq -er
++ '.[].daxregion.devices[0].chardev'
+ daxdev=dax0.0
+ test -n dax0.0
+ ../daxctl/daxctl reconfigure-device -N -m system-ram dax0.0
libdaxctl: daxctl_dev_disable: dax0.0: error: device model is
dax-class
libdaxctl: daxctl_dev_disable: dax0.0: see man
daxctl-migrate-device-model
If you run:
daxctl migrate-device-model
...and reboot the test should start working. The explanation for why this
migrate-device-model step is needed is detailed in the man page.
daxctl migrate-device-model --help