Skip to content

Add error injection support

Ben Cheatham linux-cxl nvdimm 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest7 patches 3 repliesIn review
  2. v77 patches 5 repliesSuperseded
  3. v67 patches 10 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v57 patches19 repliesSuperseded
v47 patches10 repliesSuperseded
v37 patches12 repliesSuperseded
v27 patches2 repliesSuperseded
v16 patches3 repliesSuperseded

Changes in v8 from the cover letter

- Split inject-error command into 'inject-protocol-error', 'inject-media-poison' (Vishal, Alison)
- Rename 'cxl-clear-error' command to 'cxl-clear-media-poison' (Alison)
- Documentation rework to reflect new commands
- Cleaned up a few error prints
- Updated help messages
- Change "clear" param of poison_action() to "inj" and reverse usage accordingly
- Change cxl_memdev_has_poison_injection() to cxl_memdev_has_poison_support()
- Used in poison_action() (cxl/inject-error.c) to report missing functionality more accurately
- Print usage when '-a' option is missing for media-poison commands
- Remove checking if '-a' option is empty in poison_action() (no longer needed)
- Allow clearing poison when 'inject_poison' file is missing in debugfs (and vice versa)
- Updated cover letter and commit messages

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7libcxl: Add debugfs path to CXL contextcxl/lib/libcxl.c+37 -00 replies
2/7libcxl: Add CXL protocol errorscxl/lib/libcxl.c cxl/lib/libcxl.sym cxl/lib/private.h +1 more+225 -00 replies
3/7libcxl: Add poison injection supportcxl/lib/libcxl.c cxl/lib/libcxl.sym cxl/libcxl.h+89 -00 replies
4/7cxl: Add inject-protocol-error commandcxl/builtin.h cxl/cxl.c cxl/filter.c +3 more+174 -00 replies
5/7cxl: Add poison injection/clear commandscxl/builtin.h cxl/cxl.c cxl/inject-error.c+173 -00 replies
6/7cxl/list: Add injectable errors in outputcxl/json.c cxl/lib/libcxl.c cxl/lib/libcxl.sym +1 more+67 -90 replies
7/7Documentation: Add docs for protocol and poison injection commandsDocumentation/cxl/cxl-clear-media-poison.txt Documentation/cxl/cxl-inject-media-poison.txt Documentation/cxl/cxl-inject-protocol-error.txt +1 more+278 -00 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDave JiangVishal Verma
SeriesR-b
1/7R-b
2/7R-b
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [ndctl PATCH v8 0/7] Add error injection support

v8 Changes:
- Split inject-error command into 'inject-protocol-error', 'inject-media-poison' (Vishal, Alison)
- Rename 'cxl-clear-error' command to 'cxl-clear-media-poison' (Alison)
- Documentation rework to reflect new commands
- Cleaned up a few error prints
- Updated help messages
- Change "clear" param of poison_action() to "inj" and reverse usage accordingly
- Change cxl_memdev_has_poison_injection() to cxl_memdev_has_poison_support()
- Used in poison_action() (cxl/inject-error.c) to report missing functionality more accurately
- Print usage when '-a' option is missing for media-poison commands
- Remove checking if '-a' option is empty in poison_action() (no longer needed)
- Allow clearing poison when 'inject_poison' file is missing in debugfs (and vice versa)
- Updated cover letter and commit messages

v7 Changes:
- Use PATH_MAX instead of strlen(ctx->cxl_debugfs) for debugfs paths (Dave)
- Add goto for error paths to memdev poison functions in patch 3/7 (Dave)
- Add Dave's Reviewed-by tags

v6 Changes:
- Rebase to pending branch (Alison)
- Drop const for ctx->debugfs (Alison)
- Rename get_debugfs_dir() to get_cxl_debugfs_dir() and return cxl directory in debugfs (i.e. "/sys/kernel/debug" -> "/sys/kernel/debug/cxl")
- Rename ctx->debugfs to ctx->cxl_debugfs
- Fix missing free of einj path (Alison)
- Add protocol errors in order to perrors list (Alison)
- Use hex constants instead of BIT() for protocol errors (Alison)
- Add symbols to LIBCXL_11 instead of LIBCXL_10 (Alison)
- Update commit message to reflect util_cxl_dport_filter() behavior (Alison)
- Remove EINJ_TYPES_BUF_SIZE #ifdef (Alison)
- Fix type mismatch of addr in poison_action() (Alison)
- Fix inject_action() to catch missing 'type' option (Alison)
- Remove '-N' option and show the information behind that option by default when CXL debugfs is present (Alison)
- Add 'protocol_injectable' attribute for dports (Alison)
- Update inject-error man page with port injection example (Alison)
- Add warning to inject-error man page (Alison)

v5 Changes:
- Use setmntent()/getmntent() instead of open-coding getting the debugfs path (Dave)
- Use correct return code for sysfs_read_attr() (Dave)

This series adds support for injecting CXL protocol (CXL.cache/mem) errors[1] into CXL RCH Downstream ports and VH root ports[2] and poison into CXL memory devices through the CXL debugfs. Protocol errors are injected using a new 'inject-protocol-error' command. Device poison can be injected and cleared using the 'inject-media-poison' and 'clear-media-poison' commands, respectively. All three commands require access to the CXL driver's debugfs.

The documentation for the new commands show both usage and the possible device/error types, as well as how to retrieve them using cxl-list. cxl-list has been updated to include the possible error types for protocol error injection (under the "bus" object) and which CXL dports and memory devices support injection.

[1]: ACPI v6.5 spec, section 18.6.4
[2]: ACPI v6.5 spec, table 18.31

Ben Cheatham (7):
libcxl: Add debugfs path to CXL context
libcxl: Add CXL protocol errors
libcxl: Add poison injection support
cxl: Add inject-protocol-error command
cxl: Add poison injection/clear commands
cxl/list: Add injectable errors in output
Documentation: Add docs for protocol and poison injection commands

 Documentation/cxl/cxl-clear-media-poison.txt  |  85 +++++
 Documentation/cxl/cxl-inject-media-poison.txt |  85 +++++
 .../cxl/cxl-inject-protocol-error.txt         | 105 ++++++
 Documentation/cxl/meson.build                 |   3 +
 cxl/builtin.h                                 |   3 +
 cxl/cxl.c                                     |   3 +
 cxl/filter.c                                  |  26 ++
 cxl/filter.h                                  |   2 +
 cxl/inject-error.c                            | 312 +++++++++++++++++
 cxl/json.c                                    |  38 ++
 cxl/lib/libcxl.c                              | 329 ++++++++++++++++++
 cxl/lib/libcxl.sym                            |  10 +
 cxl/lib/private.h                             |  14 +
 cxl/libcxl.h                                  |  18 +
 cxl/meson.build                               |   1 +
 15 files changed, 1034 insertions(+)
 create mode 100644 Documentation/cxl/cxl-clear-media-poison.txt
 create mode 100644 Documentation/cxl/cxl-inject-media-poison.txt
 create mode 100644 Documentation/cxl/cxl-inject-protocol-error.txt
 create mode 100644 cxl/inject-error.c

base-commit: 39085f76b6a9d3ac349c3c5dab1cb820c86a293d

Signature · 1 line
2.52.0