mlx5_fpga_mem_write(9)
π mlx5_fpga_mem_write β bestie edition π
Okay so this is mlx5_fpga_mem_write, a little function from the Linux Kernel API Manual (that's the manual name, bestie, it's a whole kernel thing) and honestly? It's the "put stuff INTO the FPGA" girlie. Let's get into it π
β¨ NAME β¨
mlx5_fpga_mem_write β write into the FPGA memory address space. That's it, that's the vibe π
πΈ SYNOPSIS πΈ
int mlx5_fpga_mem_write (struct mlx5_fpga_device *fdev , size_t size ,
u64 addr , void *buf , enum mlx5_fpga_access_type access_type );
Yes the spacing is a little chaotic, no we're not fixing it, she's iconic as-is π
π¦ ARGUMENTS π¦
fdevβ the FPGA device itself. The main character, the one you're writing to π«Άsizeβ how big the chunk you're writing is, in bytes. Measure twice, write once, ngl.addrβ the starting address you're writing to, in FPGA address space. This is where the magic lands β¨bufβ the buffer holding the data you wanna write. Your lil payload πaccess_typeβ the method used for writing. Yes there's more than one way, and you get to pick π
β DESCRIPTION β
So what it does: it writes the data from the buffer you passed to FPGA memory at the address you specified. Simple, clean, slay π
Now the important part, bestie, listen up: that address can point to configuration space or to DDR. Both are valid, she's flexible like that.
And here's the caveat you cannot skip β large writes may be performed internally as several non-atomic operations. So like, if you're expecting one big atomic write for a big chunk? No ma'am. It's giving "we'll get there in pieces" π
Also: this function may sleep, so it should not be called from atomic contexts. Deadass. Do not do it. Take her somewhere she can nap π΄
π₯ RETURN π₯
0 if it worked, or an error value otherwise. That's the whole story. Zero means slay, anything else means something went sideways π
π SEE ALSO π
The kernel file ./drivers/net/ethernet/mellanox/mlx5/core/fpga/sdk.h, plus the whole friend group:
- Innova SDK(9)
enum mlx5_fpga_access_type(9)struct mlx5_fpga_dma_entry(9)struct mlx5_fpga_dma_buf(9)struct mlx5_fpga_conn_attr(9)mlx5_fpga_sbu_conn_create(9)mlx5_fpga_sbu_conn_destroy(9)mlx5_fpga_sbu_conn_sendmsg(9)mlx5_fpga_mem_read(9) β the reader sister, her counterpart π―mlx5_fpga_get_sbu_caps(9)
Lowkey reminder: no atomic contexts, bestie. She sleeps. Respect the nap π§
And that's the whole page! Signing off with the source, which is ./drivers/net/ethernet/mellano..., dated October 2026 β so like, future girlie energy fr fr π¦β¨π
π¦ 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