mlx5_eswitch_enable_locked(9)
β¨ mlx5_eswitch_enable_locked(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one is literally called mlx5_eswitch_enable_locked and it does exactly what it says on the tin: it enables the eswitch. that's it, that's the vibe. no cap, it's giving "small function, big responsibilities" π
π NAME π
mlx5_eswitch_enable_locked β Enable eswitch β¨
π¦ SYNOPSIS π¦
int mlx5_eswitch_enable_locked (struct mlx5_eswitch *esw , int num_vfs );
like, it takes a pointer to an eswitch and a number of VFs and hands you back an int. simple slay π
πΈ ARGUMENTS πΈ
eswβ bestie, this is a pointer to the eswitch. that's the whole thing. it's the main character of this function π«Άnum_vfsβ Enable eswitch for given number of VFs. This is optional. Valid value are0,> 0andMLX5_ESWITCH_IGNORE_NUM_VFS. here's the whole breakdown because it's lowkey important:- Caller should pass
num_vfs > 0when enabling eswitch for vf vports. π₯ - Caller should pass
num_vfs = 0, when eswitch is enabled without sriov VFs or when caller is unaware of the sriov state of the host PF on ECPF based eswitch. π - Caller should pass
< 0whennum_vfsshould be completely ignored. This is typically the case when eswitch is enabled without sriov regardless of PF/ECPF system. π
- Caller should pass
and now the actual behaviour, because yes there's lore: mlx5_eswitch_enable_locked Enables eswitch in either legacy or offloads mode. If num_vfs >=0 is provided, it setup VF related eswitch vports. It returns 0 on success or error code on failure. so like, 0 = we ate π, anything else = check the error code bestie π
π SEE ALSO π
- Kernel file
./drivers/net/ethernet/mellanox/mlx5/core/eswitch.c mlx5_esw_query_functions(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)
π§ sign-off π§
this little gem comes to you courtesy of ./drivers/net/ethernet/mellano... and it's dated October 2026 β so mark your calendars bestie, and remember: locked means locked, hold that lock properly or it's not gonna be iconic π π
β¨
π¦ 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