STRUCT CXL_MEM_QUERY_COMMANDS(9)
π struct cxl_mem_query_commands(9) β Kernel API Manual, but make it make sense
okay so bestie, welcome to the struct cxl_mem_query_commands page, aka the Kernel API Manual entry you were definitely procrastinating on. this is the little struct that lets userspace be nosy (respectfully) about what commands the driver and hardware actually support. pull up a chair, grab a strawberry π, we're getting into it.
β¨ NAME β¨
struct cxl_mem_query_commands β Query supported commands. that's it, that's the whole vibe. it queries, it reports back, it slays. π
πΈ SYNOPSIS πΈ
struct cxl_mem_query_commands {
__u32 n_commands;
__u32 rsvd;
struct cxl_command_info __user commands[];
};
literally the whole struct right there, no cap. three fields, maximum main character energy. π
π Members π
n_commandsβ the in/out parameter, and she's doing the most. whenn_commandsis > 0, the driver will returnmin(num_support_commands, n_commands). whenn_commandsis 0, the driver will return the number of total supported commands. so likeβ¦ she's a question and an answer depending on what you feed her. icon behavior honestly. π¦rsvdβ Reserved for future use. she's just sitting there being mysterious, do not touch, do not ask, we don't know her yet. πcommandsβ Output array of supported commands. and listen, this is the part where you have to do your own homework: this array must be allocated by userspace to be at leastmin(num_support_commands, n_commands). the kernel is not allocating it for you, bestie, that's a you problem. π
π Description π
so what's the point of all this? it allows userspace to query the available commands supported by both the driver and the hardware. key word: both.
commands that aren't supported by either the driver, or the hardware, are not returned in the query. like, they simply do not get an invite to the function. not in the list, not in the group chat, nowhere. π«β¨
ngl this is the important bit β you're not getting a "maybe" pile, you're getting a filtered guest list of things that genuinely work on both sides. plan accordingly. π«Ά
π§ Examples π§
here's how the girlies actually use it:
{ .n_commands = 0 } // Get number of supported commands
yes, zero. setting it to 0 is the "hey how many of y'all are there" move. it's giving reconnaissance. π
{ .n_commands = 15, .commands = buf } // Return first 15 (or less) supported commands
and here you're like "okay give me up to 15" β note the or less, because sometimes there just aren't 15 to give and that's fine, she's doing her best. π
also: See struct cxl_command_info. go read that one next, it's the sequel and it's honestly a must. π
π¦ SEE ALSO π¦
- Kernel file
./include/uapi/linux/cxl_mem.hUAPI(9) struct cxl_command_info(9)struct cxl_send_command(9)
okay that's the whole page, you ate that fr fr π₯. this lil drop came from the source path ./include/uapi/linux, dated October 2026, and the page itself is struct cxl_...ery_commands(9) β yes the name is truncated in the header, no we don't know why, and yes it's still iconic. mwah, go query some commands bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms