Linux CXL
 help / color / mirror / Atom feed
* [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
@ 2025-02-20  6:20 Donet Tom
  2025-02-20 13:35 ` Jeff Moyer
  2025-02-26  7:01 ` Zhijian Li (Fujitsu)
  0 siblings, 2 replies; 8+ messages in thread
From: Donet Tom @ 2025-02-20  6:20 UTC (permalink / raw)
  To: Alison Schofield, nvdimm, linux-cxl; +Cc: Ritesh Harjani, Li Zhijian Jeff Moyer

If any one of BTT, PFN, or DAX is not present, but the other two
are, then the region capabilities are not displayed in the
ndctl list -R -C command.

This is because util_region_capabilities_to_json() returns NULL
if any one of BTT, PFN, or DAX is not present.

In this patch, we have changed the logic to display all the region
capabilities that are present.

Test Results with CONFIG_BTT disabled
=====================================
Without this patch
------------------
 # ./ndctl list -R -C
 [
  {
    "dev":"region1",
    "size":12884901888,
    "align":16777216,
    "available_size":11257511936,
    "max_available_extent":9630121984,
    "type":"pmem",
    "iset_id":14748366918514061582,
    "persistence_domain":"unknown"
  },

With this patch
---------------
 # ./ndctl list -R -C
 [
  {
    "dev":"region1",
    "size":12884901888,
    "align":16777216,
    "available_size":11257511936,
    "max_available_extent":9630121984,
    "type":"pmem",
    "iset_id":14748366918514061582,
    "capabilities":[
      {
        "mode":"fsdax",
        "alignments":[
          65536,
          2097152,
          1073741824
        ]
      },
      {
        "mode":"devdax",
        "alignments":[
          65536,
          2097152,
          1073741824
        ]
      }
    ],
    "persistence_domain":"unknown"
  },

v1 -> v2:
Addressed the review comments from Jeff and Alison.

v1:
https://lore.kernel.org/all/20250219094049.5156-1-donettom@linux.ibm.com/

Fixes: 965fa02e372f ("util: Distribute 'filter' and 'json' helpers to per-tool objects")
Signed-off-by: Donet Tom <donettom@linux.vnet.ibm.com>
---
 ndctl/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ndctl/json.c b/ndctl/json.c
index 23bad7f..7646882 100644
--- a/ndctl/json.c
+++ b/ndctl/json.c
@@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
 	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
 	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
 
-	if (!btt || !pfn || !dax)
+	if (!btt && !pfn && !dax)
 		return NULL;
 
 	jcaps = json_object_new_array();
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-20  6:20 [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX Donet Tom
@ 2025-02-20 13:35 ` Jeff Moyer
  2025-02-26  6:02   ` Donet Tom
  2025-02-26  7:01 ` Zhijian Li (Fujitsu)
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff Moyer @ 2025-02-20 13:35 UTC (permalink / raw)
  To: Donet Tom; +Cc: Alison Schofield, nvdimm, linux-cxl, Ritesh Harjani

> diff --git a/ndctl/json.c b/ndctl/json.c
> index 23bad7f..7646882 100644
> --- a/ndctl/json.c
> +++ b/ndctl/json.c
> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>  	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>  	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>  
> -	if (!btt || !pfn || !dax)
> +	if (!btt && !pfn && !dax)
>  		return NULL;
>  
>  	jcaps = json_object_new_array();

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-20 13:35 ` Jeff Moyer
@ 2025-02-26  6:02   ` Donet Tom
  2025-02-26  7:00     ` Zhijian Li (Fujitsu)
  2025-02-26 19:43     ` Alison Schofield
  0 siblings, 2 replies; 8+ messages in thread
From: Donet Tom @ 2025-02-26  6:02 UTC (permalink / raw)
  To: Jeff Moyer, Donet Tom, Alison Schofield
  Cc: Alison Schofield, nvdimm, linux-cxl, Ritesh Harjani


On 2/20/25 19:05, Jeff Moyer wrote:
>> diff --git a/ndctl/json.c b/ndctl/json.c
>> index 23bad7f..7646882 100644
>> --- a/ndctl/json.c
>> +++ b/ndctl/json.c
>> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>>   	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>>   	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>>   
>> -	if (!btt || !pfn || !dax)
>> +	if (!btt && !pfn && !dax)
>>   		return NULL;
>>   
>>   	jcaps = json_object_new_array();
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
>
Thanks Jeff


Hi Alison

Should I send a v3 with Reviewed-by tag or will you take the patch with 
the tag?

Thanks
Donet

>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-26  6:02   ` Donet Tom
@ 2025-02-26  7:00     ` Zhijian Li (Fujitsu)
  2025-02-27  6:13       ` Donet Tom
  2025-02-26 19:43     ` Alison Schofield
  1 sibling, 1 reply; 8+ messages in thread
From: Zhijian Li (Fujitsu) @ 2025-02-26  7:00 UTC (permalink / raw)
  To: Donet Tom, Jeff Moyer, Donet Tom, Alison Schofield
  Cc: nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Ritesh Harjani



On 26/02/2025 14:02, Donet Tom wrote:
> 
> On 2/20/25 19:05, Jeff Moyer wrote:
>>> diff --git a/ndctl/json.c b/ndctl/json.c
>>> index 23bad7f..7646882 100644
>>> --- a/ndctl/json.c
>>> +++ b/ndctl/json.c
>>> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>>>       struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>>>       struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>>> -    if (!btt || !pfn || !dax)
>>> +    if (!btt && !pfn && !dax)
>>>           return NULL;
>>>       jcaps = json_object_new_array();
>> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
>>
> Thanks Jeff
> 
> 
> Hi Alison
> 
> Should I send a v3 with Reviewed-by tag 

Generally speaking, there is no need for you to do this.

A small tip might be helpful if you send a patch next time.

>> 
>> v1 -> v2:
>> Addressed the review comments from Jeff and Alison.
>> 
>> v1:
>> https://lore.kernel.org/all/20250219094049.5156-1-donettom@linux.ibm.com/

Commit messages that are not intended to appear in the upstream git tree
should be placed after the '---' marker. [0]

[0] https://docs.kernel.org/process/submitting-patches.html#commentary

Thanks
Zhijian

> or will you take the patch with the tag?
> 
> Thanks
> Donet
> 
>>
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-20  6:20 [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX Donet Tom
  2025-02-20 13:35 ` Jeff Moyer
@ 2025-02-26  7:01 ` Zhijian Li (Fujitsu)
  1 sibling, 0 replies; 8+ messages in thread
From: Zhijian Li (Fujitsu) @ 2025-02-26  7:01 UTC (permalink / raw)
  To: Donet Tom, Alison Schofield, nvdimm@lists.linux.dev,
	linux-cxl@vger.kernel.org
  Cc: Ritesh Harjani, Li Zhijian Jeff Moyer



On 20/02/2025 14:20, Donet Tom wrote:
> If any one of BTT, PFN, or DAX is not present, but the other two
> are, then the region capabilities are not displayed in the
> ndctl list -R -C command.
> 
> This is because util_region_capabilities_to_json() returns NULL
> if any one of BTT, PFN, or DAX is not present.
> 
> In this patch, we have changed the logic to display all the region
> capabilities that are present.
> 
> Test Results with CONFIG_BTT disabled
> =====================================
> Without this patch
> ------------------
>   # ./ndctl list -R -C
>   [
>    {
>      "dev":"region1",
>      "size":12884901888,
>      "align":16777216,
>      "available_size":11257511936,
>      "max_available_extent":9630121984,
>      "type":"pmem",
>      "iset_id":14748366918514061582,
>      "persistence_domain":"unknown"
>    },
> 
> With this patch
> ---------------
>   # ./ndctl list -R -C
>   [
>    {
>      "dev":"region1",
>      "size":12884901888,
>      "align":16777216,
>      "available_size":11257511936,
>      "max_available_extent":9630121984,
>      "type":"pmem",
>      "iset_id":14748366918514061582,
>      "capabilities":[
>        {
>          "mode":"fsdax",
>          "alignments":[
>            65536,
>            2097152,
>            1073741824
>          ]
>        },
>        {
>          "mode":"devdax",
>          "alignments":[
>            65536,
>            2097152,
>            1073741824
>          ]
>        }
>      ],
>      "persistence_domain":"unknown"
>    },
> 
> v1 -> v2:
> Addressed the review comments from Jeff and Alison.
> 
> v1:
> https://lore.kernel.org/all/20250219094049.5156-1-donettom@linux.ibm.com/
> 
> Fixes: 965fa02e372f ("util: Distribute 'filter' and 'json' helpers to per-tool objects")
> Signed-off-by: Donet Tom <donettom@linux.vnet.ibm.com>


Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Tested-by: Li Zhijian <lizhijian@fujitsu.com>


> ---
>   ndctl/json.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ndctl/json.c b/ndctl/json.c
> index 23bad7f..7646882 100644
> --- a/ndctl/json.c
> +++ b/ndctl/json.c
> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>   	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>   	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>   
> -	if (!btt || !pfn || !dax)
> +	if (!btt && !pfn && !dax)
>   		return NULL;
>   
>   	jcaps = json_object_new_array();

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-26  6:02   ` Donet Tom
  2025-02-26  7:00     ` Zhijian Li (Fujitsu)
@ 2025-02-26 19:43     ` Alison Schofield
  2025-02-27  6:14       ` Donet Tom
  1 sibling, 1 reply; 8+ messages in thread
From: Alison Schofield @ 2025-02-26 19:43 UTC (permalink / raw)
  To: Donet Tom; +Cc: Jeff Moyer, Donet Tom, nvdimm, linux-cxl, Ritesh Harjani

On Wed, Feb 26, 2025 at 11:32:30AM +0530, Donet Tom wrote:
> 
> On 2/20/25 19:05, Jeff Moyer wrote:
> > > diff --git a/ndctl/json.c b/ndctl/json.c
> > > index 23bad7f..7646882 100644
> > > --- a/ndctl/json.c
> > > +++ b/ndctl/json.c
> > > @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
> > >   	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
> > >   	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
> > > -	if (!btt || !pfn || !dax)
> > > +	if (!btt && !pfn && !dax)
> > >   		return NULL;
> > >   	jcaps = json_object_new_array();
> > Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
> > 
> Thanks Jeff
> 
> 
> Hi Alison
> 
> Should I send a v3 with Reviewed-by tag or will you take the patch with the
> tag?

No need. The tags with gather automagically upon applying.
I'll also rm the text meant for below the --- like Zhijian noted.

Thanks for the patch!


> 
> Thanks
> Donet
> 
> > 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-26  7:00     ` Zhijian Li (Fujitsu)
@ 2025-02-27  6:13       ` Donet Tom
  0 siblings, 0 replies; 8+ messages in thread
From: Donet Tom @ 2025-02-27  6:13 UTC (permalink / raw)
  To: Zhijian Li (Fujitsu), Jeff Moyer, Donet Tom, Alison Schofield
  Cc: nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Ritesh Harjani


On 2/26/25 12:30, Zhijian Li (Fujitsu) wrote:
>
> On 26/02/2025 14:02, Donet Tom wrote:
>> On 2/20/25 19:05, Jeff Moyer wrote:
>>>> diff --git a/ndctl/json.c b/ndctl/json.c
>>>> index 23bad7f..7646882 100644
>>>> --- a/ndctl/json.c
>>>> +++ b/ndctl/json.c
>>>> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>>>>        struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>>>>        struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>>>> -    if (!btt || !pfn || !dax)
>>>> +    if (!btt && !pfn && !dax)
>>>>            return NULL;
>>>>        jcaps = json_object_new_array();
>>> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
>>>
>> Thanks Jeff
>>
>>
>> Hi Alison
>>
>> Should I send a v3 with Reviewed-by tag
> Generally speaking, there is no need for you to do this.
>
> A small tip might be helpful if you send a patch next time.
>
>>> v1 -> v2:
>>> Addressed the review comments from Jeff and Alison.
>>>
>>> v1:
>>> https://lore.kernel.org/all/20250219094049.5156-1-donettom@linux.ibm.com/
> Commit messages that are not intended to appear in the upstream git tree
> should be placed after the '---' marker. [0]
>

Thanks Zhijian. I will take care of this from now on.

Thanks
Donet


>
> [0] https://docs.kernel.org/process/submitting-patches.html#commentary
>
> Thanks
> Zhijian
>
>> or will you take the patch with the tag?
>>
>> Thanks
>> Donet
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
  2025-02-26 19:43     ` Alison Schofield
@ 2025-02-27  6:14       ` Donet Tom
  0 siblings, 0 replies; 8+ messages in thread
From: Donet Tom @ 2025-02-27  6:14 UTC (permalink / raw)
  To: Alison Schofield; +Cc: Jeff Moyer, Donet Tom, nvdimm, linux-cxl, Ritesh Harjani


On 2/27/25 01:13, Alison Schofield wrote:
> On Wed, Feb 26, 2025 at 11:32:30AM +0530, Donet Tom wrote:
>> On 2/20/25 19:05, Jeff Moyer wrote:
>>>> diff --git a/ndctl/json.c b/ndctl/json.c
>>>> index 23bad7f..7646882 100644
>>>> --- a/ndctl/json.c
>>>> +++ b/ndctl/json.c
>>>> @@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
>>>>    	struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
>>>>    	struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
>>>> -	if (!btt || !pfn || !dax)
>>>> +	if (!btt && !pfn && !dax)
>>>>    		return NULL;
>>>>    	jcaps = json_object_new_array();
>>> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
>>>
>> Thanks Jeff
>>
>>
>> Hi Alison
>>
>> Should I send a v3 with Reviewed-by tag or will you take the patch with the
>> tag?
> No need. The tags with gather automagically upon applying.
> I'll also rm the text meant for below the --- like Zhijian noted.


Thank you.


>
> Thanks for the patch!
>
>
>> Thanks
>> Donet
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-02-27  6:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20  6:20 [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX Donet Tom
2025-02-20 13:35 ` Jeff Moyer
2025-02-26  6:02   ` Donet Tom
2025-02-26  7:00     ` Zhijian Li (Fujitsu)
2025-02-27  6:13       ` Donet Tom
2025-02-26 19:43     ` Alison Schofield
2025-02-27  6:14       ` Donet Tom
2025-02-26  7:01 ` Zhijian Li (Fujitsu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox