Blame SOURCES/0189-libcxl-add-a-depth-attribute-to-cxl_port.patch

26ccd9
From 0a43bfdf030b4a84fce562462944a9a44888afaa Mon Sep 17 00:00:00 2001
26ccd9
From: Vishal Verma <vishal.l.verma@intel.com>
26ccd9
Date: Mon, 15 Aug 2022 13:22:04 -0600
26ccd9
Subject: [PATCH 189/217] libcxl: add a depth attribute to cxl_port
26ccd9
26ccd9
Add a depth attribute to the cxl_port structure, that can be used for
26ccd9
calculating its distance from the root port, and will be needed for
26ccd9
interleave granularity calculations during region creation.
26ccd9
26ccd9
Link: https://lore.kernel.org/r/20220815192214.545800-2-vishal.l.verma@intel.com
26ccd9
Suggested-by: Dan Williams <dan.j.williams@intel.com>
26ccd9
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
26ccd9
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
26ccd9
---
26ccd9
 cxl/lib/libcxl.c  | 1 +
26ccd9
 cxl/lib/private.h | 1 +
26ccd9
 2 files changed, 2 insertions(+)
26ccd9
26ccd9
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
26ccd9
index e52896f..145c6ba 100644
26ccd9
--- a/cxl/lib/libcxl.c
26ccd9
+++ b/cxl/lib/libcxl.c
26ccd9
@@ -744,6 +744,7 @@ static int cxl_port_init(struct cxl_port *port, struct cxl_port *parent_port,
26ccd9
 	port->type = type;
26ccd9
 	port->parent = parent_port;
26ccd9
 	port->type = type;
26ccd9
+	port->depth = parent_port ? parent_port->depth + 1 : 0;
26ccd9
 
26ccd9
 	list_head_init(&port->child_ports);
26ccd9
 	list_head_init(&port->endpoints);
26ccd9
diff --git a/cxl/lib/private.h b/cxl/lib/private.h
26ccd9
index f6d4573..832a815 100644
26ccd9
--- a/cxl/lib/private.h
26ccd9
+++ b/cxl/lib/private.h
26ccd9
@@ -66,6 +66,7 @@ struct cxl_port {
26ccd9
 	int decoders_init;
26ccd9
 	int dports_init;
26ccd9
 	int nr_dports;
26ccd9
+	int depth;
26ccd9
 	struct cxl_ctx *ctx;
26ccd9
 	struct cxl_bus *bus;
26ccd9
 	enum cxl_port_type type;
26ccd9
-- 
26ccd9
2.27.0
26ccd9