Blame SOURCES/0202-cxl-list-Add-interleave-parameters-to-decoder-listin.patch

26ccd9
From 0ee9ca3f6423a2af8ade983f596274f6fcfe66d6 Mon Sep 17 00:00:00 2001
26ccd9
From: Dan Williams <dan.j.williams@intel.com>
26ccd9
Date: Fri, 5 Aug 2022 13:38:03 -0700
26ccd9
Subject: [PATCH 202/217] cxl/list: Add interleave parameters to decoder
26ccd9
 listings
26ccd9
26ccd9
Emit interleave_ways and interleave_granularity in decoder output.
26ccd9
26ccd9
Link: https://lore.kernel.org/r/165973188300.1528532.222988685552982872.stgit@dwillia2-xfh.jf.intel.com
26ccd9
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
26ccd9
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
26ccd9
---
26ccd9
 cxl/json.c | 20 ++++++++++++++++++++
26ccd9
 1 file changed, 20 insertions(+)
26ccd9
26ccd9
diff --git a/cxl/json.c b/cxl/json.c
26ccd9
index 9cec58b..ada1dbe 100644
26ccd9
--- a/cxl/json.c
26ccd9
+++ b/cxl/json.c
26ccd9
@@ -466,6 +466,26 @@ struct json_object *util_cxl_decoder_to_json(struct cxl_decoder *decoder,
26ccd9
 			json_object_object_add(jdecoder, "size", jobj);
26ccd9
 	}
26ccd9
 
26ccd9
+	val = cxl_decoder_get_interleave_ways(decoder);
26ccd9
+	if (val < UINT_MAX) {
26ccd9
+		jobj = json_object_new_int(val);
26ccd9
+		if (jobj)
26ccd9
+			json_object_object_add(jdecoder, "interleave_ways",
26ccd9
+					       jobj);
26ccd9
+
26ccd9
+		/* granularity is a don't care if not interleaving */
26ccd9
+		if (val > 1) {
26ccd9
+			val = cxl_decoder_get_interleave_granularity(decoder);
26ccd9
+			if (val < UINT_MAX) {
26ccd9
+				jobj = json_object_new_int(val);
26ccd9
+				if (jobj)
26ccd9
+					json_object_object_add(
26ccd9
+						jdecoder,
26ccd9
+						"interleave_granularity", jobj);
26ccd9
+			}
26ccd9
+		}
26ccd9
+	}
26ccd9
+
26ccd9
 	if (size == 0) {
26ccd9
 		jobj = json_object_new_string("disabled");
26ccd9
 		if (jobj)
26ccd9
-- 
26ccd9
2.27.0
26ccd9