Skip to contentSkip to conversation

cxl/mem: Clarify UAPI documentation

PATCH In review Ben Widawsky 2 participants 2 messages Apr 13, 2021 – Apr 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/mem: Clarify UAPI documentation

---
 include/uapi/linux/cxl_mem.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/uapi/linux/cxl_mem.h +7 -0
index f6e8a005b113..8dd516ddb098 100644
@@ -81,6 +81,13 @@ static const struct {
  *  - @size_in = -1
  *  - @size_out = 0
  *
+ * Commands which have a variable length input likely have a minimum length.
+ * This is not enforced by the UAPI, and therefore might look like the command
+ * succeeded when sending too small of an input payload. Caution should be taken
+ * by checking the @cxl_send_command.retval for such cases. For commands with a
+ * variable length output, the caller is free to consume as little or as much as
+ * they want.
+ *
  * See struct cxl_mem_query_commands.
  */
 struct cxl_command_info {
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · On Tue, 13 Apr 2021 07:32:47 -0700 Ben Widawsky <[email protected]> wrote:

Sensible update.

Quoted 22 lines
---
 include/uapi/linux/cxl_mem.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/uapi/linux/cxl_mem.h +7 -0
index f6e8a005b113..8dd516ddb098 100644
@@ -81,6 +81,13 @@ static const struct {
  *  - @size_in = -1
  *  - @size_out = 0
  *
+ * Commands which have a variable length input likely have a minimum length.
+ * This is not enforced by the UAPI, and therefore might look like the command
+ * succeeded when sending too small of an input payload. Caution should be taken
+ * by checking the @cxl_send_command.retval for such cases. For commands with a
+ * variable length output, the caller is free to consume as little or as much as
+ * they want.
+ *
  * See struct cxl_mem_query_commands.
  */
 struct cxl_command_info {