All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: "Schofield, Alison" <alison.schofield@intel.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Subject: Re: [ndctl PATCH 09/11] cxl/memdev: Add {reserve,free}-dpa commands
Date: Wed, 13 Jul 2022 08:04:58 +0000	[thread overview]
Message-ID: <cac1d3a7a7e6515b2db0ce7ee73db812686d3407.camel@intel.com> (raw)
In-Reply-To: <165765289554.435671.7351049564074120659.stgit@dwillia2-xfh>

On Tue, 2022-07-12 at 12:08 -0700, Dan Williams wrote:
> Add helper commands for managing allocations of DPA (device physical
> address) capacity on a set of CXL memory devices.
> 
> The main convenience this command affords is automatically picking the next
> decoder to allocate per-memdev.
> 
> For example, to allocate 256MiB from all endpoints that are covered by a
> given root decoder, and collect those resulting endpoint-decoders into an
> array:
> 
>   readarray -t mem < <(cxl list -M -d $decoder | jq -r ".[].memdev")
>   readarray -t endpoint < <(cxl reserve-dpa -t pmem ${mem[*]} -s $((256<<20)) |
>                             jq -r ".[] | .decoder.decoder")
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  .clang-format                    |    1 
>  Documentation/cxl/lib/libcxl.txt |    2 

I guess the new commands are mostly for debug only - but should we add
man pages for them?

>  cxl/builtin.h                    |    2 
>  cxl/cxl.c                        |    2 
>  cxl/filter.c                     |    4 -
>  cxl/filter.h                     |    2 
>  cxl/lib/libcxl.c                 |   86 ++++++++++++
>  cxl/lib/libcxl.sym               |    4 +
>  cxl/libcxl.h                     |    9 +
>  cxl/memdev.c                     |  276 ++++++++++++++++++++++++++++++++++++++
>  10 files changed, 385 insertions(+), 3 deletions(-)
> 

<snip>

> 
> +
> +       if (cxl_decoder_get_mode(target) != mode) {
> +               rc = cxl_decoder_set_dpa_size(target, 0);
> +               if (rc) {
> +                       log_err(&ml,
> +                               "%s: %s: failed to clear allocation to set mode\n",
> +                               devname, cxl_decoder_get_devname(target));
> +                       return rc;
> +               }
> +               rc = cxl_decoder_set_mode(target, mode);
> +               if (rc) {
> +                       log_err(&ml, "%s: %s: failed to set %s mode\n", devname,
> +                               cxl_decoder_get_devname(target),
> +                               mode == CXL_DECODER_MODE_PMEM ? "pmem" : "ram");
> +                       return rc;
> +               }
> +       }
> +
> +       rc = cxl_decoder_set_dpa_size(target, size);
> +       if (rc)
> +               log_err(&ml, "%s: %s: failed to set dpa allocation\n", devname,

This patch adds some >80 col lines, which is fine by me - maybe we
should update .clang-format to 100 to make it official?



  reply	other threads:[~2022-07-13  8:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 19:07 [ndctl PATCH 00/11] cxl: Region provisioning foundation Dan Williams
2022-07-12 19:07 ` [ndctl PATCH 01/11] cxl/list: Reformat option list Dan Williams
2022-07-13 19:04   ` [PATCH 1/11] " Davidlohr Bueso
2022-07-12 19:07 ` [ndctl PATCH 02/11] cxl/list: Emit endpoint decoders filtered by memdev Dan Williams
2022-07-12 19:07 ` [ndctl PATCH 03/11] cxl/list: Hide 0s in disabled decoder listings Dan Williams
2022-07-13 19:16   ` [PATCH 3/11] " Davidlohr Bueso
2022-07-12 19:07 ` [ndctl PATCH 04/11] cxl/list: Add DPA span to endpoint " Dan Williams
2022-07-12 19:07 ` [ndctl PATCH 05/11] cxl/lib: Maintain decoders in id order Dan Williams
2022-07-13 14:44   ` Ira Weiny
2022-07-13 16:23     ` Dan Williams
2022-07-13 19:45   ` [PATCH 5/11] " Davidlohr Bueso
2022-07-13 23:14     ` Dan Williams
2022-07-12 19:07 ` [ndctl PATCH 06/11] cxl/memdev: Fix json for multi-device partitioning Dan Williams
2022-07-12 19:08 ` [ndctl PATCH 07/11] cxl/list: Emit 'mode' for endpoint decoder objects Dan Williams
2022-07-12 19:08 ` [ndctl PATCH 08/11] cxl/set-partition: Accept 'ram' as an alias for 'volatile' Dan Williams
2022-07-13 19:06   ` [PATCH 8/11] " Davidlohr Bueso
2022-07-12 19:08 ` [ndctl PATCH 09/11] cxl/memdev: Add {reserve,free}-dpa commands Dan Williams
2022-07-13  8:04   ` Verma, Vishal L [this message]
2022-07-13 15:22     ` Dan Williams
2022-07-13 15:44       ` Verma, Vishal L
2022-07-13 16:55         ` Dan Williams
2022-07-12 19:08 ` [ndctl PATCH 10/11] cxl/test: Update CXL memory parameters Dan Williams
2022-07-12 19:08 ` [ndctl PATCH 11/11] cxl/test: Checkout region setup/teardown Dan Williams
2022-07-13  7:47   ` Verma, Vishal L
2022-07-13 14:47     ` Dan Williams
2022-07-13 15:15       ` Verma, Vishal L
2022-07-13 16:53         ` Dan Williams

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=cac1d3a7a7e6515b2db0ce7ee73db812686d3407.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.