All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "johnny.li@montage-tech.com" <johnny.li@montage-tech.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Subject: Re: can call libcxl function outside ndctl tool?
Date: Wed, 20 Oct 2021 06:21:07 +0000	[thread overview]
Message-ID: <78e901122fa889e595e709d69a303446351540f4.camel@intel.com> (raw)
In-Reply-To: <20211019175518.GB47179@montage-desktop>

On Tue, 2021-10-19 at 13:55 -0400, Li Qiang wrote:
> Take cxl_cmd_new_identify as example.
> There is CXL_EXPORT prefix, it seems can be called outside ndctl tool.

Yes it can be linked to like any other library.

> While the intput and outpust struct cxl_memdev and cxl_cmd are private.
> 
> ```
> 
> CXL_EXPORT struct cxl_cmd *cxl_cmd_new_identify(struct cxl_memdev *memdev)
> {
> 	return cxl_cmd_new_generic(memdev, CXL_MEM_COMMAND_ID_IDENTIFY);
> }
> 
> ```

Right - the intention is that those structs always remain private.
Instead we provide accessor APIs to get fields out of the different
command structures. e.g. for 'identify' we have
cxl_cmd_identify_get_fw_rev, and so on. If there are other fields that
lack these getter APIs, we can definitely add them. e.g. The
health_info command has an exhaustive set of getter APIs.

> 
> 
> Thanks
> Johnny
> 
> 


  reply	other threads:[~2021-10-20  6:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 17:55 can call libcxl function outside ndctl tool? Li Qiang
2021-10-20  6:21 ` Verma, Vishal L [this message]
2021-10-20 19:28   ` Li Qiang

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=78e901122fa889e595e709d69a303446351540f4.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=johnny.li@montage-tech.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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.