efx_mcdi_rpc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 than MCDI_CTL_SDU_LEN_MAX_V1 β€” no cap, that's a hard limit, respect it πŸ™ˆ
  • outbuf β€” the response buffer. may be NULL if outlen is 0. lowkey fine, highkey intentional πŸ’œ
  • outlen β€” length of the response buffer, in bytes. if the actual response is longer than outlen & ~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 be NULL if 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:

  1. it may come from the MCDI response, or
  2. 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 whether outbuf got 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