linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "Widawsky, Ben" <ben.widawsky@intel.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"Schofield, Alison" <alison.schofield@intel.com>,
	"Weiny, Ira" <ira.weiny@intel.com>
Subject: Re: [ndctl PATCH v3 04/21] libcxl: add support for command query and submission
Date: Tue, 13 Jul 2021 14:39:45 -0700	[thread overview]
Message-ID: <CAPcyv4jpwCK5VUgpc8LBXN=ELxFLQkA7EkTENGfnYSwoHpYPfA@mail.gmail.com> (raw)
In-Reply-To: <14151c2efffe947103b881da5bbf38212786aa59.camel@intel.com>

On Tue, Jul 13, 2021 at 2:17 PM Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
>
> On Mon, 2021-07-12 at 22:12 -0700, Dan Williams wrote:
> > On Thu, Jul 1, 2021 at 1:10 PM Vishal Verma <vishal.l.verma@intel.com> wrote:
> > >
> > > Add a set of APIs around 'cxl_cmd' for querying the kernel for supported
> > > commands, allocating and validating command structures against the
> > > supported set, and submitting the commands.
> > >
> > > 'Query Commands' and 'Send Command' are implemented as IOCTLs in the
> > > kernel. 'Query Commands' returns information about each supported
> > > command, such as flags governing its use, or input and output payload
> > > sizes. This information is used to validate command support, as well as
> > > set up input and output buffers for command submission.
> >
> > It strikes me after reading the above that it would be useful to have
> > a cxl list option that enumerates the command support on a given
> > memdev. Basically a "query-to-json" helper.
>
> Hm, yes that makes sense..  There may not always be a 1:1 correlation
> between the commands returned by query and the actual cxl-cli command
> corresponding with that - and for some commands, there may not even be
> a cxl-cli equivalent. Do we want to create a json representation of the
> raw query data, or cxl-cli equivalents?

I was thinking it would purely be a list and association of that to
whether there is a cxl-cli helper for it is left as an exercise for
the reader. Especially when there may be commands that are upgraded
versions of existing commands and cxl-cli handles that difference in
the background.

>
> > >
> > > Cc: Ben Widawsky <ben.widawsky@intel.com>
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > > ---
> > >  cxl/lib/private.h  |  33 ++++
> > >  cxl/lib/libcxl.c   | 388 +++++++++++++++++++++++++++++++++++++++++++++
> > >  cxl/libcxl.h       |  11 ++
> > >  cxl/lib/libcxl.sym |  13 ++
> > >  4 files changed, 445 insertions(+)
> > >
> > [..]
> > > +static int cxl_cmd_alloc_query(struct cxl_cmd *cmd, int num_cmds)
> > > +{
> > > +       size_t size;
> > > +
> > > +       if (!cmd)
> > > +               return -EINVAL;
> > > +
> > > +       if (cmd->query_cmd != NULL)
> > > +               free(cmd->query_cmd);
> > > +
> > > +       size = sizeof(struct cxl_mem_query_commands) +
> > > +                       (num_cmds * sizeof(struct cxl_command_info));
> >
> > This is asking for the kernel's include/linux/overflow.h to be
> > imported into ndctl so that struct_size() could be used here. The file
> > is MIT licensed, just the small matter of factoring out only the MIT
> > licensed bits.
>
> Ah ok let me take a look.

I would certainly limit to just copying struct_size() for now and not
try to pull the whole header. If it turns into a larger ordeal and not
a quick copy feel free to table it for later.

  reply	other threads:[~2021-07-13 21:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 20:09 [ndctl PATCH v3 00/21] Initial CXL support Vishal Verma
2021-07-01 20:09 ` [ndctl PATCH v3 01/21] ndctl: add .clang-format Vishal Verma
2021-07-10  1:12   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 02/21] cxl: add a cxl utility and libcxl library Vishal Verma
2021-07-10  1:12   ` Dan Williams
2021-07-13 21:14     ` Verma, Vishal L
2021-07-01 20:09 ` [ndctl PATCH v3 03/21] cxl: add a local copy of the cxl_mem UAPI header Vishal Verma
2021-07-10  1:13   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 04/21] libcxl: add support for command query and submission Vishal Verma
2021-07-13  5:12   ` Dan Williams
2021-07-13 21:17     ` Verma, Vishal L
2021-07-13 21:39       ` Dan Williams [this message]
2021-07-01 20:09 ` [ndctl PATCH v3 05/21] libcxl: add support for the 'Identify Device' command Vishal Verma
2021-07-15 23:50   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 06/21] test: rename 'ndctl_test' to 'test_ctx' Vishal Verma
2021-07-15 23:51   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 07/21] test: rename 'ndctl_test_*' helpers to 'test_*' Vishal Verma
2021-07-15 23:51   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 08/21] test: introduce a libcxl unit test Vishal Verma
2021-07-15 23:53   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 09/21] libcxl: add GET_HEALTH_INFO mailbox command and accessors Vishal Verma
2021-07-16  1:11   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 10/21] libcxl: add support for the 'GET_LSA' command Vishal Verma
2021-07-16  2:24   ` Dan Williams
2021-07-01 20:09 ` [ndctl PATCH v3 11/21] util/hexdump: Add a util helper to print a buffer in hex Vishal Verma
2021-07-01 20:09 ` [ndctl PATCH v3 12/21] test/libcxl: add a test for {set, get}_lsa commands Vishal Verma
2021-07-01 20:09 ` [ndctl PATCH v3 13/21] test/libcxl: introduce a command size fuzzing test Vishal Verma
2021-07-01 20:09 ` [ndctl PATCH v3 14/21] libcxl: add lsa_size to cxl_memdev, and an API to retrieve it Vishal Verma
2021-07-01 20:09 ` [ndctl PATCH v3 15/21] libcxl: PLACEHOLDER: add an interface to determine whether a memdev is active Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 16/21] libcxl: add interfaces for label operations Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 17/21] test/libcxl: add a test for cxl_memdev_{get,set}_lsa Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 18/21] cxl: add commands to read, write, and zero labels Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 19/21] Documentation/cxl: add library API documentation Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 20/21] ndctl: Add CXL packages to the RPM spec Vishal Verma
2021-07-01 20:10 ` [ndctl PATCH v3 21/21] cxl-cli: add bash completion Vishal Verma
2021-07-01 20:13 ` [ndctl PATCH v3 00/21] Initial CXL support Verma, Vishal L

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='CAPcyv4jpwCK5VUgpc8LBXN=ELxFLQkA7EkTENGfnYSwoHpYPfA@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=ben.widawsky@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    --subject='Re: [ndctl PATCH v3 04/21] libcxl: add support for command query and submission' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).