mbox series

[ndctl,0/2] cxl: Add cxl list image, image-from-file subcommands

Message ID cover.1660895649.git.sunfishho12@gmail.com
Headers show
Series cxl: Add cxl list image, image-from-file subcommands | expand

Message

Matthew Ho Aug. 19, 2022, 8:50 a.m. UTC
From: Matthew Ho <sunfishho12@gmail.com>

cxl list outputs a json array containing the cxl hierarchy, which can be parsed
to create an image of the cxl topology.

Patch 1 adds a root port attribute in the cxl list output to switch ports and
type 3 memory devices to allow determination of which devices hang off of which
root ports. This preps for patch 2.

Patch 2 adds a subcommand to output the cxl topology, using cxl list options.
Acceptable output formats include .jpeg, .jpg, and .png. It also adds a
subcommand to output the cxl topology given a text file generated by cxl list.

This pair of patches applies on [1], a pending patch, applied on the tip of the
create_region branch. The tip at the time of posting is:

commit 8f0433abc2a4 ("cxl/decoder: add a max_available_extent attribute")

[1] https://lore.kernel.org/linux-cxl/20220812221553.92278-1-sunfishho12@gmail.com/

Matthew Ho (2):
  cxl: Add root port attribute to cxl list output
  cxl: Add list image, image-from-file to CXL command

 Documentation/cxl/cxl-list.txt |  16 ++
 cxl/filter.c                   | 279 ++++++++++++++++++++++++++++++++-
 cxl/filter.h                   |   7 +
 cxl/json.c                     |  16 +-
 cxl/lib/libcxl.c               |  66 ++++++++
 cxl/lib/libcxl.sym             |   3 +-
 cxl/libcxl.h                   |   2 +
 cxl/list.c                     |  24 +++
 cxl/meson.build                |   1 +
 meson.build                    |   1 +
 10 files changed, 412 insertions(+), 3 deletions(-)

Comments

Verma, Vishal L Sept. 9, 2022, 9:40 p.m. UTC | #1
On Fri, 2022-08-19 at 01:50 -0700, sunfishho12@gmail.com wrote:
> From: Matthew Ho <sunfishho12@gmail.com>
> 
> cxl list outputs a json array containing the cxl hierarchy, which can be parsed
> to create an image of the cxl topology.

Hi Matthew,

I think this is great, would be nice to have it in the next release. I
have some comments on the patches, but otherwise the general direction
of things seems fine to me.

> 
> Patch 1 adds a root port attribute in the cxl list output to switch ports and
> type 3 memory devices to allow determination of which devices hang off of which
> root ports. This preps for patch 2.
> 
> Patch 2 adds a subcommand to output the cxl topology, using cxl list options.
> Acceptable output formats include .jpeg, .jpg, and .png. It also adds a

Quick note, I saw the default was 'topology.jpg'. I'm not familiar with
the graphviz libraries, but is it easy to create an SVG file instead?
That is a common format for things like this I imagine, and if it is
possible, it would be nice to have as the default.

> subcommand to output the cxl topology given a text file generated by cxl list.
> 
> This pair of patches applies on [1], a pending patch, applied on the tip of the
> create_region branch. The tip at the time of posting is:
> 
> commit 8f0433abc2a4 ("cxl/decoder: add a max_available_extent attribute")
> 
> [1] https://lore.kernel.org/linux-cxl/20220812221553.92278-1-sunfishho12@gmail.com/
> 
> Matthew Ho (2):
>   cxl: Add root port attribute to cxl list output
>   cxl: Add list image, image-from-file to CXL command
> 
>  Documentation/cxl/cxl-list.txt |  16 ++
>  cxl/filter.c                   | 279 ++++++++++++++++++++++++++++++++-
>  cxl/filter.h                   |   7 +
>  cxl/json.c                     |  16 +-
>  cxl/lib/libcxl.c               |  66 ++++++++
>  cxl/lib/libcxl.sym             |   3 +-
>  cxl/libcxl.h                   |   2 +
>  cxl/list.c                     |  24 +++
>  cxl/meson.build                |   1 +
>  meson.build                    |   1 +
>  10 files changed, 412 insertions(+), 3 deletions(-)
>