STRUCT CXL_COMMAND_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cxl_command_info(9) πŸ’…

hii bestie, welcome to the glow-up of your life β€” this is the struct cxl_command_info(9) page from the Kernel API Manual, and ngl it's lowkey iconic. it's giving "tiny struct, big main character energy." let's get into it 🫢


✨ NAME ✨

struct cxl_command_info β€” Command information returned from a query. that's the whole vibe, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

okay so picture the struct, right? here she is, exactly as she comes, no edits:

struct cxl_command_info {
    __u32 id;
    __u32 flags;
  #define CXL_MEM_COMMAND_FLAG_MASK               GENMASK(1, 0);
  #define CXL_MEM_COMMAND_FLAG_ENABLED            BIT(0);
  #define CXL_MEM_COMMAND_FLAG_EXCLUSIVE          BIT(1);
    __u32 size_in;
    __u32 size_out;
 };

not me zooming in on every single #define β€” yes, the semicolons are there, yes, we are copying them character for character, periodt πŸ’€


🌸 MEMBERS 🌸

  • id β€” the ID number for the command. it's literally her name tag 🏷️
  • flags β€” flags that specify command behavior. the personality settings, if you will ✨
  • size_in β€” expected input size, or ~0 if variable length. so ~0 means "idk bestie, it varies" 🌈
  • size_out β€” expected output size, or ~0 if variable length. same deal, ~0 = variable length, no cap πŸ¦‹

🧚 DESCRIPTION 🧚

CXL_MEM_COMMAND_FLAG_USER_ENABLED

okay so: the given command id is supported by the driver and it's supported by a related opcode on the device. both sides said yes, it's a whole mutual thing πŸ’–

CXL_MEM_COMMAND_FLAG_EXCLUSIVE

🚨 bestie listen β€” requests with the given command id will terminate with EBUSY because the kernel is actively owning management of that resource. like, the kernel has claimed it, it's her resource now, back off 😭

for example, the label-storage-area can not be written while the kernel is actively managing that space. do not try it. that's the whole warning. πŸ’€

what even is this struct, fr fr

she represents a single command that is supported by both the driver and the hardware β€” both, together, a duo πŸ‘‘ and she's returned as part of an array from the query ioctl.

so like, the following would be a command that takes a variable length input and returns 0 bytes of output β€” look at her go:

  • id = 10
  • flags = CXL_MEM_COMMAND_FLAG_ENABLED
  • size_in = ~0
  • size_out = 0

see that? ~0 in, 0 out. the way that works is honestly so satisfying πŸ“

also, go look at struct cxl_mem_query_commands β€” she's the friend this struct rolls with 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

the girlies and guys you should also be reading:

  • Kernel file ./include/uapi/linux/cxl_mem.h UAPI(9) πŸ“
  • struct cxl_mem_query_commands(9)
  • struct cxl_send_command(9)

and that's the page!! that's her!! πŸ’–

so this lil drop comes to you from the source path ./include/uapi/linux, dated October 2026, and she answers to the name struct cxl_command_info(9). slay, bye, go read your headers πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from