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