diff mbox series

[v5,1/2] cxl: Preserve the CDAT access_coordinate for an endpoint

Message ID 20240618231730.2533819-2-dave.jiang@intel.com
State New
Headers show
Series cxl: Region bandwidth calculation for targets with shared upstream link | expand

Commit Message

Dave Jiang June 18, 2024, 11:16 p.m. UTC
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.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/cdat.c | 10 ++++++----
 drivers/cxl/cxlmem.h    |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Jonathan Cameron June 20, 2024, 10:13 a.m. UTC | #1
On Tue, 18 Jun 2024 16:16:40 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> 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.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Ira Weiny June 27, 2024, 2:32 p.m. UTC | #2
Dave Jiang wrote:
> 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.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/cxl/core/cdat.c | 10 ++++++----
>  drivers/cxl/cxlmem.h    |  1 +
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
> index bb83867d9fec..fea214340d4b 100644
> --- a/drivers/cxl/core/cdat.c
> +++ b/drivers/cxl/core/cdat.c
> @@ -15,7 +15,7 @@ struct dsmas_entry {
>  	struct range dpa_range;
>  	u8 handle;
>  	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
> -
> +	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
>  	int entries;
>  	int qos_class;
>  };
> @@ -163,7 +163,7 @@ static int cdat_dslbis_handler(union acpi_subtable_headers *header, void *arg,
>  	val = cdat_normalize(le16_to_cpu(le_val), le64_to_cpu(le_base),
>  			     dslbis->data_type);
>  
> -	cxl_access_coordinate_set(dent->coord, dslbis->data_type, val);
> +	cxl_access_coordinate_set(dent->cdat_coord, dslbis->data_type, val);
>  
>  	return 0;
>  }
> @@ -220,7 +220,7 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
>  	xa_for_each(dsmas_xa, index, dent) {
>  		int qos_class;
>  
> -		cxl_coordinates_combine(dent->coord, dent->coord, ep_c);
> +		cxl_coordinates_combine(dent->coord, dent->cdat_coord, ep_c);
>  		dent->entries = 1;
>  		rc = cxl_root->ops->qos_class(cxl_root,
>  					      &dent->coord[ACCESS_COORDINATE_CPU],
> @@ -241,8 +241,10 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
>  static void update_perf_entry(struct device *dev, struct dsmas_entry *dent,
>  			      struct cxl_dpa_perf *dpa_perf)
>  {
> -	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++)
> +	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
>  		dpa_perf->coord[i] = dent->coord[i];
> +		dpa_perf->cdat_coord[i] = dent->cdat_coord[i];
> +	}
>  	dpa_perf->dpa_range = dent->dpa_range;
>  	dpa_perf->qos_class = dent->qos_class;
>  	dev_dbg(dev,
> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
> index 19aba81cdf13..fb365453f996 100644
> --- a/drivers/cxl/cxlmem.h
> +++ b/drivers/cxl/cxlmem.h
> @@ -402,6 +402,7 @@ enum cxl_devtype {
>  struct cxl_dpa_perf {
>  	struct range dpa_range;
>  	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
> +	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];

Need to update the kdoc.

Other than that.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

>  	int qos_class;
>  };
>  
> -- 
> 2.45.1
>
Dave Jiang June 27, 2024, 5:53 p.m. UTC | #3
On 6/27/24 7:32 AM, Ira Weiny wrote:
> Dave Jiang wrote:
>> 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.
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>>  drivers/cxl/core/cdat.c | 10 ++++++----
>>  drivers/cxl/cxlmem.h    |  1 +
>>  2 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
>> index bb83867d9fec..fea214340d4b 100644
>> --- a/drivers/cxl/core/cdat.c
>> +++ b/drivers/cxl/core/cdat.c
>> @@ -15,7 +15,7 @@ struct dsmas_entry {
>>  	struct range dpa_range;
>>  	u8 handle;
>>  	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
>> -
>> +	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
>>  	int entries;
>>  	int qos_class;
>>  };
>> @@ -163,7 +163,7 @@ static int cdat_dslbis_handler(union acpi_subtable_headers *header, void *arg,
>>  	val = cdat_normalize(le16_to_cpu(le_val), le64_to_cpu(le_base),
>>  			     dslbis->data_type);
>>  
>> -	cxl_access_coordinate_set(dent->coord, dslbis->data_type, val);
>> +	cxl_access_coordinate_set(dent->cdat_coord, dslbis->data_type, val);
>>  
>>  	return 0;
>>  }
>> @@ -220,7 +220,7 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
>>  	xa_for_each(dsmas_xa, index, dent) {
>>  		int qos_class;
>>  
>> -		cxl_coordinates_combine(dent->coord, dent->coord, ep_c);
>> +		cxl_coordinates_combine(dent->coord, dent->cdat_coord, ep_c);
>>  		dent->entries = 1;
>>  		rc = cxl_root->ops->qos_class(cxl_root,
>>  					      &dent->coord[ACCESS_COORDINATE_CPU],
>> @@ -241,8 +241,10 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
>>  static void update_perf_entry(struct device *dev, struct dsmas_entry *dent,
>>  			      struct cxl_dpa_perf *dpa_perf)
>>  {
>> -	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++)
>> +	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
>>  		dpa_perf->coord[i] = dent->coord[i];
>> +		dpa_perf->cdat_coord[i] = dent->cdat_coord[i];
>> +	}
>>  	dpa_perf->dpa_range = dent->dpa_range;
>>  	dpa_perf->qos_class = dent->qos_class;
>>  	dev_dbg(dev,
>> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
>> index 19aba81cdf13..fb365453f996 100644
>> --- a/drivers/cxl/cxlmem.h
>> +++ b/drivers/cxl/cxlmem.h
>> @@ -402,6 +402,7 @@ enum cxl_devtype {
>>  struct cxl_dpa_perf {
>>  	struct range dpa_range;
>>  	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
>> +	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
> 
> Need to update the kdoc.

Will update.

> 
> Other than that.
> 
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>

Thanks!
> 
>>  	int qos_class;
>>  };
>>  
>> -- 
>> 2.45.1
>>
> 
>
diff mbox series

Patch

diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
index bb83867d9fec..fea214340d4b 100644
--- a/drivers/cxl/core/cdat.c
+++ b/drivers/cxl/core/cdat.c
@@ -15,7 +15,7 @@  struct dsmas_entry {
 	struct range dpa_range;
 	u8 handle;
 	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
-
+	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
 	int entries;
 	int qos_class;
 };
@@ -163,7 +163,7 @@  static int cdat_dslbis_handler(union acpi_subtable_headers *header, void *arg,
 	val = cdat_normalize(le16_to_cpu(le_val), le64_to_cpu(le_base),
 			     dslbis->data_type);
 
-	cxl_access_coordinate_set(dent->coord, dslbis->data_type, val);
+	cxl_access_coordinate_set(dent->cdat_coord, dslbis->data_type, val);
 
 	return 0;
 }
@@ -220,7 +220,7 @@  static int cxl_port_perf_data_calculate(struct cxl_port *port,
 	xa_for_each(dsmas_xa, index, dent) {
 		int qos_class;
 
-		cxl_coordinates_combine(dent->coord, dent->coord, ep_c);
+		cxl_coordinates_combine(dent->coord, dent->cdat_coord, ep_c);
 		dent->entries = 1;
 		rc = cxl_root->ops->qos_class(cxl_root,
 					      &dent->coord[ACCESS_COORDINATE_CPU],
@@ -241,8 +241,10 @@  static int cxl_port_perf_data_calculate(struct cxl_port *port,
 static void update_perf_entry(struct device *dev, struct dsmas_entry *dent,
 			      struct cxl_dpa_perf *dpa_perf)
 {
-	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++)
+	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
 		dpa_perf->coord[i] = dent->coord[i];
+		dpa_perf->cdat_coord[i] = dent->cdat_coord[i];
+	}
 	dpa_perf->dpa_range = dent->dpa_range;
 	dpa_perf->qos_class = dent->qos_class;
 	dev_dbg(dev,
diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
index 19aba81cdf13..fb365453f996 100644
--- a/drivers/cxl/cxlmem.h
+++ b/drivers/cxl/cxlmem.h
@@ -402,6 +402,7 @@  enum cxl_devtype {
 struct cxl_dpa_perf {
 	struct range dpa_range;
 	struct access_coordinate coord[ACCESS_COORDINATE_MAX];
+	struct access_coordinate cdat_coord[ACCESS_COORDINATE_MAX];
 	int qos_class;
 };