Skip to contentSkip to conversation

test/libndctl: Update namespace size to take care of interleaved DIMMs

PATCH New Aneesh Kumar K.V 1 participant 2 messages Jan 20, 2020 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 test/libndctl: Update namespace size to take care of interleaved DIMMs

The minimum size of a namespace should be SUB_SECTION_SIZE * interleaved DIMM count. Update the test to use the correct size. Also, adjust the available size of blk namespace using the same interleaved DIMMs to account for the new pmem namespace size.

---
 test/libndctl.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
test/libndctl.c +11 -9
index 02bb9ccaa465..adad66f8a34e 100644
@@ -254,8 +254,9 @@ static unsigned long blk_sector_sizes[] = { 512, 520, 528, 4096, 4104, 4160, 422
 static unsigned long pmem_sector_sizes[] = { 512, 4096 };
 static unsigned long io_sector_sizes[] = { 0 };
 
+/* region 0 consist of two interleaved dimms*/
 static struct namespace namespace0_pmem0 = {
-	0, "namespace_pmem", &btt_settings, &pfn_settings, &dax_settings, SZ_18M,
+	0, "namespace_pmem", &btt_settings, &pfn_settings, &dax_settings, SZ_16M,
 	{ 1, 1, 1, 1,
 	  1, 1, 1, 1,
 	  1, 1, 1, 1,
@@ -263,8 +264,9 @@ static struct namespace namespace0_pmem0 = {
 	ARRAY_SIZE(pmem_sector_sizes), pmem_sector_sizes,
 };
 
+/* region 1 consist of 4 interleaved dimms*/
 static struct namespace namespace1_pmem0 = {
-	0, "namespace_pmem", &btt_settings, &pfn_settings, &dax_settings, SZ_20M,
+	0, "namespace_pmem", &btt_settings, &pfn_settings, &dax_settings, SZ_16M,
 	{ 2, 2, 2, 2,
 	  2, 2, 2, 2,
 	  2, 2, 2, 2,
@@ -349,7 +351,7 @@ static struct region regions0[] = {
 			[0] = &default_pfn,
 		},
 	},
-	{ { DIMM_HANDLE(0, 0, 0, 0, 0) }, 1, 1, "blk", SZ_18M, SZ_32M,
+	{ { DIMM_HANDLE(0, 0, 0, 0, 0) }, 1, 1, "blk", SZ_20M, SZ_32M,
 		.namespaces = {
 			[0] = &namespace2_blk0,
 			[1] = &namespace2_blk1,
@@ -358,7 +360,7 @@ static struct region regions0[] = {
 			[0] = &default_btt,
 		},
 	},
-	{ { DIMM_HANDLE(0, 0, 0, 0, 1) }, 1, 1, "blk", SZ_18M, SZ_32M,
+	{ { DIMM_HANDLE(0, 0, 0, 0, 1) }, 1, 1, "blk", SZ_20M, SZ_32M,
 		.namespaces = {
 			[0] = &namespace3_blk0,
 			[1] = &namespace3_blk1,
@@ -367,7 +369,7 @@ static struct region regions0[] = {
 			[0] = &default_btt,
 		},
 	},
-	{ { DIMM_HANDLE(0, 0, 1, 0, 0) }, 1, 1, "blk", SZ_27M, SZ_32M,
+	{ { DIMM_HANDLE(0, 0, 1, 0, 0) }, 1, 1, "blk", SZ_28M, SZ_32M,
 		.namespaces = {
 			[0] = &namespace4_blk0,
 		},
@@ -375,7 +377,7 @@ static struct region regions0[] = {
 			[0] = &default_btt,
 		},
 	},
-	{ { DIMM_HANDLE(0, 0, 1, 0, 1) }, 1, 1, "blk", SZ_27M, SZ_32M,
+	{ { DIMM_HANDLE(0, 0, 1, 0, 1) }, 1, 1, "blk", SZ_28M, SZ_32M,
 		.namespaces = {
 			[0] = &namespace5_blk0,
 		},
@@ -992,8 +994,8 @@ static int check_btt_size(struct ndctl_btt *btt)
 	int size_select, sect_select;
 	unsigned long long expect_table[][2] = {
 		[0] = {
-			[0] = 0x11b5400,
-			[1] = 0x8daa000,
+			[0] = 0xfb9400,
+			[1] = 0x7dca000,
 		},
 		[1] = {
 			[0] = 0x13b1400,
@@ -1017,7 +1019,7 @@ static int check_btt_size(struct ndctl_btt *btt)
 	}
 
 	switch (ns_size) {
-	case SZ_18M:
+	case SZ_16M:
 		size_select = 0;
 		break;
 	case SZ_20M:
Signature · 4 lines
2.24.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]
#1 lore raw

PATCH 2/2 test/dsm-fail: Update namespace size to take care of interleaved DIMMs

The minimum size of a namespace should be SUB_SECTION_SIZE * interleaved DIMM count. Update the test to use the correct size.

---
 test/dsm-fail.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
test/dsm-fail.c +5 -1
index 6e812aec008f..1bc15514e43c 100644
@@ -228,11 +228,15 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
 	ndctl_region_foreach(bus, region) {
 		if (ndctl_region_get_type(region) != ND_DEVICE_REGION_PMEM)
 			continue;
+		/*
+		 * We have max 4 interleaved dimms in region1.
+		 * Hence size needs to be 8M
+		 */
 		ndctl_dimm_foreach_in_region(region, dimm) {
 			const char *argv[] = {
 				"__func__", "-v", "-r",
 				ndctl_region_get_devname(region),
-				"-s", "4M", "-m", "raw",
+				"-s", "8M", "-m", "raw",
 			};
 			struct ndctl_namespace *ndns;
 			int count, i;
Signature · 4 lines
2.24.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]