Skip to content

Commit e91be3e

Browse files
committed
cxl: Preserve the CDAT access_coordinate for an endpoint
Keep the access_coordinate from the CDAT tables for region perf calculations. The region perf calculation requires all participating endpoints to have arrived in order to determine if there are limitations of bandwidth data due to shared uplink. Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Acked-by: Dan Williams <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 423c9ba commit e91be3e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/cxl/core/cdat.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct dsmas_entry {
1414
struct range dpa_range;
1515
u8 handle;
1616
struct access_coordinate coord[ACCESS_COORDINATE_MAX];
17-
17+
struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
1818
int entries;
1919
int qos_class;
2020
};
@@ -162,7 +162,7 @@ static int cdat_dslbis_handler(union acpi_subtable_headers *header, void *arg,
162162
val = cdat_normalize(le16_to_cpu(le_val), le64_to_cpu(le_base),
163163
dslbis->data_type);
164164

165-
cxl_access_coordinate_set(dent->coord, dslbis->data_type, val);
165+
cxl_access_coordinate_set(dent->cdat_coord, dslbis->data_type, val);
166166

167167
return 0;
168168
}
@@ -219,7 +219,7 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
219219
xa_for_each(dsmas_xa, index, dent) {
220220
int qos_class;
221221

222-
cxl_coordinates_combine(dent->coord, dent->coord, ep_c);
222+
cxl_coordinates_combine(dent->coord, dent->cdat_coord, ep_c);
223223
dent->entries = 1;
224224
rc = cxl_root->ops->qos_class(cxl_root,
225225
&dent->coord[ACCESS_COORDINATE_CPU],
@@ -240,8 +240,10 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
240240
static void update_perf_entry(struct device *dev, struct dsmas_entry *dent,
241241
struct cxl_dpa_perf *dpa_perf)
242242
{
243-
for (int i = 0; i < ACCESS_COORDINATE_MAX; i++)
243+
for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
244244
dpa_perf->coord[i] = dent->coord[i];
245+
dpa_perf->cdat_coord[i] = dent->cdat_coord[i];
246+
}
245247
dpa_perf->dpa_range = dent->dpa_range;
246248
dpa_perf->qos_class = dent->qos_class;
247249
dev_dbg(dev,

drivers/cxl/cxlmem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,13 @@ enum cxl_devtype {
398398
* struct cxl_dpa_perf - DPA performance property entry
399399
* @dpa_range: range for DPA address
400400
* @coord: QoS performance data (i.e. latency, bandwidth)
401+
* @cdat_coord: raw QoS performance data from CDAT
401402
* @qos_class: QoS Class cookies
402403
*/
403404
struct cxl_dpa_perf {
404405
struct range dpa_range;
405406
struct access_coordinate coord[ACCESS_COORDINATE_MAX];
407+
struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
406408
int qos_class;
407409
};
408410

0 commit comments

Comments
 (0)