All of lore.kernel.org
 help / color / mirror / Atom feed
From: alison.schofield@intel.com
To: 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 v12 0/8] Support poison list retrieval
Date: Wed, 27 Mar 2024 12:52:21 -0700	[thread overview]
Message-ID: <cover.1711519822.git.alison.schofield@intel.com> (raw)

From: Alison Schofield <alison.schofield@intel.com>

Changes since v11:
- Remove needless rc init (DaveJ)
- Update man page examples (Wonjae, Dan)
- Replace fprintf() w err() in libcxl.c  (Fan)
- Update stale --poison comment in unit test (Wonjae)
- Move ndctl/cxl/event_trace.c/.h to ndctl/util/  (Dan)
- Constify the pointer in poison_source array declaration
- Move the json flags from the poison_ctx to event_ctx
- Move intro of poison_ctx to parsing patch, Patch 6
- Add unsupported feature err() message in libcxl.c 
- v11: https://lore.kernel.org/cover.1710386468.git.alison.schofield@intel.com/


Begin cover letter:
Add the option to add a memory devices poison list to the cxl-list
json output. Offer the option by memdev and by region. 

From the man page cxl-list:

       -L, --media-errors
           Include media-error information. The poison list is retrieved from
           the device(s) and media_error records are added to the listing.
           Apply this option to memdevs and regions where devices support the
           poison list capability. "offset:" is relative to the region
           resource when listing by region and is the absolute device DPA when
           listing by memdev. "source:" is one of: External, Internal,
           Injected, Vendor Specific, or Unknown, as defined in CXL
           Specification v3.1 Table 8-140.

           # cxl list -m mem9 --media-errors -u
           {
             "memdev":"mem9",
             "pmem_size":"1024.00 MiB (1073.74 MB)",
             "pmem_qos_class":42,
             "ram_size":"1024.00 MiB (1073.74 MB)",
             "ram_qos_class":42,
             "serial":"0x5",
             "numa_node":1,
             "host":"cxl_mem.5",
             "media_errors":[
               {
                 "offset":"0x40000000",
                 "length":64,
                 "source":"Injected"
               }
             ]
           }

           # cxl list -r region5 --media-errors -u
           {
             "region":"region5",
             "resource":"0xf110000000",
             "size":"2.00 GiB (2.15 GB)",
             "type":"pmem",
             "interleave_ways":2,
             "interleave_granularity":4096,
             "decode_state":"commit",
             "media_errors":[
               {
                 "offset":"0x1000",
                 "length":64,
                 "source":"Injected"
               },
               {
                 "offset":"0x2000",
                 "length":64,
                 "source":"Injected"
               }
             ]
           }

           More complex cxl list queries can be created by using cxl list object
           and filtering options. The first example below emits all the endpoint
           ports with their decoders and memdevs with media-errors. The second
           example filters that output further by a single memdev.

              # cxl list -DEM -p endpoint --media-errors
              # cxl list -DEM -p mem9 --media-errors


Alison Schofield (8):
  util/trace: move trace helpers from ndctl/cxl/ to ndctl/util/
  util/trace: add an optional pid check to event parsing
  util/trace: pass an event_ctx to its own parse_event method
  util/trace: add helpers to retrieve tep fields by type
  libcxl: add interfaces for GET_POISON_LIST mailbox commands
  cxl/list: collect and parse media_error records
  cxl/list: add --media-errors option to cxl list
  cxl/test: add cxl-poison.sh unit test

 Documentation/cxl/cxl-list.txt |  64 ++++++++++-
 cxl/event_trace.h              |  27 -----
 cxl/filter.h                   |   3 +
 cxl/json.c                     | 195 +++++++++++++++++++++++++++++++++
 cxl/lib/libcxl.c               |  53 +++++++++
 cxl/lib/libcxl.sym             |   2 +
 cxl/libcxl.h                   |   2 +
 cxl/list.c                     |   3 +
 cxl/meson.build                |   2 +-
 cxl/monitor.c                  |  11 +-
 test/cxl-poison.sh             | 137 +++++++++++++++++++++++
 test/meson.build               |   2 +
 {cxl => util}/event_trace.c    |  68 +++++++++---
 util/event_trace.h             |  42 +++++++
 14 files changed, 562 insertions(+), 49 deletions(-)
 delete mode 100644 cxl/event_trace.h
 create mode 100644 test/cxl-poison.sh
 rename {cxl => util}/event_trace.c (76%)
 create mode 100644 util/event_trace.h


base-commit: 5e9157d6721a878757f0fe8a3c51f06f9e94934a
-- 
2.37.3


             reply	other threads:[~2024-03-27 19:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 19:52 alison.schofield [this message]
2024-03-27 19:52 ` [ndctl PATCH v12 1/8] util/trace: move trace helpers from ndctl/cxl/ to ndctl/util/ alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 2/8] util/trace: add an optional pid check to event parsing alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 3/8] util/trace: pass an event_ctx to its own parse_event method alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 4/8] util/trace: add helpers to retrieve tep fields by type alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 5/8] libcxl: add interfaces for GET_POISON_LIST mailbox commands alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 6/8] cxl/list: collect and parse media_error records alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 7/8] cxl/list: add --media-errors option to cxl list alison.schofield
2024-03-27 19:52 ` [ndctl PATCH v12 8/8] cxl/test: add cxl-poison.sh unit test 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.1711519822.git.alison.schofield@intel.com \
    --to=alison.schofield@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.