Query and use Partition Info
cover Query and use Partition Info
From: Ira Weiny <[email protected]>
Three small patches which query and report Partition Info. In addition, correct ram and pmem size calculations to account for potential partitioned space.
Ira Weiny (3):
cxl/pci: Store memory capacity values
cxl/mem: Report correct ram/pmem size in sysfs
cxl/mem: Add partition information to sysfs
drivers/cxl/mem.h | 4 ++ drivers/cxl/pci.c | 178 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 174 insertions(+), 8 deletions(-)
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
PATCH 1/3 cxl/pci: Store memory capacity values
From: Ira Weiny <[email protected]>
The Identify Memory Device command returns information about the volatile and persistent memory capacities. Store those values in the cxl_mem structure for later use. While at it, reuse the calculation of the volatile and persistent memory byte values to calculate the ram and pmem ranges.
--- drivers/cxl/mem.h | 4 ++++ drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-)
drivers/cxl/mem.h +4 -0
@@ -75,5 +75,9 @@ struct cxl_mem {struct range pmem_range;struct range ram_range; +u64 total_cap_bytes; +u64 volatile_cap_bytes; +u64 persistent_cap_bytes; + u64 partition_align_bytes; };#endif /* __CXL_MEM_H__ */
drivers/cxl/pci.c +33 -3
@@ -57,6 +57,15 @@ enum opcode { CXL_MBOX_OP_MAX = 0x10000 }; +/* +* CXL 2.0 - Memory capacity multiplier +* See Section 8.2.9.5 +* +* Volatile, Persistent, and Partition capacities are specified to be in +* multiples of 256MB - define a multiplier to convert to/from bytes. +*/ +#define CXL_CAPACITY_MULTIPLIER SZ_256M +/** * struct mbox_cmd - A command to be submitted to hardware. * @opcode: (input) The command set and command submitted to hardware.
@@ -1542,16 +1551,37 @@ static int cxl_mem_identify(struct cxl_mem *cxlm)if (rc <0 )return rc; + cxlm->total_cap_bytes =le64_to_cpu (id.total_capacity); + cxlm->total_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->volatile_cap_bytes =le64_to_cpu (id.volatile_capacity); + cxlm->volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->persistent_cap_bytes =le64_to_cpu (id.persistent_capacity); + cxlm->persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->partition_align_bytes =le64_to_cpu (id.partition_align); + cxlm->partition_align_bytes *=CXL_CAPACITY_MULTIPLIER ; + +dev_dbg (&cxlm->pdev->dev,"Identify Memory Device\n" +" total_cap_bytes = %#llx\n" +" volatile_cap_bytes = %#llx\n" +" persistent_cap_bytes = %#llx\n" +" partition_align_bytes = %#llx\n" , + cxlm->total_cap_bytes, + cxlm->volatile_cap_bytes, + cxlm->persistent_cap_bytes, + cxlm->partition_align_bytes); +/* * TODO: enumerate DPA map, as 'ram' and 'pmem' do not alias. * For now, only the capacity is exported in sysfs */ cxlm->ram_range.start =0 ; - cxlm->ram_range.end =le64_to_cpu (id.volatile_capacity) *SZ_256M -1 ; + cxlm->ram_range.end = cxlm->volatile_cap_bytes -1 ; cxlm->pmem_range.start =0 ; - cxlm->pmem_range.end = -le64_to_cpu (id.persistent_capacity) *SZ_256M -1 ; + cxlm->pmem_range.end = cxlm->persistent_cap_bytes -1 ; cxlm->lsa_size =le32_to_cpu (id.lsa_size);memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision));
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
Re: [PATCH 1/3] cxl/pci: Store memory capacity values
Quoted 9 lines · On 21-06-10 17:22:22, [email protected] wrote:
From: Ira Weiny <[email protected]>
The Identify Memory Device command returns information about the volatile and persistent memory capacities. Store those values in the
cxl_memstructure for later use. While at it, reuse the calculation of the volatile and persistent memory byte values to calculate the ram and pmem ranges.Signed-off-by Ira Weiny <[email protected]>
One comment below that can be taken or left...
Quoted 10 lines
--- drivers/cxl/mem.h | 4 ++++ drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-)drivers/cxl/mem.h +0
-0
drivers/cxl/mem.h struct cxl_mem { · line 80
Quoted 6 lines
drivers/cxl/mem.h +3
-0@@ -75,5 +75,9 @@ struct cxl_mem {struct range pmem_range;struct range ram_range; +u64 total_cap_bytes; +u64 volatile_cap_bytes; +u64 persistent_cap_bytes;
I'd either drop 'cap' entirely or type it out. I don't think 'cap' is a descriptive name.
Quoted 67 lines
drivers/cxl/mem.h +1
-0+ u64 partition_align_bytes; };#endif /* __CXL_MEM_H__ */ drivers/cxl/pci.c +33
-3@@ -57,6 +57,15 @@ enum opcode { CXL_MBOX_OP_MAX = 0x10000 }; +/* +* CXL 2.0 - Memory capacity multiplier +* See Section 8.2.9.5 +* +* Volatile, Persistent, and Partition capacities are specified to be in +* multiples of 256MB - define a multiplier to convert to/from bytes. +*/ +#define CXL_CAPACITY_MULTIPLIER SZ_256M +/** * struct mbox_cmd - A command to be submitted to hardware. * @opcode: (input) The command set and command submitted to hardware. @@ -1542,16 +1551,37 @@ static int cxl_mem_identify(struct cxl_mem *cxlm)if (rc <0 )return rc; + cxlm->total_cap_bytes =le64_to_cpu (id.total_capacity); + cxlm->total_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->volatile_cap_bytes =le64_to_cpu (id.volatile_capacity); + cxlm->volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->persistent_cap_bytes =le64_to_cpu (id.persistent_capacity); + cxlm->persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + + cxlm->partition_align_bytes =le64_to_cpu (id.partition_align); + cxlm->partition_align_bytes *=CXL_CAPACITY_MULTIPLIER ; + +dev_dbg (&cxlm->pdev->dev,"Identify Memory Device\n" +" total_cap_bytes = %#llx\n" +" volatile_cap_bytes = %#llx\n" +" persistent_cap_bytes = %#llx\n" +" partition_align_bytes = %#llx\n" , + cxlm->total_cap_bytes, + cxlm->volatile_cap_bytes, + cxlm->persistent_cap_bytes, + cxlm->partition_align_bytes); +/* * TODO: enumerate DPA map, as 'ram' and 'pmem' do not alias. * For now, only the capacity is exported in sysfs */ cxlm->ram_range.start =0 ; - cxlm->ram_range.end =le64_to_cpu (id.volatile_capacity) *SZ_256M -1 ; + cxlm->ram_range.end = cxlm->volatile_cap_bytes -1 ; cxlm->pmem_range.start =0 ; - cxlm->pmem_range.end = -le64_to_cpu (id.persistent_capacity) *SZ_256M -1 ; + cxlm->pmem_range.end = cxlm->persistent_cap_bytes -1 ; cxlm->lsa_size =le32_to_cpu (id.lsa_size);memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision));Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
Re: [PATCH 1/3] cxl/pci: Store memory capacity values
In reply to [email protected]Quoted 20 lines · On Thu, Jun 10, 2021 at 5:22 PM <[email protected]> wrote:
From: Ira Weiny <[email protected]>
The Identify Memory Device command returns information about the volatile and persistent memory capacities. Store those values in the
cxl_memstructure for later use. While at it, reuse the calculation of the volatile and persistent memory byte values to calculate the ram and pmem ranges.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/mem.h | 4 ++++ drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-)drivers/cxl/mem.h +0
-0
drivers/cxl/mem.h struct cxl_mem { · line 80
Quoted 6 lines
drivers/cxl/mem.h +3
-0@@ -75,5 +75,9 @@ struct cxl_mem {struct range pmem_range;struct range ram_range; +u64 total_cap_bytes; +u64 volatile_cap_bytes; +u64 persistent_cap_bytes;
Hmm, why these fields?
I would expect pmem_range and ram_range can already represent these values and range_len(pmem_range) + range_len(ram_range) == total capacity.
Re: [PATCH 1/3] cxl/pci: Store memory capacity values
Quoted 30 lines · Dan Williams
Quoted 20 lines · On Thu, Jun 10, 2021 at 5:22 PM <[email protected]> wrote:
From: Ira Weiny <[email protected]>
The Identify Memory Device command returns information about the volatile and persistent memory capacities. Store those values in the
cxl_memstructure for later use. While at it, reuse the calculation of the volatile and persistent memory byte values to calculate the ram and pmem ranges.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/mem.h | 4 ++++ drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-)drivers/cxl/mem.h +0
-0drivers/cxl/mem.h struct cxl_mem { · line 80
Quoted 6 lines
drivers/cxl/mem.h +3
-0@@ -75,5 +75,9 @@ struct cxl_mem {struct range pmem_range;struct range ram_range; +u64 total_cap_bytes; +u64 volatile_cap_bytes; +u64 persistent_cap_bytes;Hmm, why these fields?
Quoted 3 lines
I would expect
pmem_rangeandram_rangecan already represent these values andrange_len(pmem_range)+range_len(ram_range)== total capacity.
So the way Ira described it (AIUI), pmem_range will be the total partitioned amount, while persistent_cap_bytes is min(info.persistent capacity, pmem_range) (same for volatile). But perhaps I misunderstood.
Re: [PATCH 1/3] cxl/pci: Store memory capacity values
Quoted 31 lines · Ben
Quoted 30 lines · Dan Williams
Quoted 20 lines · On Thu, Jun 10, 2021 at 5:22 PM <[email protected]> wrote:
From: Ira Weiny <[email protected]>
The Identify Memory Device command returns information about the volatile and persistent memory capacities. Store those values in the
cxl_memstructure for later use. While at it, reuse the calculation of the volatile and persistent memory byte values to calculate the ram and pmem ranges.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/mem.h | 4 ++++ drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-)drivers/cxl/mem.h +0
-0drivers/cxl/mem.h struct cxl_mem { · line 80
Quoted 6 lines
drivers/cxl/mem.h +3
-0@@ -75,5 +75,9 @@ struct cxl_mem {struct range pmem_range;struct range ram_range; +u64 total_cap_bytes; +u64 volatile_cap_bytes; +u64 persistent_cap_bytes;Hmm, why these fields?
Quoted 7 lines
Quoted 3 lines
I would expect
pmem_rangeandram_rangecan already represent these values andrange_len(pmem_range)+range_len(ram_range)== total capacity.So the way Ira described it (AIUI),
pmem_rangewill be the total partitioned amount, whilepersistent_cap_bytesismin(info.persistent capacity, pmem_range)(same for volatile). But perhaps I misunderstood.
Yes persistent is 'persistent only'... so s/cap/only/ is probably better name.
pmem_range.len() may == persistent_cap_bytes. But does not need to.
Ira
PATCH 2/3 cxl/mem: Report correct ram/pmem size in sysfs
In reply to [email protected]From: Ira Weiny <[email protected]>
Memory devices may specify volatile only, persistent only, and partitionable space which when added together result in a total capacity.
The partitionable space is configurable between volatile and persistent space. To account for the dynamic partitionable space the correct ram and pmem size information is reported in the Get Partition Info device command.
Define cxl_mem_get_partition() and call it to retrieve the correct ram and pmem ranges sizes.
--- drivers/cxl/pci.c | 97 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 7 deletions(-)
drivers/cxl/pci.c +90 -7
@@ -1455,6 +1455,62 @@ static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm)return ret; } +/** +* cxl_mem_get_partition_info - Set partition info +* @cxlm: The device to act on +* @active_volatile_cap_bytes: returned active volatile capacity; in bytes +* @active_persistent_cap_bytes: returned active persistent capacity; in bytes +* @next_volatile_cap_bytes: return next volatile capacity; in bytes +* @next_persistent_cap_bytes: return next persistent capacity; in bytes +* +* Retrieve the current partition info for the device specified. The active +* values are the current capacity in bytes. If not 0, the 'next' values are +* the pending values, in bytes, which take affect on next cold reset. +* +* Return: 0 if no error: or the result of the mailbox command. +* +* See CXL @8.2.9.5.2.1 Get Partition Info +*/ +int cxl_mem_get_partition_info (struct cxl_mem *cxlm, +u64 *active_volatile_cap_bytes, +u64 *active_persistent_cap_bytes, +u64 *next_volatile_cap_bytes, +u64 *next_persistent_cap_bytes) +{ +struct cxl_mbox_get_partition_info { +u64 active_volatile_cap; +u64 active_persistent_cap; +u64 next_volatile_cap; +u64 next_persistent_cap; + } __packed pi; +int rc; + +/* On error report 0 */ + *active_volatile_cap_bytes =0 ; + *active_persistent_cap_bytes =0 ; + *next_volatile_cap_bytes =0 ; + *next_persistent_cap_bytes =0 ; + + rc =cxl_mem_mbox_send_cmd (cxlm,CXL_MBOX_OP_GET_PARTITION_INFO , +NULL ,0 , &pi,sizeof (pi)); + +if (rc) +return rc; + + *active_volatile_cap_bytes =le64_to_cpu (pi.active_volatile_cap); + *active_persistent_cap_bytes =le64_to_cpu (pi.active_persistent_cap); + *next_volatile_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + *next_persistent_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + + *active_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *active_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_mem_get_partition_info); +/** * cxl_mem_enumerate_cmds() - Enumerate commands for a device. * @cxlm: The device.
@@ -1573,20 +1629,45 @@ static int cxl_mem_identify(struct cxl_mem *cxlm) cxlm->persistent_cap_bytes, cxlm->partition_align_bytes); + cxlm->lsa_size =le32_to_cpu (id.lsa_size); +memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision)); + +return 0 ; +} + +static void cxl_mem_create_range_info (struct cxl_mem *cxlm) +{ +u64 active_volatile_cap_bytes; +u64 active_persistent_cap_bytes; +u64 next_volatile_cap_bytes; +u64 next_persistent_cap_bytes; + +if (cxl_mem_get_partition_info (cxlm, + &active_volatile_cap_bytes, + &active_persistent_cap_bytes, + &next_volatile_cap_bytes, + &next_persistent_cap_bytes)) +dev_err (&cxlm->pdev->dev,"Failed to query partition information\n" ); + +dev_dbg (&cxlm->pdev->dev,"Get Partition Info\n" +" active_volatile_cap_bytes = %#llx\n" +" active_persistent_cap_bytes = %#llx\n" +" next_volatile_cap_bytes = %#llx\n" +" next_persistent_cap_bytes = %#llx\n" , + active_volatile_cap_bytes, + active_persistent_cap_bytes, + next_volatile_cap_bytes, + next_persistent_cap_bytes); +/* * TODO: enumerate DPA map, as 'ram' and 'pmem' do not alias. * For now, only the capacity is exported in sysfs */ cxlm->ram_range.start =0 ; - cxlm->ram_range.end = cxlm->volatile_cap_bytes -1 ; + cxlm->ram_range.end = active_volatile_cap_bytes -1 ; cxlm->pmem_range.start =0 ; - cxlm->pmem_range.end = cxlm->persistent_cap_bytes -1 ; - - cxlm->lsa_size =le32_to_cpu (id.lsa_size); -memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision)); - -return 0 ; + cxlm->pmem_range.end = active_persistent_cap_bytes -1 ; }static int cxl_mem_probe (struct pci_dev *pdev,const struct pci_device_id *id)
@@ -1618,6 +1699,8 @@ static int cxl_mem_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (rc)return rc; +cxl_mem_create_range_info (cxlm); +return cxl_mem_add_memdev (cxlm); }
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
Re: [PATCH 2/3] cxl/mem: Report correct ram/pmem size in sysfs
Quoted 23 lines · On Thu, 10 Jun 2021 17:22:23 -0700 <[email protected]> wrote:
From: Ira Weiny <[email protected]>
Memory devices may specify volatile only, persistent only, and partitionable space which when added together result in a total capacity.
The partitionable space is configurable between volatile and persistent space. To account for the dynamic partitionable space the correct ram and pmem size information is reported in the Get Partition Info device command.
Define
cxl_mem_get_partition()and call it to retrieve the correct ram and pmem ranges sizes.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 97 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 7 deletions(-)drivers/cxl/pci.c +0
-0
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1459
Quoted 5 lines
drivers/cxl/pci.c +2
-0@@ -1455,6 +1455,62 @@ static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm)return ret; } +/** +* cxl_mem_get_partition_info - Set partition info
Having a function call _get_ that is documented as "Set" is somewhat unusual.
Quoted 19 lines
drivers/cxl/pci.c +19
-0+* @cxlm: The device to act on +* @active_volatile_cap_bytes: returned active volatile capacity; in bytes +* @active_persistent_cap_bytes: returned active persistent capacity; in bytes +* @next_volatile_cap_bytes: return next volatile capacity; in bytes +* @next_persistent_cap_bytes: return next persistent capacity; in bytes +* +* Retrieve the current partition info for the device specified. The active +* values are the current capacity in bytes. If not 0, the 'next' values are +* the pending values, in bytes, which take affect on next cold reset. +* +* Return: 0 if no error: or the result of the mailbox command. +* +* See CXL @8.2.9.5.2.1 Get Partition Info +*/ +int cxl_mem_get_partition_info (struct cxl_mem *cxlm, +u64 *active_volatile_cap_bytes, +u64 *active_persistent_cap_bytes, +u64 *next_volatile_cap_bytes, +u64 *next_persistent_cap_bytes)
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1488
Quoted 10 lines
drivers/cxl/pci.c +10
-0+{ +struct cxl_mbox_get_partition_info { +u64 active_volatile_cap; +u64 active_persistent_cap; +u64 next_volatile_cap; +u64 next_persistent_cap; + } __packed pi; +int rc; + +/* On error report 0 */
This command is optional... See below.
Quoted 59 lines
drivers/cxl/pci.c +52
-0+ *active_volatile_cap_bytes =0 ; + *active_persistent_cap_bytes =0 ; + *next_volatile_cap_bytes =0 ; + *next_persistent_cap_bytes =0 ; + + rc =cxl_mem_mbox_send_cmd (cxlm,CXL_MBOX_OP_GET_PARTITION_INFO , +NULL ,0 , &pi,sizeof (pi)); + +if (rc) +return rc; + + *active_volatile_cap_bytes =le64_to_cpu (pi.active_volatile_cap); + *active_persistent_cap_bytes =le64_to_cpu (pi.active_persistent_cap); + *next_volatile_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + *next_persistent_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + + *active_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *active_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_mem_get_partition_info); +/** * cxl_mem_enumerate_cmds() - Enumerate commands for a device. * @cxlm: The device. @@ -1573,20 +1629,45 @@ static int cxl_mem_identify(struct cxl_mem *cxlm) cxlm->persistent_cap_bytes, cxlm->partition_align_bytes); + cxlm->lsa_size =le32_to_cpu (id.lsa_size); +memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision)); + +return 0 ; +} + +static void cxl_mem_create_range_info (struct cxl_mem *cxlm) +{ +u64 active_volatile_cap_bytes; +u64 active_persistent_cap_bytes; +u64 next_volatile_cap_bytes; +u64 next_persistent_cap_bytes; + +if (cxl_mem_get_partition_info (cxlm, + &active_volatile_cap_bytes, + &active_persistent_cap_bytes, + &next_volatile_cap_bytes, + &next_persistent_cap_bytes)) +dev_err (&cxlm->pdev->dev,"Failed to query partition information\n" ); + + dev_dbg(&cxlm->pdev->dev, "Get Partition Info\n" + " active_volatile_cap_bytes = %#llx\n" + " active_persistent_cap_bytes = %#llx\n" + " next_volatile_cap_bytes = %#llx\n" + " next_persistent_cap_bytes = %#llx\n", + active_volatile_cap_bytes, + active_persistent_cap_bytes,
drivers/cxl/pci.c static int cxl_mem_identify(struct cxl_mem *cxlm) · line 1667
Quoted 10 lines
drivers/cxl/pci.c +4
-1+ next_volatile_cap_bytes, + next_persistent_cap_bytes); +/* * TODO: enumerate DPA map, as 'ram' and 'pmem' do not alias. * For now, only the capacity is exported in sysfs */ cxlm->ram_range.start =0 ; - cxlm->ram_range.end = cxlm->volatile_cap_bytes -1 ; + cxlm->ram_range.end = active_volatile_cap_bytes -1 ;
This change looks to wipe out the valid settings on a device that only does fixed allocations to pmem vs volatile.
Quoted 21 lines
drivers/cxl/pci.c +3
-6cxlm->pmem_range.start =0 ; - cxlm->pmem_range.end = cxlm->persistent_cap_bytes -1 ; - - cxlm->lsa_size =le32_to_cpu (id.lsa_size); -memcpy (cxlm->firmware_version, id.fw_revision,sizeof (id.fw_revision)); - -return 0 ; + cxlm->pmem_range.end = active_persistent_cap_bytes -1 ; }static int cxl_mem_probe (struct pci_dev *pdev,const struct pci_device_id *id)@@ -1618,6 +1699,8 @@ static int cxl_mem_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (rc)return rc; +cxl_mem_create_range_info (cxlm); +return cxl_mem_add_memdev (cxlm); }
Re: [PATCH 2/3] cxl/mem: Report correct ram/pmem size in sysfs
Quoted 8 lines
Quoted 8 lines
drivers/cxl/pci.c +0
-0@@ -1455,6 +1455,62 @@ static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm)return ret; }
Quoted 4 lines
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1459
Quoted 2 lines
drivers/cxl/pci.c +2
-0+/** +* cxl_mem_get_partition_info - Set partition info Having a function call _get_ that is documented as "Set" is somewhat unusual.
Oops... yea...
Quoted 23 lines
Quoted 23 lines
drivers/cxl/pci.c +23
-0+* @cxlm: The device to act on +* @active_volatile_cap_bytes: returned active volatile capacity; in bytes +* @active_persistent_cap_bytes: returned active persistent capacity; in bytes +* @next_volatile_cap_bytes: return next volatile capacity; in bytes +* @next_persistent_cap_bytes: return next persistent capacity; in bytes +* +* Retrieve the current partition info for the device specified. The active +* values are the current capacity in bytes. If not 0, the 'next' values are +* the pending values, in bytes, which take affect on next cold reset. +* +* Return: 0 if no error: or the result of the mailbox command. +* +* See CXL @8.2.9.5.2.1 Get Partition Info +*/ +int cxl_mem_get_partition_info (struct cxl_mem *cxlm, +u64 *active_volatile_cap_bytes, +u64 *active_persistent_cap_bytes, +u64 *next_volatile_cap_bytes, +u64 *next_persistent_cap_bytes) +{ +struct cxl_mbox_get_partition_info { +u64 active_volatile_cap; +u64 active_persistent_cap;
Quoted 8 lines
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1488
Quoted 6 lines
drivers/cxl/pci.c +6
-0+u64 next_volatile_cap; +u64 next_persistent_cap; + }__packed pi; +int rc; + +/* On error report 0 */ This command is optional... See below.
I did not realize that... Ok, this will not work then.
Quoted 10 lines
drivers/cxl/pci.c static int cxl_mem_identify(struct cxl_mem *cxlm) · line 1667
Quoted 7 lines
drivers/cxl/pci.c +1
-1/* * TODO: enumerate DPA map, as 'ram' and 'pmem' do not alias. * For now, only the capacity is exported in sysfs */ cxlm->ram_range.start =0 ; - cxlm->ram_range.end = cxlm->volatile_cap_bytes -1 ; + cxlm->ram_range.end = active_volatile_cap_bytes -1 ;This change looks to wipe out the valid settings on a device that only does fixed allocations to pmem vs volatile.
Yes it sure will... :-(
Thanks for pointing it out...
Ira
Re: [PATCH 2/3] cxl/mem: Report correct ram/pmem size in sysfs
In reply to [email protected]Quoted 38 lines · On Thu, Jun 10, 2021 at 5:22 PM <[email protected]> wrote:
From: Ira Weiny <[email protected]>
Memory devices may specify volatile only, persistent only, and partitionable space which when added together result in a total capacity.
The partitionable space is configurable between volatile and persistent space. To account for the dynamic partitionable space the correct ram and pmem size information is reported in the Get Partition Info device command.
Define
cxl_mem_get_partition()and call it to retrieve the correct ram and pmem ranges sizes.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 97 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 7 deletions(-)drivers/cxl/pci.c +11
-0@@ -1455,6 +1455,62 @@ static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm)return ret; } +/** +* cxl_mem_get_partition_info - Set partition info +* @cxlm: The device to act on +* @active_volatile_cap_bytes: returned active volatile capacity; in bytes +* @active_persistent_cap_bytes: returned active persistent capacity; in bytes +* @next_volatile_cap_bytes: return next volatile capacity; in bytes +* @next_persistent_cap_bytes: return next persistent capacity; in bytes +* +* Retrieve the current partition info for the device specified. The active +* values are the current capacity in bytes. If not 0, the 'next' values are +* the pending values, in bytes, which take affect on next cold reset.
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1478
Quoted 10 lines
drivers/cxl/pci.c +10
-0+* +* Return: 0 if no error: or the result of the mailbox command. +* +* See CXL @8.2.9.5.2.1 Get Partition Info +*/ +int cxl_mem_get_partition_info (struct cxl_mem *cxlm, +u64 *active_volatile_cap_bytes, +u64 *active_persistent_cap_bytes, +u64 *next_volatile_cap_bytes, +u64 *next_persistent_cap_bytes)
Similar to how cxl_mem_identify() populates data in cxl_mem, I would expect this routine to do the same.
Quoted 24 lines
drivers/cxl/pci.c +24
-0+{ +struct cxl_mbox_get_partition_info { +u64 active_volatile_cap; +u64 active_persistent_cap; +u64 next_volatile_cap; +u64 next_persistent_cap; + } __packed pi; +int rc; + +/* On error report 0 */ + *active_volatile_cap_bytes =0 ; + *active_persistent_cap_bytes =0 ; + *next_volatile_cap_bytes =0 ; + *next_persistent_cap_bytes =0 ; + + rc =cxl_mem_mbox_send_cmd (cxlm,CXL_MBOX_OP_GET_PARTITION_INFO , +NULL ,0 , &pi,sizeof (pi)); + +if (rc) +return rc; + + *active_volatile_cap_bytes =le64_to_cpu (pi.active_volatile_cap); + *active_persistent_cap_bytes =le64_to_cpu (pi.active_persistent_cap); + *next_volatile_cap_bytes =le64_to_cpu (pi.next_volatile_cap);
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1512
Quoted 10 lines
drivers/cxl/pci.c +10
-0+ *next_persistent_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + + *active_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *active_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_mem_get_partition_info);
Why is this exported? Only the PCI driver cares about this.
Re: [PATCH 2/3] cxl/mem: Report correct ram/pmem size in sysfs
Quoted 81 lines · Dan Williams
Quoted 38 lines · On Thu, Jun 10, 2021 at 5:22 PM <[email protected]> wrote:
From: Ira Weiny <[email protected]>
Memory devices may specify volatile only, persistent only, and partitionable space which when added together result in a total capacity.
The partitionable space is configurable between volatile and persistent space. To account for the dynamic partitionable space the correct ram and pmem size information is reported in the Get Partition Info device command.
Define
cxl_mem_get_partition()and call it to retrieve the correct ram and pmem ranges sizes.Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 97 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 7 deletions(-)drivers/cxl/pci.c +11
-0@@ -1455,6 +1455,62 @@ static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm)return ret; } +/** +* cxl_mem_get_partition_info - Set partition info +* @cxlm: The device to act on +* @active_volatile_cap_bytes: returned active volatile capacity; in bytes +* @active_persistent_cap_bytes: returned active persistent capacity; in bytes +* @next_volatile_cap_bytes: return next volatile capacity; in bytes +* @next_persistent_cap_bytes: return next persistent capacity; in bytes +* +* Retrieve the current partition info for the device specified. The active +* values are the current capacity in bytes. If not 0, the 'next' values are +* the pending values, in bytes, which take affect on next cold reset. drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1478
Quoted 10 lines
drivers/cxl/pci.c +10
-0+* +* Return: 0 if no error: or the result of the mailbox command. +* +* See CXL @8.2.9.5.2.1 Get Partition Info +*/ +int cxl_mem_get_partition_info (struct cxl_mem *cxlm, +u64 *active_volatile_cap_bytes, +u64 *active_persistent_cap_bytes, +u64 *next_volatile_cap_bytes, +u64 *next_persistent_cap_bytes)Similar to how
cxl_mem_identify()populates data incxl_mem, I would expect this routine to do the same.Quoted 28 lines
drivers/cxl/pci.c +28
-0+{ +struct cxl_mbox_get_partition_info { +u64 active_volatile_cap; +u64 active_persistent_cap; +u64 next_volatile_cap; +u64 next_persistent_cap; + } __packed pi; +int rc; + +/* On error report 0 */ + *active_volatile_cap_bytes =0 ; + *active_persistent_cap_bytes =0 ; + *next_volatile_cap_bytes =0 ; + *next_persistent_cap_bytes =0 ; + + rc =cxl_mem_mbox_send_cmd (cxlm,CXL_MBOX_OP_GET_PARTITION_INFO , +NULL ,0 , &pi,sizeof (pi)); + +if (rc) +return rc; + + *active_volatile_cap_bytes =le64_to_cpu (pi.active_volatile_cap); + *active_persistent_cap_bytes =le64_to_cpu (pi.active_persistent_cap); + *next_volatile_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + *next_persistent_cap_bytes =le64_to_cpu (pi.next_volatile_cap); + + *active_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *active_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ;
Quoted 8 lines
drivers/cxl/pci.c static struct cxl_mbox_get_supported_logs *cxl_get_gsl(struct cxl_mem *cxlm) · line 1512
Quoted 6 lines
drivers/cxl/pci.c +6
-0+ *next_volatile_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + *next_persistent_cap_bytes *=CXL_CAPACITY_MULTIPLIER ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_mem_get_partition_info);Why is this exported? Only the PCI driver cares about this.
Once we get to dynamic partitioning I would expect it to need to be exported... But I think you are correct... No need to do that until we need it.
Ira
PATCH 3/3 cxl/mem: Add partition information to sysfs
In reply to [email protected]From: Ira Weiny <[email protected]>
Partitionable space is added to the ram and pmem size sysfs attributes but this does not show the entire story.
Add full partition information about the device under <sysfs>/partition.
--- drivers/cxl/pci.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
drivers/cxl/pci.c +49 -0
@@ -1226,6 +1226,42 @@ static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr,static struct device_attribute dev_attr_pmem_size =__ATTR (size,0444 , pmem_size_show,NULL ); +static ssize_t part_vo_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->volatile_cap_bytes); +} + +static struct device_attribute dev_attr_part_vo = +__ATTR (volatile_only,0444 , part_vo_show,NULL ); + +static ssize_t part_po_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->persistent_cap_bytes); +} + +static struct device_attribute dev_attr_part_po = +__ATTR (persistent_only,0444 , part_po_show,NULL ); + +static ssize_t part_total_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->total_cap_bytes); +} + +static struct device_attribute dev_attr_part_total = +__ATTR (total,0444 , part_total_show,NULL ); +static struct attribute *cxl_memdev_attributes[] = { &dev_attr_firmware_version.attr, &dev_attr_payload_max.attr,
@@ -1243,6 +1279,13 @@ static struct attribute *cxl_memdev_ram_attributes[] = { NULL, }; +static struct attribute *cxl_memdev_part_attributes[] = { + &dev_attr_part_vo.attr, + &dev_attr_part_po.attr, + &dev_attr_part_total.attr, +NULL , +}; +static struct attribute_group cxl_memdev_attribute_group = { .attrs = cxl_memdev_attributes, };
@@ -1257,10 +1300,16 @@ static struct attribute_group cxl_memdev_pmem_attribute_group = { .attrs = cxl_memdev_pmem_attributes, }; +static struct attribute_group cxl_memdev_part_attribute_group = { + .name ="partition" , + .attrs = cxl_memdev_part_attributes, +}; +static const struct attribute_group *cxl_memdev_attribute_groups[] = { &cxl_memdev_attribute_group, &cxl_memdev_ram_attribute_group, &cxl_memdev_pmem_attribute_group, + &cxl_memdev_part_attribute_group,NULL , };
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
Re: [PATCH 3/3] cxl/mem: Add partition information to sysfs
Quoted 21 lines · On Thu, 10 Jun 2021 17:22:24 -0700 <[email protected]> wrote:
From: Ira Weiny <[email protected]>
Partitionable space is added to the ram and pmem size sysfs attributes but this does not show the entire story.
Add full partition information about the device under <sysfs>/partition.
Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)drivers/cxl/pci.c +1
-0@@ -1226,6 +1226,42 @@ static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr,static struct device_attribute dev_attr_pmem_size =__ATTR (size,0444 , pmem_size_show,NULL ); +static ssize_t part_vo_show(struct device *dev, struct device_attribute *attr,
drivers/cxl/pci.c static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr, · line 1239
Quoted 10 lines
drivers/cxl/pci.c +10
-0+ char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->volatile_cap_bytes); +} + +static struct device_attribute dev_attr_part_vo = +__ATTR (volatile_only,0444 , part_vo_show,NULL );
With a bit of tweaking could we use DEVICE_ATTR_RO for these and have even less boilerplate?
Quoted 59 lines
drivers/cxl/pci.c +38
-0+ +static ssize_t part_po_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->persistent_cap_bytes); +} + +static struct device_attribute dev_attr_part_po = +__ATTR (persistent_only,0444 , part_po_show,NULL ); + +static ssize_t part_total_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->total_cap_bytes); +} + +static struct device_attribute dev_attr_part_total = +__ATTR (total,0444 , part_total_show,NULL ); +static struct attribute *cxl_memdev_attributes[] = { &dev_attr_firmware_version.attr, &dev_attr_payload_max.attr,@@ -1243,6 +1279,13 @@ static struct attribute *cxl_memdev_ram_attributes[] = { NULL, }; +static struct attribute *cxl_memdev_part_attributes[] = { + &dev_attr_part_vo.attr, + &dev_attr_part_po.attr, + &dev_attr_part_total.attr, +NULL , +}; +static struct attribute_group cxl_memdev_attribute_group = { .attrs = cxl_memdev_attributes, };@@ -1257,10 +1300,16 @@ static struct attribute_group cxl_memdev_pmem_attribute_group = { .attrs = cxl_memdev_pmem_attributes, }; +static struct attribute_group cxl_memdev_part_attribute_group = { + .name ="partition" , + .attrs = cxl_memdev_part_attributes, +}; +static const struct attribute_group *cxl_memdev_attribute_groups[] = { &cxl_memdev_attribute_group, &cxl_memdev_ram_attribute_group, &cxl_memdev_pmem_attribute_group, + &cxl_memdev_part_attribute_group,NULL , };
Re: [PATCH 3/3] cxl/mem: Add partition information to sysfs
In reply to [email protected]Quoted 6 lines · On 21-06-10 17:22:24, [email protected] wrote:
From: Ira Weiny <[email protected]>
Partitionable space is added to the ram and pmem size sysfs attributes but this does not show the entire story.
Add full partition information about the device under <sysfs>/partition.
Please add these to:Documentation/ABI/testing/sysfs-bus-cxl
It might be time to break that file up... maybe a syfs-bus-cxl-memdev?
I'll also pose the original question here, what's the justification for exposing this via sysfs versus having userspace executing the mailbox command itself? Are you planning to have these attributes be writable at some point to do the partition programming?
Quoted 87 lines
Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)drivers/cxl/pci.c +49
-0@@ -1226,6 +1226,42 @@ static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr,static struct device_attribute dev_attr_pmem_size =__ATTR (size,0444 , pmem_size_show,NULL ); +static ssize_t part_vo_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->volatile_cap_bytes); +} + +static struct device_attribute dev_attr_part_vo = +__ATTR (volatile_only,0444 , part_vo_show,NULL ); + +static ssize_t part_po_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->persistent_cap_bytes); +} + +static struct device_attribute dev_attr_part_po = +__ATTR (persistent_only,0444 , part_po_show,NULL ); + +static ssize_t part_total_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->total_cap_bytes); +} + +static struct device_attribute dev_attr_part_total = +__ATTR (total,0444 , part_total_show,NULL ); +static struct attribute *cxl_memdev_attributes[] = { &dev_attr_firmware_version.attr, &dev_attr_payload_max.attr,@@ -1243,6 +1279,13 @@ static struct attribute *cxl_memdev_ram_attributes[] = { NULL, }; +static struct attribute *cxl_memdev_part_attributes[] = { + &dev_attr_part_vo.attr, + &dev_attr_part_po.attr, + &dev_attr_part_total.attr, +NULL , +}; +static struct attribute_group cxl_memdev_attribute_group = { .attrs = cxl_memdev_attributes, };@@ -1257,10 +1300,16 @@ static struct attribute_group cxl_memdev_pmem_attribute_group = { .attrs = cxl_memdev_pmem_attributes, }; +static struct attribute_group cxl_memdev_part_attribute_group = { + .name ="partition" , + .attrs = cxl_memdev_part_attributes, +}; +static const struct attribute_group *cxl_memdev_attribute_groups[] = { &cxl_memdev_attribute_group, &cxl_memdev_ram_attribute_group, &cxl_memdev_pmem_attribute_group, + &cxl_memdev_part_attribute_group,NULL , };Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9
Re: [PATCH 3/3] cxl/mem: Add partition information to sysfs
Quoted 10 lines · Ben
Quoted 6 lines · On 21-06-10 17:22:24, [email protected] wrote:
From: Ira Weiny <[email protected]>
Partitionable space is added to the ram and pmem size sysfs attributes but this does not show the entire story.
Add full partition information about the device under <sysfs>/partition.
Please add these to:
Documentation/ABI/testing/sysfs-bus-cxl
Good point... Thanks!
Quoted 7 lines
It might be time to break that file up... maybe a syfs-bus-cxl-memdev?
I'll also pose the original question here, what's the justification for exposing this via sysfs versus having userspace executing the mailbox command itself? Are you planning to have these attributes be writable at some point to do the partition programming?
Well... if we have ram/size and pmem/size this is nice to have to know how it is configured...
For me I like not having to have to execute mailbox commands for everything but I understand having sysfs 'explosion'... not really sure were to draw the line. For now this helps me to see what the emulators are returning.
Ira
Quoted 87 lines
Quoted 87 lines
Signed-off-by Ira Weiny <[email protected]>--- drivers/cxl/pci.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)drivers/cxl/pci.c +49
-0@@ -1226,6 +1226,42 @@ static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr,static struct device_attribute dev_attr_pmem_size =__ATTR (size,0444 , pmem_size_show,NULL ); +static ssize_t part_vo_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->volatile_cap_bytes); +} + +static struct device_attribute dev_attr_part_vo = +__ATTR (volatile_only,0444 , part_vo_show,NULL ); + +static ssize_t part_po_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->persistent_cap_bytes); +} + +static struct device_attribute dev_attr_part_po = +__ATTR (persistent_only,0444 , part_po_show,NULL ); + +static ssize_t part_total_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct cxl_memdev *cxlmd =to_cxl_memdev (dev); +struct cxl_mem *cxlm = cxlmd->cxlm; + +return sysfs_emit (buf,"%#llx\n" , cxlm->total_cap_bytes); +} + +static struct device_attribute dev_attr_part_total = +__ATTR (total,0444 , part_total_show,NULL ); +static struct attribute *cxl_memdev_attributes[] = { &dev_attr_firmware_version.attr, &dev_attr_payload_max.attr,@@ -1243,6 +1279,13 @@ static struct attribute *cxl_memdev_ram_attributes[] = { NULL, }; +static struct attribute *cxl_memdev_part_attributes[] = { + &dev_attr_part_vo.attr, + &dev_attr_part_po.attr, + &dev_attr_part_total.attr, +NULL , +}; +static struct attribute_group cxl_memdev_attribute_group = { .attrs = cxl_memdev_attributes, };@@ -1257,10 +1300,16 @@ static struct attribute_group cxl_memdev_pmem_attribute_group = { .attrs = cxl_memdev_pmem_attributes, }; +static struct attribute_group cxl_memdev_part_attribute_group = { + .name ="partition" , + .attrs = cxl_memdev_part_attributes, +}; +static const struct attribute_group *cxl_memdev_attribute_groups[] = { &cxl_memdev_attribute_group, &cxl_memdev_ram_attribute_group, &cxl_memdev_pmem_attribute_group, + &cxl_memdev_part_attribute_group,NULL , };Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9