Changes since v1[1]:
- Add 'firmware_version' retrieval for memdevs via sysfs attribute
- Add private data storage and accessors for libcxl
- Add a local copy of the UAPI header (cxl_mem.h)
- Refactor 'Identify' command support into a single patch
- Add libcxl APIs for get_lsa
- Add libcxl APIs for get_health_info
- Add libcxl APIs for firmware_status and out.size from cmd response
- Refactor common test helpers to make them more generic
- Add a hexdump helper in util/
- Add a new unit test, test/libcxl which tests:
- Basic sanity tests
- Module unload/load
- identify device command
- set_lsa (via RAW mode) command
- get_lsa command
- fuzzes command input/output payload sizes
- Fix install location of cxl headers
- Add section 3 man pages for libcxl API documentation (only two pages
added so far).
[1]:
https://lore.kernel.org/linux-cxl/20210112003403.2944568-1-vishal.l.verma...
---
Add a new utility and library to support CXL devices. This comprehends
the kernel's sysfs layout for CXL devices, and implements a command
submission harness for CXL mailbox commands via ioctl()s defined by the
cxl_mem driver.
A 'cxl-list' command is added which uses some of the libcxl APIs to
display a listing of CXL devices that includes attributes obtained via
sysfs.
Additionally, a new unit test is added to test the library and kernel
(ioctl) interfaces. This includes basic functionality tests for a subset
of the mailbox commands, as well as some negative tests to validate
graceful handling of malformed commands with unexpected buffer sizing
for payloads.
The unit tests are tied to the QEMU implementation[2] of CXL devices.
The latest kernel patches can be found at [3].
An ndctl branch with these patches is also available at [4]
[2]:
https://lore.kernel.org/linux-cxl/20210202005948.241655-1-ben.widawsky@in...
[3]:
https://lore.kernel.org/linux-cxl/20210217040958.1354670-1-ben.widawsky@i...
[4]:
https://github.com/pmem/ndctl/tree/cxl-2.0v2
Vishal Verma (13):
cxl: add a cxl utility and libcxl library
cxl: add a local copy of the cxl_mem UAPI header
libcxl: add support for command query and submission
libcxl: add support for the 'Identify Device' command
test: rename 'ndctl_test' to 'test_ctx'
test: rename 'ndctl_test_*' helpers to 'test_*'
test: introduce a libcxl unit test
libcxl: add GET_HEALTH_INFO mailbox command and accessors
libcxl: add support for the 'GET_LSA' command
util/hexdump: Add a util helper to print a buffer in hex
test/libcxl: add a test for {set, get}_lsa commands
Documentation/cxl: add library API documentation
test/libcxl: introduce a command size fuzzing test
Documentation/cxl/cxl-list.txt | 65 ++
Documentation/cxl/cxl.txt | 34 ++
Documentation/cxl/human-option.txt | 8 +
Documentation/cxl/lib/cxl_new.txt | 43 ++
Documentation/cxl/lib/libcxl.txt | 56 ++
Documentation/cxl/verbose-option.txt | 5 +
configure.ac | 4 +
Makefile.am | 10 +-
Makefile.am.in | 5 +
cxl/lib/private.h | 97 +++
cxl/lib/libcxl.c | 879 +++++++++++++++++++++++++++
cxl/builtin.h | 8 +
cxl/cxl_mem.h | 181 ++++++
cxl/libcxl.h | 82 +++
test.h | 40 +-
test/libcxl-expect.h | 13 +
util/filter.h | 2 +
util/hexdump.h | 8 +
util/json.h | 3 +
util/main.h | 3 +
cxl/cxl.c | 95 +++
cxl/list.c | 113 ++++
ndctl/bat.c | 8 +-
ndctl/test.c | 8 +-
test/ack-shutdown-count-set.c | 16 +-
test/blk_namespaces.c | 14 +-
test/core.c | 32 +-
test/dax-dev.c | 10 +-
test/dax-pmd.c | 13 +-
test/dax-poison.c | 6 +-
test/daxdev-errors.c | 2 +-
test/device-dax.c | 24 +-
test/dpa-alloc.c | 14 +-
test/dsm-fail.c | 14 +-
test/libcxl.c | 514 ++++++++++++++++
test/libndctl.c | 84 +--
test/multi-pmem.c | 23 +-
test/parent-uuid.c | 13 +-
test/pmem_namespaces.c | 14 +-
test/revoke-devmem.c | 12 +-
util/filter.c | 20 +
util/hexdump.c | 53 ++
util/json.c | 26 +
.gitignore | 5 +
Documentation/cxl/Makefile.am | 58 ++
Documentation/cxl/lib/Makefile.am | 58 ++
README.md | 2 +-
cxl/Makefile.am | 21 +
cxl/lib/Makefile.am | 32 +
cxl/lib/libcxl.pc.in | 11 +
cxl/lib/libcxl.sym | 57 ++
test/Makefile.am | 15 +-
52 files changed, 2754 insertions(+), 179 deletions(-)
create mode 100644 Documentation/cxl/cxl-list.txt
create mode 100644 Documentation/cxl/cxl.txt
create mode 100644 Documentation/cxl/human-option.txt
create mode 100644 Documentation/cxl/lib/cxl_new.txt
create mode 100644 Documentation/cxl/lib/libcxl.txt
create mode 100644 Documentation/cxl/verbose-option.txt
create mode 100644 cxl/lib/private.h
create mode 100644 cxl/lib/libcxl.c
create mode 100644 cxl/builtin.h
create mode 100644 cxl/cxl_mem.h
create mode 100644 cxl/libcxl.h
create mode 100644 test/libcxl-expect.h
create mode 100644 util/hexdump.h
create mode 100644 cxl/cxl.c
create mode 100644 cxl/list.c
create mode 100644 test/libcxl.c
create mode 100644 util/hexdump.c
create mode 100644 Documentation/cxl/Makefile.am
create mode 100644 Documentation/cxl/lib/Makefile.am
create mode 100644 cxl/Makefile.am
create mode 100644 cxl/lib/Makefile.am
create mode 100644 cxl/lib/libcxl.pc.in
create mode 100644 cxl/lib/libcxl.sym
--
2.29.2