nfp_cpp_mutex_alloc(9)
β¨ nfp_cpp_mutex_alloc(9) β¨
okay so bestie, welcome to the Kernel API Manual entry for nfp_cpp_mutex_alloc(9) β this is the glow-up guide to making a mutex handle and honestly it's giving "small function, big responsibility" π
π NAME π
nfp_cpp_mutex_alloc β Create a mutex handle π
πΈ SYNOPSIS πΈ
struct nfp_cpp_mutex * nfp_cpp_mutex_alloc (struct nfp_cpp *cpp , int
target , unsigned long long address , u32 key );
like, that's the whole signature, no cap. four args, one struct pointer back. slay.
π¦ ARGUMENTS π¦
cppβ the NFP CPP handle π like, your main character context object, you literally cannot do this without ittargetβ the NFP CPP target ID (ieNFP_CPP_TARGET_CLSorNFP_CPP_TARGET_MU) β¨ so you gotta say where you're pointing, bestieaddressβ offset into the address space of the NFP CPP target ID π it's a location, not a vibekeyβ a 32-bit unique key (must match the key at this location) π and yeah, it must match the key already sitting at that location, no faking it
π§ DESCRIPTION π§
okay so here's the tea π: the CPP target:address must point to a 64-bit aligned location, and you gotta reserve 64 bits of data at that location for use by the handle. like actually reserve them, don't be messy about it π
and ngl, only target/address pairs that point to entities supporting the MU Atomic Engine's CmpAndSwap32 command are supported. so if your pair doesn't support that, it's simply not the moment π no exceptions, that's just the rules.
π RETURN π
- A non-
NULLstruct nfp_cpp_mutex *on success π NULLon failure π (she's not mad, she's just disappointed)
π₯ SEE ALSO π₯
- Kernel file
./drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c nfp_cpp_mutex_init(9)nfp_cpp_mutex_free(9)nfp_cpp_mutex_lock(9)nfp_cpp_mutex_unlock(9)nfp_cpp_mutex_trylock(9)nfp_cpp_mutex_reclaim(9)
kk that's the whole page bestie, go forth and allocate responsibly π«Ά
source: ./drivers/net/ethernet/netrono... β version date: October 2026 β mwah, that's the sign-off, nfp_cpp_mutex_alloc(9) out ππ
π¦ 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