On Thu, Oct 7, 2021 at 1:22 AM Vishal Verma <[email protected]> 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. > > Cc: Ben Widawsky <[email protected]> > Cc: Dan Williams <[email protected]> > Signed-off-by: Vishal Verma <[email protected]> > --- [..] > +CXL_EXPORT int cxl_cmd_submit(struct cxl_cmd *cmd) > +{ > + struct cxl_memdev *memdev = cmd->memdev; > + const char *devname = cxl_memdev_get_devname(memdev); > + struct cxl_ctx *ctx = cxl_memdev_get_ctx(memdev); > + int rc; > + > + switch (cmd->query_status) {
Ah, now I see why you proposed having another flag in the cxl_query_cmd() payload to indicate hardware support for the command. to save having to validate before each command. I wouldn't mind a TODO here to remind about that... but not critical: You can add: Reviewed-by: Dan Williams <[email protected]>
