From: alison.schofield@intel.com
To: Ben Widawsky <ben.widawsky@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>,
nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: [ndctl PATCH v4 0/6] Add partitioning support for CXL memdevs
Date: Mon, 7 Feb 2022 15:10:14 -0800 [thread overview]
Message-ID: <cover.1644271559.git.alison.schofield@intel.com> (raw)
From: Alison Schofield <alison.schofield@intel.com>
Users may want to view and change partition layouts of CXL memory
devices that support partitioning. Provide userspace access to
the device partitioning capabilities as defined in the CXL 2.0
specification.
The first 4 patches add accessors for all the information needed
to formulate a new partition layout. This info is accessible via
the libcxl API and a new option in the cxl list command:
"partition_info":{
"active_volatile_bytes":273535729664,
"active_persistent_bytes":0,
"next_volatile_bytes":268435456,
"next_persistent_bytes":273267294208,
"total_bytes":273535729664,
"volatile_only_bytes":0,
"persistent_only_bytes":0,
"partition_alignment_bytes":268435456
}
Patch 5 introduces the libcxl interfaces for the SET_PARTITION_INFO
mailbox command and Patch 6 adds the new CXL command:
Synopsis:
cxl set-partition <mem0> [<mem1>..<memN>] [<options>]
-t, --type=<type> 'pmem' or 'volatile' (Default: 'pmem')
-s, --size=<size> size in bytes (Default: all partitionable capacity)
-a, --align allow alignment correction
-v, --verbose turn on debug
The CXL command does not offer the IMMEDIATE mode option defined
in the CXL 2.0 spec because the CXL kernel driver does not support
immediate mode yet. Since userspace could use the libcxl API to
send a SET_PARTITION_INFO mailbox command with immediate mode
selected, a kernel patch that rejects such requests is in review
for the CXL driver.
Changes in v4: (from Dan's review)
- cxl set-partition command: add type (pmem | volatile),
add defaults for type and size, and add an align option.
- Replace macros with return statements with functions.
- Add cxl_set_partition_set_mode() to the libcxl API.
- Add API documentation to Documentation/cxl/lib/libcxl.txt.
- Use log_err/info mechanism.
- Display memdev JSON info upon completion of set-partition command.
- Remove unneeded casts when accessing command payloads.
- Name changes - like drop _info suffix, use _size instead of _bytes.
Changes in v3:
- Back out the API name change to the partition align accessor.
The API was already released in v72.
- Man page: collapse into one .txt file.
- Man page: add to Documentation/meson.build
Changes in v2:
- Rebase onto https://github.com/pmem/ndctl.git djbw/meson.
- Clarify that capacities are reported in bytes. (Ira)
This led to renaming accessors like *_capacity to *_bytes and
a spattering of changes in the man pages and commit messages.
- Add missing cxl_cmd_unref() when creating json objects. (Ira)
- Change the cxl list option to: -I --partition (Dan)
- Use OPT_STRING for the --volatile_size parameter (Dan, Vishal)
- Drop extra _get_ in accessor names. (Vishal)
- Add an accessor for the SET_PARTITION_INFO mbox cmd flag.
- Display usage_with_options if size parameter is missing.
- Drop the OPT64 define patch. Use OPT_STRING instead.
Alison Schofield (6):
libcxl: add GET_PARTITION_INFO mailbox command and accessors
libcxl: add accessors for capacity fields of the IDENTIFY command
libcxl: return the partition alignment field in bytes
cxl: add memdev partition information to cxl-list
libcxl: add interfaces for SET_PARTITION_INFO mailbox command
cxl: add command set-partition
Documentation/cxl/cxl-list.txt | 23 +++
Documentation/cxl/cxl-set-partition.txt | 60 ++++++++
Documentation/cxl/lib/libcxl.txt | 5 +
Documentation/cxl/meson.build | 1 +
cxl/builtin.h | 1 +
cxl/cxl.c | 1 +
cxl/filter.c | 2 +
cxl/filter.h | 1 +
cxl/json.c | 113 ++++++++++++++
cxl/lib/libcxl.c | 123 ++++++++++++++-
cxl/lib/libcxl.sym | 10 ++
cxl/lib/private.h | 18 +++
cxl/libcxl.h | 18 +++
cxl/list.c | 2 +
cxl/memdev.c | 196 ++++++++++++++++++++++++
util/json.h | 1 +
util/size.h | 1 +
17 files changed, 575 insertions(+), 1 deletion(-)
create mode 100644 Documentation/cxl/cxl-set-partition.txt
--
2.31.1
next reply other threads:[~2022-02-07 23:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 23:10 alison.schofield [this message]
2022-02-07 23:10 ` [ndctl PATCH v4 1/6] libcxl: add GET_PARTITION_INFO mailbox command and accessors alison.schofield
2022-02-08 20:20 ` Dan Williams
2022-02-08 20:46 ` Alison Schofield
2022-02-07 23:10 ` [ndctl PATCH v4 2/6] libcxl: add accessors for capacity fields of the IDENTIFY command alison.schofield
2022-02-08 20:34 ` Dan Williams
2022-02-08 20:48 ` Alison Schofield
2022-02-07 23:10 ` [ndctl PATCH v4 3/6] libcxl: return the partition alignment field in bytes alison.schofield
2022-02-08 20:38 ` Dan Williams
2022-02-07 23:10 ` [ndctl PATCH v4 4/6] cxl: add memdev partition information to cxl-list alison.schofield
2022-02-07 23:10 ` [ndctl PATCH v4 5/6] libcxl: add interfaces for SET_PARTITION_INFO mailbox command alison.schofield
2022-02-08 20:46 ` Dan Williams
2022-02-07 23:10 ` [ndctl PATCH v4 6/6] cxl: add command set-partition alison.schofield
2022-02-08 21:08 ` Dan Williams
2022-02-08 21:18 ` Alison Schofield
2022-02-08 17:23 ` [ndctl PATCH v4 0/6] Add partitioning support for CXL memdevs Dan Williams
2022-02-08 18:00 ` Alison Schofield
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=cover.1644271559.git.alison.schofield@intel.com \
--to=alison.schofield@intel.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.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 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.