mlx5_esw_query_functions(9)
π mlx5_esw_query_functions β okay bestie, let's talk β¨
So this is a page from the Kernel API Manual, and the function we're stanning today is literally called mlx5_esw_query_functions. Yes that's a mouthful, yes it's iconic, no we're not shortening it. π
πΈ NAME πΈ
mlx5_esw_query_functions β returns raw output about functions state. That's the whole vibe. It gives you the raw deets on what's up with the functions, no filter, no cleanup, just vibes and bytes. π
β¨ SYNOPSIS β¨
const u32 * mlx5_esw_query_functions (struct mlx5_core_dev *dev );
Periodt. That's the signature. Look at that const u32 * β it's giving pointer-to-const, main character energy. π
π¦ ARGUMENTS π¦
devβ pointer to the device you wanna query, bestie. That's it. That's the whole argument list. Just hand over the device and let it cook. π₯
π DESCRIPTION π
Okay so here's the tea, fr fr:
mlx5_esw_query_functions allocates and returns a functions changed raw output memory pointer from the device on success. Slay. It went and got you the goods. π«Ά
Otherwise? It returns ERR_PTR. π Yeah. Not a real pointer, an error wearing a pointer's outfit. Check before you dereference, iykyk.
β οΈ The rule that is NOT optional: the caller must free the memory usingkvfreewhen a valid pointer is returned. Notkfree. Not vibes.kvfree. If you skip this you're leaking memory and that's not the aesthetic we're going for. π
π SEE ALSO π
Like, go read the source, it's literally right there:
- Kernel file
./drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
And the whole friend group, all of them, no cap:
mlx5_eswitch_enable_locked(9)mlx5_eswitch_enable(9)mlx5_esw_hold(9)mlx5_esw_release(9)mlx5_esw_get(9)mlx5_esw_put(9)mlx5_esw_try_lock(9)mlx5_esw_unlock(9)mlx5_eswitch_get_total_vports(9)mlx5_eswitch_get_core_dev(9)
β¨ That's the whole page, bestie! β¨ Big love to the kernel source at ./drivers/net/ethernet/mellano... (yes the truncation is part of the lore π) and to the October 2026 release date. Go free your kvfree-able memory and hydrate. π
ππΈ
π¦ 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