efx_mcdi_rpc(9)
π efx_mcdi_rpc(9) β like, the MCDI command girlie β¨
okay so real talk, this is a page from the Kernel API Manual and it's all about efx_mcdi_rpc, which is the function you call when you want to drop an MCDI command and then just wait for it to finish. patient main character energy fr fr π
β¨ SYNOPSIS β¨
int efx_mcdi_rpc (struct efx_nic *efx , unsigned cmd , const efx_dword_t
*inbuf , size_t inlen , efx_dword_t *outbuf , size_t outlen , size_t
*outlen_actual );
like yes bestie, that's the whole signature, every asterisk accounted for π
π«Ά ARGUMENTS π«Ά
efxβ the NIC you're issuing the command through. that's the vibe, that's the venue πΈcmdβ the command type number. which command? this number. periodt.inbufβ the command parameters. your little payload πinlenβ length of the command parameters, in bytes. must be a multiple of 4 and no greater thanMCDI_CTL_SDU_LEN_MAX_V1β no cap, that's a hard limit, respect it πoutbufβ the response buffer. may beNULLifoutlenis 0. lowkey fine, highkey intentional πoutlenβ length of the response buffer, in bytes. if the actual response is longer thanoutlen & ~3, it will be truncated to that length. yes, truncated, that's just how it is πoutlen_actualβ pointer through which to return the actual response length. may beNULLif this is not needed. it's giving "optional but iconic" β¨
π¦ DESCRIPTION π¦
okay so the one thing you cannot skip: this function may sleep, and therefore it must be called in an appropriate context. do not come crying to me when you call it from somewhere spicy π that's the entire description, she's short and she knows it π
π₯ RETURN π₯
it returns a negative error code, or zero if successful. and listen, that error code has βοΈtwoβοΈ whole personalities:
- it may come from the MCDI response, or
- it may indicate a failure to communicate with the MC.
in the former case (MCDI said no), the response will still be copied to outbuf and *outlen_actual will be set accordingly β so like, read your buffer, the data's still there bestie π«Ά
in the latter case (couldn't even talk to the MC), *outlen_actual will be set to zero. nothing came back. empty. a whole void π
ngl, always check*outlen_actualβ the return code alone doesn't tell you whetheroutbufgot filled or got ghosted π»
π SEE ALSO π
- Kernel file
./drivers/net/ethernet/sfc/mcdi.c efx_mcdi_rpc_async(9)β the async sibling, go say hi π§
and that's the page!! π this little gem lives in ./drivers/net/ethernet/sfc and it was dated October 2026 β stan a manpage with a future timestamp, we love a forward-thinking icon β mwah, bye 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