All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] test/libndctl: Update namespace size to take care of interleaved DIMMs
@ 2020-01-20 13:41 Aneesh Kumar K.V
  2020-01-20 13:41 ` [PATCH 2/2] test/dsm-fail: " Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2020-01-20 13:41 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, jmoyer; +Cc: linux-nvdimm, Aneesh Kumar K.V

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.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 test/libndctl.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/test/libndctl.c b/test/libndctl.c
index 02bb9ccaa465..adad66f8a34e 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -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:
-- 
2.24.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] test/dsm-fail: Update namespace size to take care of interleaved DIMMs
  2020-01-20 13:41 [PATCH 1/2] test/libndctl: Update namespace size to take care of interleaved DIMMs Aneesh Kumar K.V
@ 2020-01-20 13:41 ` Aneesh Kumar K.V
  0 siblings, 0 replies; 2+ messages in thread
From: Aneesh Kumar K.V @ 2020-01-20 13:41 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, jmoyer; +Cc: linux-nvdimm, Aneesh Kumar K.V

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

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 test/dsm-fail.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/dsm-fail.c b/test/dsm-fail.c
index 6e812aec008f..1bc15514e43c 100644
--- a/test/dsm-fail.c
+++ b/test/dsm-fail.c
@@ -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;
-- 
2.24.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-20 13:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 13:41 [PATCH 1/2] test/libndctl: Update namespace size to take care of interleaved DIMMs Aneesh Kumar K.V
2020-01-20 13:41 ` [PATCH 2/2] test/dsm-fail: " Aneesh Kumar K.V

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.