All of lore.kernel.org
 help / color / mirror / Atom feed
* can call libcxl function outside ndctl tool?
@ 2021-10-19 17:55 Li Qiang
  2021-10-20  6:21 ` Verma, Vishal L
  0 siblings, 1 reply; 3+ messages in thread
From: Li Qiang @ 2021-10-19 17:55 UTC (permalink / raw)
  To: linux-cxl; +Cc: nvdimm, Dan Williams, Vishal Verma

Take cxl_cmd_new_identify as example.
There is CXL_EXPORT prefix, it seems can be called outside ndctl tool.
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);
}

```


Thanks
Johnny




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: can call libcxl function outside ndctl tool?
  2021-10-19 17:55 can call libcxl function outside ndctl tool? Li Qiang
@ 2021-10-20  6:21 ` Verma, Vishal L
  2021-10-20 19:28   ` Li Qiang
  0 siblings, 1 reply; 3+ messages in thread
From: Verma, Vishal L @ 2021-10-20  6:21 UTC (permalink / raw)
  To: johnny.li, linux-cxl; +Cc: Williams, Dan J, nvdimm

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
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: can call libcxl function outside ndctl tool?
  2021-10-20  6:21 ` Verma, Vishal L
@ 2021-10-20 19:28   ` Li Qiang
  0 siblings, 0 replies; 3+ messages in thread
From: Li Qiang @ 2021-10-20 19:28 UTC (permalink / raw)
  To: Verma, Vishal L, linux-cxl; +Cc: Williams, Dan J, nvdimm

On Wed, Oct 20, 2021 at 06:21:07AM +0000, Verma, Vishal L (vishal.l.verma@intel.com) wrote:
> 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.
Thanks for your confirmation

> 
> > 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.
These accessor getter APIs are used to decode output struct cxl_cmd.
Is there any setter APIs can construct the input struct cxl_memdev?

> 
> > 
> > 
> > Thanks
> > Johnny
> > 
> > 
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-20  7:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 17:55 can call libcxl function outside ndctl tool? Li Qiang
2021-10-20  6:21 ` Verma, Vishal L
2021-10-20 19:28   ` Li Qiang

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.