Skip to contentSkip to conversation

cxl/test: validate the auto region in cxl-topology.sh

PATCH In review [email protected] 1 participant 2 messages Nov 22, 2023 libnvdimm: non-volatile memory device

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 cxl/test: validate the auto region in cxl-topology.sh

From: Alison Schofield <[email protected]>

The cxl-test module sets up a region to be autodiscovered in order to test the CXL driver handling of BIOS defined regions. Confirm the region exists upon load of the cxl-test module.

---

The region does survive the ensuing shenanigans of this test. The region state moves from committed to disabled and back again as the memdevs, ports, and host bridges are disabled and then re-enabled. Although that was interesting, it's not clear that this test should be doing region error recovery testing.
Let me know if you think otherwise?

 test/cxl-topology.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
test/cxl-topology.sh +8 -0
index 89d01a89ccb1..e8b9f56543b5 100644
@@ -21,6 +21,14 @@ rc=1
 # tools/testing/cxl/test/cxl.c. If that model ever changes then the
 # paired update must be made to this test.
 
+# validate the autodiscovered region
+region=$("$CXL" list -R | jq -r ".[] | .region")
+if [[ ! $region ]]; then
+	echo "failed to find autodiscovered region"
+	err "$LINENO"
+fi
+
+
 # collect cxl_test root device id
 json=$($CXL list -b cxl_test)
 count=$(jq "length" <<< $json)

base-commit: a871e6153b11fe63780b37cdcb1eb347b296095c

Signature · 1 line
2.37.3
author maintainer
#1 lore raw
Quoted 9 lines · On Tue, Nov 21, 2023 at 06:18:49PM -0800, [email protected] wrote:

From: Alison Schofield <[email protected]>

The cxl-test module sets up a region to be autodiscovered in order to test the CXL driver handling of BIOS defined regions. Confirm the region exists upon load of the cxl-test module.

---

Quoted 7 lines

The region does survive the ensuing shenanigans of this test. The region state moves from committed to disabled and back again as the memdevs, ports, and host bridges are disabled and then re-enabled. Although that was interesting, it's not clear that this test should be doing region error recovery testing.
Let me know if you think otherwise?

I probably should have explained what doing 'more' would look like. We can add another check of the region before the final bus disable to confirm that it survived.

Quoted 29 lines

 test/cxl-topology.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
test/cxl-topology.sh +8 -0
index 89d01a89ccb1..e8b9f56543b5 100644
@@ -21,6 +21,14 @@ rc=1
 # tools/testing/cxl/test/cxl.c. If that model ever changes then the
 # paired update must be made to this test.
 
+# validate the autodiscovered region
+region=$("$CXL" list -R | jq -r ".[] | .region")
+if [[ ! $region ]]; then
+	echo "failed to find autodiscovered region"
+	err "$LINENO"
+fi
+
+
 # collect cxl_test root device id
 json=$($CXL list -b cxl_test)
 count=$(jq "length" <<< $json)

base-commit: a871e6153b11fe63780b37cdcb1eb347b296095c

Signature · 1 line
2.37.3