Linux CXL
 help / color / mirror / Atom feed
From: sunfishho12@gmail.com
To: linux-cxl@vger.kernel.org
Cc: dan.j.williams@intel.com, vishal.l.verma@intel.com,
	dave@stgolabs.net, a.manzanares@samsung.com,
	Matthew Ho <sunfishho12@gmail.com>
Subject: [PATCH ndctl] cxl: Add list all option to the cxl command
Date: Thu, 14 Jul 2022 11:27:37 -0700	[thread overview]
Message-ID: <20220714182737.60714-1-sunfishho12@gmail.com> (raw)

From: Matthew Ho <sunfishho12@gmail.com>

This adds a new subcommand cxl list --all, which is equivalent to cxl list -MBPEDTHIiu. This addition makes it easier to list all the CXL devices at once, as one does not need to append a subcommand for each device. --all is also easier to remember than -MBPEDTHIiu. When region support is added, this will be updated to include it.

Reviewed-by: Adam Manzanares <a.manzanares@samsung.com>
Signed-off-by: Matthew Ho <sunfishho12@gmail.com>
---
 cxl/filter.h |  1 +
 cxl/list.c   | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/cxl/filter.h b/cxl/filter.h
index 697b7779c08e..7009c00a1c23 100644
--- a/cxl/filter.h
+++ b/cxl/filter.h
@@ -13,6 +13,7 @@ struct cxl_filter_params {
 	const char *port_filter;
 	const char *endpoint_filter;
 	const char *decoder_filter;
+	bool all;
 	bool single;
 	bool endpoints;
 	bool decoders;
diff --git a/cxl/list.c b/cxl/list.c
index 1e9d441190a0..738282e95434 100644
--- a/cxl/list.c
+++ b/cxl/list.c
@@ -50,6 +50,8 @@ static const struct option options[] = {
 		    "include memory device health information "),
 	OPT_BOOLEAN('I', "partition", &param.partition,
 		    "include memory device partition information "),
+	OPT_BOOLEAN(0, "all", &param.all,
+		    "include info on all components of the CXL hierarchy"),
 #ifdef ENABLE_DEBUG
 	OPT_BOOLEAN(0, "debug", &debug, "debug list walk"),
 #endif
@@ -82,6 +84,19 @@ int cmd_list(int argc, const char **argv, struct cxl_ctx *ctx)
 		usage_with_options(u, options);
 	}

+	if (param.all){
+		param.memdevs = true;
+		param.buses = true;
+		param.ports = true;
+		param.endpoints = true;
+		param.decoders = true;
+		param.partition = true;
+		param.health = true;
+		param.targets = true;
+		param.human = true;
+		param.idle = true;
+	}
+
 	if (num_list_flags() == 0) {
 		if (param.memdev_filter || param.serial_filter)
 			param.memdevs = true;
--
2.34.1


             reply	other threads:[~2022-07-14 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 18:27 sunfishho12 [this message]
2022-07-14 19:19 ` [PATCH ndctl] cxl: Add list all option to the cxl command Verma, Vishal L
2022-07-14 19:15   ` Davidlohr Bueso
2022-07-14 23:16     ` Matthew Ho

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=20220714182737.60714-1-sunfishho12@gmail.com \
    --to=sunfishho12@gmail.com \
    --cc=a.manzanares@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=linux-cxl@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox