Linux CXL
 help / color / mirror / Atom feed
From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Donet Tom <donettom@linux.vnet.ibm.com>,
	Alison Schofield <alison.schofield@intel.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: Ritesh Harjani <ritesh.list@gmail.com>,
	Li Zhijian Jeff Moyer <"lizhijian@fujitsu.comjmoyer"@redhat.com>
Subject: Re: [PATCH] [ndctl PATCH v2] ndctl/list: display region caps for any of BTT, PFN, DAX
Date: Wed, 26 Feb 2025 07:01:21 +0000	[thread overview]
Message-ID: <74c8b6c7-b9f6-465e-95f8-57472d5ccb2a@fujitsu.com> (raw)
In-Reply-To: <20250220062029.9789-1-donettom@linux.vnet.ibm.com>



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();

      parent reply	other threads:[~2025-02-26  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74c8b6c7-b9f6-465e-95f8-57472d5ccb2a@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc="lizhijian@fujitsu.comjmoyer"@redhat.com \
    --cc=alison.schofield@intel.com \
    --cc=donettom@linux.vnet.ibm.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox